Fix currentScript for PhantomJS