diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index dc2968d..8c8f25c 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -71,6 +71,7 @@ "browsingData", "contentSettings", "cookies", + "privacy", "storage", "tabs", "unlimitedStorage", diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 6875441..473d4fb 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -42,6 +42,27 @@ var noopFunc = function(){}; /******************************************************************************/ +// https://github.com/gorhill/uMatrix/issues/234 +// https://developer.chrome.com/extensions/privacy#property-network +chrome.privacy.network.networkPredictionEnabled.set({ + value: false +}); + +// rhill 2013-12-07: +// Tell Chromium to allow all javascript: µMatrix will control whether +// javascript execute through `Content-Policy-Directive` and webRequest. +// https://github.com/gorhill/httpswitchboard/issues/74 +chrome.contentSettings.javascript.set({ + primaryPattern: 'https://*/*', + setting: 'allow' +}); +chrome.contentSettings.javascript.set({ + primaryPattern: 'http://*/*', + setting: 'allow' +}); + +/******************************************************************************/ + vAPI.app = { name: manifest.name, version: manifest.version @@ -680,20 +701,6 @@ vAPI.net.registerListeners = function() { // <<<<<<<< // End of: Normalizing request types - - // rhill 2013-12-07: - // Tell Chromium to allow all javascript: µMatrix will control whether - // javascript execute through `Content-Policy-Directive` and webRequest. - // https://github.com/gorhill/httpswitchboard/issues/74 - chrome.contentSettings.javascript.set({ - primaryPattern: 'https://*/*', - setting: 'allow' - }); - chrome.contentSettings.javascript.set({ - primaryPattern: 'http://*/*', - setting: 'allow' - }); - // Network event handlers // >>>>>>>> var onBeforeRequestClient = this.onBeforeRequest.callback; diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 2c0bf5f..170ffd7 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -192,6 +192,13 @@ const contentObserver = { return; } + // https://github.com/gorhill/uBlock/issues/260 + // TODO: We may have to skip more types, for now let's be + // conservative, i.e. let's not test against `text/html`. + if ( doc.contentType.lastIndexOf('image/', 0) === 0 ) { + return; + } + if ( loc.protocol !== 'http:' && loc.protocol !== 'https:' && loc.protocol !== 'file:' ) { if ( loc.protocol === 'chrome:' && loc.host === hostName ) { this.initContentScripts(win); diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 430c371..45ddff1 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -625,6 +625,9 @@ vAPI.tabs.getAll = function(callback) { continue; } for ( tab of tabBrowser.tabs ) { + if ( tab.hasAttribute('pending') ) { + continue; + } tabs.push({ id: this.getTabId(tab), url: getBrowserForTab(tab).currentURI.asciiSpec @@ -1895,6 +1898,9 @@ vAPI.lastError = function() { vAPI.onLoadAllCompleted = function() { for ( var tab of this.tabs.getAllSync() ) { // We're insterested in only the tabs that were already loaded + if ( tab.hasAttribute('pending') ) { + continue; + } getBrowserForTab(tab).messageManager.sendAsyncMessage( location.host + '-load-completed' );