add fallback if document.currentScript is not available (e.g. with Webkitties)

Fixes #693
All roads, except exceptions, lead to !string.