From 840bf9564d355bf7d76bcb91ac4dcb7df11fd83a Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 26 Apr 2017 16:04:09 -0400 Subject: [PATCH] FF webext does not support chrome.contentSettings API --- platform/chromium/vapi-background.js | 6 +++++- platform/webext/manifest.json | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 6d9c3e9..ef01a8b 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -53,6 +53,7 @@ chrome.privacy.network.networkPredictionEnabled.set({ // 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 +// Firefox WebExtensions does not support contentSettings API, yet. if ( chrome.contentSettings instanceof Object ) { chrome.contentSettings.javascript.set({ primaryPattern: 'https://*/*', @@ -83,7 +84,10 @@ vAPI.app.start = function() { /******************************************************************************/ vAPI.app.stop = function() { - chrome.contentSettings.javascript.clear({}); + // Firefox WebExtensions does not support contentSettings API, yet. + if ( chrome.contentSettings instanceof Object ) { + chrome.contentSettings.javascript.clear({}); + } // rhill 2013-12-07: // Tell Chromium to allow all javascript: µMatrix will control whether diff --git a/platform/webext/manifest.json b/platform/webext/manifest.json index 7c638e4..1687fae 100644 --- a/platform/webext/manifest.json +++ b/platform/webext/manifest.json @@ -46,7 +46,6 @@ }, "permissions": [ "browsingData", - "contentSettings", "cookies", "privacy", "storage",