mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 05:57:48 +01:00
Update options: enable new sites by default
This commit is contained in:
parent
e722fb2945
commit
877d1ee7e4
4 changed files with 21 additions and 1 deletions
|
@ -659,10 +659,12 @@ function add_grouped_sites(init_rules) {
|
|||
// Add googlebot- and block_javascript-settings for custom sites
|
||||
ext_api.storage.local.get({
|
||||
sites: {},
|
||||
sites_default: Object.keys(defaultSites).filter(x => !defaultSites[x].match(/^(#options_|###$)/)),
|
||||
sites_custom: {},
|
||||
sites_excluded: []
|
||||
}, function (items) {
|
||||
var sites = items.sites;
|
||||
var sites_default = items.sites_default;
|
||||
var sites_custom = items.sites_custom;
|
||||
excludedSites = items.sites_excluded;
|
||||
|
||||
|
@ -671,6 +673,22 @@ ext_api.storage.local.get({
|
|||
}).map(function (key) {
|
||||
return sites[key].toLowerCase();
|
||||
});
|
||||
|
||||
// Enable new sites by default (opt-in)
|
||||
if (enabledSites.includes('#options_enable_new_sites')) {
|
||||
var sites_new = Object.keys(defaultSites).filter(x => !defaultSites[x].match(/^(#options_|###$)/) && !sites_default.includes(x));
|
||||
for (let site_new of sites_new) {
|
||||
sites[site_new] = defaultSites[site_new];
|
||||
}
|
||||
ext_api.storage.local.set({
|
||||
sites: sites
|
||||
});
|
||||
}
|
||||
sites_default = Object.keys(defaultSites).filter(x => !defaultSites[x].match(/^(#options_|###$)/));
|
||||
ext_api.storage.local.set({
|
||||
sites_default: sites_default
|
||||
});
|
||||
|
||||
customSites = sites_custom;
|
||||
customSites_domains = Object.values(sites_custom).map(x => x.domain);
|
||||
disabledSites = defaultSites_domains.concat(customSites_domains).filter(x => !enabledSites.includes(x) && x !== '###');
|
||||
|
|
|
@ -6,6 +6,7 @@ Add Westfaelische Nachrichten (Germany)
|
|||
Fix GElocal.it
|
||||
Fix National Review
|
||||
Fix Ruhr Nachrichten (amp)
|
||||
Update options: enable new sites by default
|
||||
|
||||
* v2.3.9.0 (2021-10-10)
|
||||
Add Lee Enterprises Group (local USA)
|
||||
|
|
|
@ -566,5 +566,5 @@
|
|||
"*://*.wallkit.net/*",
|
||||
"*://*.wsj.net/*"
|
||||
],
|
||||
"version": "2.3.9.3"
|
||||
"version": "2.3.9.4"
|
||||
}
|
1
sites.js
1
sites.js
|
@ -319,6 +319,7 @@ var defaultSites =
|
|||
"TribDss": "tribdss.com",
|
||||
"* BPC settings": "###",
|
||||
"Show options on update": "#options_on_update",
|
||||
"Enable new sites by default": "#options_enable_new_sites",
|
||||
"Restore opt-in for custom sites (on reload; Chrome-only)": "#options_restore_custom",
|
||||
"Barron's - no Googlebot (http error 500)": "#options_disable_gb_barrons",
|
||||
"The Australian - no Googlebot (http error 403)": "#options_disable_gb_theaustralian",
|
||||
|
|
Loading…
Reference in a new issue