1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 18:32:45 +01:00

Firefox support for browser settings

This commit is contained in:
gorhill 2015-06-02 08:59:25 -04:00
parent ee8dd54481
commit 2cb1f42335
3 changed files with 13 additions and 7 deletions

View File

@ -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 ) {

View File

@ -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:

View File

@ -145,6 +145,7 @@ var onUserSettingsReady = function(fetched) {
µb.contextMenu.toggle(userSettings.contextMenuEnabled);
vAPI.browserSettings.set({ 'prefetching': !userSettings.prefetchingDisabled });
vAPI.browserSettings.set({ 'hyperlinkAuditing': !userSettings.hyperlinkAuditingDisabled });
µb.permanentFirewall.fromString(fetched.dynamicFilteringString);
µb.sessionFirewall.assign(µb.permanentFirewall);