mirror of https://github.com/gorhill/uBlock.git
Firefox support for browser settings
This commit is contained in:
parent
ee8dd54481
commit
2cb1f42335
|
@ -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 ) {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue