Commit dcc204c0 authored by Romain Casati's avatar Romain Casati
Browse files

Fallback for urlScript when set from global scope.

parent ed971ab3
......@@ -32,9 +32,12 @@
* document.currentScript will be undefined.
*/
this._urlScript = (function () {
if( module != null ) {
let url = window.location.origin + window.location.pathname;
url = url.substring(0, url.lastIndexOf('/')) + "/";
let url = window.location.origin + window.location.pathname;
url = url.substring(0, url.lastIndexOf('/')) + "/";
if( window.BASTHON_KERNEL_SCRIPT != null ) {
return url + window.BASTHON_KERNEL_SCRIPT;
} else if( module != null ) {
return url + module.uri;
} else
return document.currentScript.src;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment