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

Fixes #693
Where I was too lazy to investigate, you were not. (well, !string|undefined you mean, no? at least in theory also points could be reached where (implicitly) undefined is returned)
Done.