ScriptPath [browser] Get base path from loaded script. Install npm install kc-scriptpath Use var pth = scriptPath('my-script.js'); console.log(pth);