scripts/loader-src.js
/**
     * Injects a script loaded from localStorage into the DOM.
     * If the script version is differnt than the requested one, the localStorage key is
     * cleared and a new version will be loaded next time.
     * @param {string} jsonContent wrapped serialized code
     * @param {string} url path/to/script.[js,css]
     * @param {string} scriptname (see `requireScript`)
     * @param {string} version (see `requireScript`)
     * @param {number} cache cache type
     */
Injects a script loaded from localStorage into the DOM.
If the script version is differnt than the requested one, the localStorage key is
cleared and a new version will be loaded next time.
Injects a script loaded from localStorage into the DOM . If the script version is differnt than the requested one the localStorage key is cleared and a new version will be loaded next time .
injectScript(jsonContent, url, scriptname, version, cache) {
        let content = JSON.parse(jsonContent);
        if (content.version !== version) {
            localStorage.removeItem(scriptname);
            this.loadScript(url, scriptname, cache, version);
            return;
        }
        this.appendScriptNode(content.content, url);
        this.scripts[scriptname].isLoaded = this.stages.fin;
        if (info) {
            console.log('injectScript script ready %s', scriptname);
        }
        this.tryLoad();
    }
injectScript ( jsonContent , url , scriptname , version , cache ) { let content = JSON . parse ( jsonContent ) ; if ( content . version !== version ) { localStorage . removeItem ( scriptname ) ; this . loadScript ( url , scriptname , cache , version ) ; return ; } this . appendScriptNode ( content . content , url ) ; this . scripts [ scriptname ] . isLoaded = this . stages . fin ; if ( info ) { console . log ( 'injectScript script ready %s' , scriptname ) ; } this . tryLoad ( ) ; }
Injects a script loaded from localStorage into the DOM.
Injects a script loaded from localStorage into the DOM .
// cached version is not the request version, clear the cache, this will trigger a reload next time