1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-01 10:00:10 +12:00

script injection can throw when not a real HTML document

This commit is contained in:
gorhill 2015-05-14 10:53:49 -04:00
parent 1aa8b4fc1e
commit 714c02232a

View file

@ -204,8 +204,14 @@ 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);
// 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 doc = e.target;