document.currentScript is less magic than I'd hoped