From 334855dcf7c474035754d296ed272ddcccb5e770 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 16 May 2015 16:31:44 -0400 Subject: [PATCH] injected script can throw --- platform/firefox/frameModule.js | 10 +++++++--- platform/firefox/vapi-background.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 9aff492e5..8cd16b653 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -284,8 +284,12 @@ const contentObserver = { let lss = Services.scriptloader.loadSubScript; let sandbox = this.initContentScripts(win, true); - lss(this.contentBaseURI + 'vapi-client.js', sandbox); - lss(this.contentBaseURI + 'contentscript-start.js', sandbox); + try { + lss(this.contentBaseURI + 'vapi-client.js', sandbox); + lss(this.contentBaseURI + 'contentscript-start.js', sandbox); + } catch (ex) { + return; + } let docReady = (e) => { let doc = e.target; @@ -328,7 +332,7 @@ LocationChangeListener.prototype.onLocationChange = function(webProgress, reques if ( !webProgress.isTopLevel ) { return; } - + this.messageManager.sendAsyncMessage(locationChangedMessageName, { url: location.asciiSpec, flags: flags, diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 8556355b7..1bf5d9918 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1329,7 +1329,7 @@ vAPI.net.registerListeners = function() { var details = e.data; var browser = e.target; var tabId = vAPI.tabs.getTabId(browser); - + //console.debug("nsIWebProgressListener: onLocationChange: " + details.url + " (" + details.flags + ")"); // LOCATION_CHANGE_SAME_DOCUMENT = "did not load a new document"