From 93d28a8e3846b73f4e37aa197f092322139a3a85 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 16 Nov 2015 09:02:58 -0500 Subject: [PATCH] this fixes https://github.com/gorhill/uBlock/issues/845 --- platform/firefox/vapi-common.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/firefox/vapi-common.js b/platform/firefox/vapi-common.js index 89e4423..a2dd5c6 100644 --- a/platform/firefox/vapi-common.js +++ b/platform/firefox/vapi-common.js @@ -19,7 +19,6 @@ Home: https://github.com/gorhill/uMatrix */ -/* jshint esnext: true */ /* global sendAsyncMessage */ // For background page or non-background pages @@ -37,7 +36,7 @@ const {Services} = Components.utils.import( null ); -self.vAPI = self.vAPI || {}; +var vAPI = self.vAPI = self.vAPI || {}; /******************************************************************************/ @@ -75,6 +74,9 @@ vAPI.insertHTML = (function() { const parser = Components.classes['@mozilla.org/parserutils;1'] .getService(Components.interfaces.nsIParserUtils); + // https://github.com/gorhill/uBlock/issues/845 + // Apparently dashboard pages execute with `about:blank` principal. + return function(node, html) { while ( node.firstChild ) { node.removeChild(node.firstChild); @@ -84,7 +86,7 @@ vAPI.insertHTML = (function() { html, parser.SanitizerAllowStyle, false, - Services.io.newURI(document.baseURI, null, null), + Services.io.newURI('about:blank', null, null), document.documentElement )); };