window.getRunningScript = () => { return () => { return new Error().stack.match(/([^ ])*([a-z]*:///?)*?[a-z0-9/]*.js/ig)[0] } } console.log('%c Currently running script:', 'color: blue', getRunningScript()())