diff options
author | gorhill <rhill@raymondhill.net> | 2015-06-02 08:59:25 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-06-02 08:59:25 -0400 |
commit | 2cb1f423355920ea8c22c148918ac41f8f4702fc (patch) | |
tree | 7afb6b70d43d165de49695be1f44cd540c5a4517 /platform | |
parent | ee8dd54481844862f8e9fc28e9aa8ab4e6739a82 (diff) | |
download | uBlock-2cb1f423355920ea8c22c148918ac41f8f4702fc.zip uBlock-2cb1f423355920ea8c22c148918ac41f8f4702fc.tar.gz uBlock-2cb1f423355920ea8c22c148918ac41f8f4702fc.tar.bz2 |
Firefox support for browser settings
Diffstat (limited to 'platform')
-rw-r--r-- | platform/chromium/vapi-background.js | 5 | ||||
-rw-r--r-- | platform/firefox/vapi-background.js | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 8724439..8dc54c8 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -64,11 +64,6 @@ vAPI.storage = chrome.storage.local; // https://github.com/gorhill/uMatrix/issues/234 // https://developer.chrome.com/extensions/privacy#property-network -chrome.privacy.network.networkPredictionEnabled.set({ - value: false, - scope: 'regular' -}); - vAPI.browserSettings = { set: function(details) { for ( var setting in details ) { diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 6d58fbe..bf46391 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -98,6 +98,16 @@ window.addEventListener('unload', function() { /******************************************************************************/ vAPI.browserSettings = { + + setBool: function(branch, setting, value) { + try { + Services.prefs + .getBranch(branch + '.') + .setBoolPref(setting, value); + } catch (ex) { + } + }, + set: function(details) { for ( var setting in details ) { if ( details.hasOwnProperty(setting) === false ) { @@ -105,11 +115,11 @@ vAPI.browserSettings = { } switch ( setting ) { case 'prefetching': - // noop until I find what to use in Firefox + this.setBool('network', 'prefetch-next', !!details[setting]); break; case 'hyperlinkAuditing': - // noop until I find what to use in Firefox + this.setBool('browser', 'send_pings', !!details[setting]); break; default: |