gorhill 9 years ago
parent
commit
93d28a8e38
  1. 8
      platform/firefox/vapi-common.js

8
platform/firefox/vapi-common.js

@ -19,7 +19,6 @@
Home: https://github.com/gorhill/uMatrix Home: https://github.com/gorhill/uMatrix
*/ */
/* jshint esnext: true */
/* global sendAsyncMessage */ /* global sendAsyncMessage */
// For background page or non-background pages // For background page or non-background pages
@ -37,7 +36,7 @@ const {Services} = Components.utils.import(
null 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'] const parser = Components.classes['@mozilla.org/parserutils;1']
.getService(Components.interfaces.nsIParserUtils); .getService(Components.interfaces.nsIParserUtils);
// https://github.com/gorhill/uBlock/issues/845
// Apparently dashboard pages execute with `about:blank` principal.
return function(node, html) { return function(node, html) {
while ( node.firstChild ) { while ( node.firstChild ) {
node.removeChild(node.firstChild); node.removeChild(node.firstChild);
@ -84,7 +86,7 @@ vAPI.insertHTML = (function() {
html, html,
parser.SanitizerAllowStyle, parser.SanitizerAllowStyle,
false, false,
Services.io.newURI(document.baseURI, null, null),
Services.io.newURI('about:blank', null, null),
document.documentElement document.documentElement
)); ));
}; };

Loading…
Cancel
Save