Resolve `currentScript` bug of safari