Browse Source

script injection can throw when not a real HTML document

pull/2/head
gorhill 9 years ago
parent
commit
714c02232a
  1. 10
      platform/firefox/frameModule.js

10
platform/firefox/frameModule.js

@ -204,8 +204,14 @@ const contentObserver = {
let lss = Services.scriptloader.loadSubScript; let lss = Services.scriptloader.loadSubScript;
let sandbox = this.initContentScripts(win, true); let sandbox = this.initContentScripts(win, true);
lss(this.contentBaseURI + 'vapi-client.js', sandbox);
lss(this.contentBaseURI + 'contentscript-start.js', sandbox);
// Can throw with attempts at injecting into non-HTML document.
// Example: https://a.pomf.se/avonjf.webm
try {
lss(this.contentBaseURI + 'vapi-client.js', sandbox);
lss(this.contentBaseURI + 'contentscript-start.js', sandbox);
} catch (ex) {
return; // don't further try to inject anything
}
let docReady = (e) => { let docReady = (e) => {
let doc = e.target; let doc = e.target;

Loading…
Cancel
Save