mirror of https://github.com/gorhill/uBlock.git
privacy exposure reduction: local mirroring of CDN resources
This commit is contained in:
parent
ae5b0d424b
commit
5b984855d0
|
@ -107,6 +107,10 @@
|
|||
"message":"Verwende das Kontext-Menü, falls möglich",
|
||||
"description":"English: Make use of context menu where appropriate"
|
||||
},
|
||||
"settingsExperimentalPrompt":{
|
||||
"message":"Enable experimental features",
|
||||
"description":"English: Enable experimental features"
|
||||
},
|
||||
"3pListsOfBlockedHostsPrompt":{
|
||||
"message":"{{netFilterCount}} Netzwerkfilter + {{cosmeticFilterCount}} kosmetische Filter von:",
|
||||
"description":"English: {{netFilterCount}} network filters + {{cosmeticFilterCount}} cosmetic filters from:"
|
||||
|
|
|
@ -107,6 +107,10 @@
|
|||
"message":"Make use of context menu where appropriate",
|
||||
"description":"English: Make use of context menu where appropriate"
|
||||
},
|
||||
"settingsExperimentalPrompt":{
|
||||
"message":"Enable experimental features",
|
||||
"description":"English: Enable experimental features"
|
||||
},
|
||||
"3pListsOfBlockedHostsPrompt":{
|
||||
"message":"{{netFilterCount}} network filters + {{cosmeticFilterCount}} cosmetic filters from:",
|
||||
"description":"English: {{netFilterCount}} network filters + {{cosmeticFilterCount}} cosmetic filters from:"
|
||||
|
|
|
@ -107,6 +107,10 @@
|
|||
"message":"Utiliser le menu contextuel si possible",
|
||||
"description":"English: Make use of context menu where appropriate"
|
||||
},
|
||||
"settingsExperimentalPrompt":{
|
||||
"message":"Activer les fonctionalités expérimentales",
|
||||
"description":"English: Enable experimental features"
|
||||
},
|
||||
"3pListsOfBlockedHostsPrompt":{
|
||||
"message":"{{netFilterCount}} filtre(s) réseau et {{cosmeticFilterCount}} filtre(s) esthétique(s) sont actuellement en action :",
|
||||
"description":"English: {{netFilterCount}} network filters + {{cosmeticFilterCount}} cosmetic filters from:"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<script src="lib/publicsuffixlist.min.js"></script>
|
||||
<script src="lib/yamd5.js"></script>
|
||||
<script src="js/background.js"></script>
|
||||
<script src="js/mirrors.js"></script>
|
||||
<script src="js/xal.js"></script>
|
||||
<script src="js/async.js"></script>
|
||||
<script src="js/liquid-dict.js"></script>
|
||||
|
|
|
@ -55,6 +55,7 @@ return {
|
|||
autoUpdate: true,
|
||||
collapseBlocked: true,
|
||||
contextMenuEnabled: false,
|
||||
experimentalEnabled: false,
|
||||
externalLists: defaultExternalLists,
|
||||
logRequests: false,
|
||||
parseAllABPHideFilters: true,
|
||||
|
|
|
@ -61,6 +61,12 @@ var onUserSettingsReceived = function(details) {
|
|||
.on('change', function(){
|
||||
changeUserSettings('contextMenuEnabled', this.checked);
|
||||
});
|
||||
|
||||
uDom('#experimental-enabled')
|
||||
.prop('checked', details.experimentalEnabled === true)
|
||||
.on('change', function(){
|
||||
changeUserSettings('experimentalEnabled', this.checked);
|
||||
});
|
||||
};
|
||||
|
||||
messaging.ask({ what: 'userSettings' }, onUserSettingsReceived);
|
||||
|
|
|
@ -669,6 +669,7 @@
|
|||
var onUserSettingsReady = function(settings) {
|
||||
µb.contextMenu.toggle(settings.contextMenuEnabled);
|
||||
µb.fromSelfie(onSelfieReady);
|
||||
µb.mirrors.toggle(settings.experimentalEnabled);
|
||||
};
|
||||
|
||||
this.loadUserSettings(onUserSettingsReady);
|
||||
|
|
|
@ -104,6 +104,14 @@ var onBeforeRequest = function(details) {
|
|||
pageStore.addFrame(frameId, requestURL);
|
||||
}
|
||||
|
||||
if ( µb.userSettings.experimentalEnabled ) {
|
||||
var redirectURL = µb.mirrors.toURL(requestURL, true);
|
||||
if ( redirectURL !== '' ) {
|
||||
//console.debug('"%s" redirected to "%s..."', requestURL.slice(0, 50), redirectURL.slice(0, 50));
|
||||
return { redirectUrl: redirectURL };
|
||||
}
|
||||
}
|
||||
|
||||
//console.debug('µBlock> onBeforeRequest()> ALLOW "%s" (%o)', details.url, details);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,12 @@
|
|||
// Post-change
|
||||
switch ( name ) {
|
||||
case 'contextMenuEnabled':
|
||||
this.contextMenu.toggle(value === true);
|
||||
this.contextMenu.toggle(value);
|
||||
break;
|
||||
case 'experimentalEnabled':
|
||||
if ( typeof this.mirrors === 'object' ) {
|
||||
this.mirrors.toggle(value);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
#experimental-enabled {
|
||||
margin-top: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -18,6 +21,8 @@ ul {
|
|||
<li><input id="collapse-blocked" type="checkbox"> <label data-i18n="settingsCollapseBlockedPrompt"></label>
|
||||
<li><input id="icon-badge" type="checkbox"> <label data-i18n="settingsIconBadgePrompt"></label>
|
||||
<li><input id="context-menu-enabled" type="checkbox"><label data-i18n="settingsContextMenuPrompt"></label>
|
||||
<li><input id="experimental-enabled" type="checkbox"><label data-i18n="settingsExperimentalPrompt"></label>
|
||||
(<a href="https://github.com/gorhill/uBlock/wiki/Experimental-features" style="font-style:italic">Experimental features</a>)
|
||||
</ul>
|
||||
|
||||
<script src="js/udom.js"></script>
|
||||
|
|
Loading…
Reference in New Issue