diff --git a/xul/content/static.js b/xul/content/static.js --- a/xul/content/static.js +++ b/xul/content/static.js @@ -3084,17 +3084,17 @@ function getFrameForDOMWindow(window) } function replaceColorCodes(msg) { // Find things that look like URLs and escape the color code inside of those // to prevent munging the URLs resulting in broken links. Leave codes at // the start of the URL alone. msg = msg.replace(new RegExp(client.linkRE.source, "g"), function(url, _foo, scheme) { - if (!client.checkURLScheme(scheme)) + if (scheme && !client.checkURLScheme(scheme)) return url; return url.replace(/%[BC][0-9A-Fa-f]/g, function(hex, index) { // as JS does not support lookbehind and we don't want to consume the // preceding character, we test for an existing %% manually var needPercent = ("%" == url.substr(index - 1, 1)) || (index == 0); return (needPercent ? "" : "%") + hex; }); }); @@ -4321,16 +4321,22 @@ function cli_load(url, scope) const mozIJSSubScriptLoader = Components.interfaces.mozIJSSubScriptLoader; var cls; if ((cls = Components.classes[LOADER_CTRID])) client._loader = cls.getService(mozIJSSubScriptLoader); } + if (client._loader.loadSubScriptWithOptions) + { + var opts = {target: scope, ignoreCache: true}; + return client._loader.loadSubScriptWithOptions(url, opts); + } + return client._loader.loadSubScript(url, scope); } client.sayToCurrentTarget = function cli_say(msg, isInteractive) { if ("say" in client.currentObject) {