Update badge (notification: import as custom site)

merge-requests/8/head
magnolia1234 2 years ago
parent 4087e513f9
commit e1578f8f24

@ -374,8 +374,11 @@ ext_api.storage.local.get({
disabledSites = defaultSites_grouped_domains.concat(customSites_domains).filter(x => !enabledSites.includes(x));
add_grouped_enabled_domains(grouped_sites);
set_rules(sites, updatedSites, customSites);
if (enabledSites.includes('#options_optin_update_rules'))
if (enabledSites.includes('#options_optin_update_rules')) {
check_sites_updated();
sites_custom_ext_json = 'https://gitlab.com/magnolia1234/bypass-paywalls-' + url_loc + '-clean/-/raw/master/custom/sites_custom.json';
check_sites_custom_ext();
}
if (optin_update)
check_update();
});
@ -1168,6 +1171,22 @@ if (matchUrlDomain(change_headers, details.url) && !['font', 'image', 'styleshee
}, extraInfoSpec);
// extraInfoSpec is ['blocking', 'requestHeaders'] + possible 'extraHeaders'
function check_sites_custom_ext() {
fetch(sites_custom_ext_json)
.then(response => {
if (response.ok) {
response.json().then(json => {
customSitesExt = Object.values(json).map(x => x.domain);
})
}
}).catch(function (err) {
false;
});
}
var customSitesExt = [];
var sites_custom_ext_json = 'custom/sites_custom.json';
ext_api.tabs.onUpdated.addListener(function (tabId, info, tab) { updateBadge(tab); });
ext_api.tabs.onActivated.addListener(function (activeInfo) { if (activeInfo.tabId) ext_api.tabs.get(activeInfo.tabId, updateBadge); });
@ -1207,6 +1226,8 @@ function updateBadge(activeTab) {
ext_api.browserAction.setBadgeText({text: badgeText});
});
} else {
if (matchUrlDomain(customSitesExt, currentUrl))
badgeText = '+C';
if (color && badgeText)
ext_api.browserAction.setBadgeBackgroundColor({color: color});
ext_api.browserAction.setBadgeText({text: badgeText});

@ -5,6 +5,7 @@ Post-release
Add PEI Media sites (opt-in to custom sites)
Fix Faz.net (Zeitung timing)
Fix TownNews sites (css)
Update badge (notification: import as custom site)
* v2.8.3.0 (2022-09-04)
Add AutoPlus.fr

@ -1817,8 +1817,8 @@ if (matchDomain('fd.nl')) {
}
else if (matchDomain('ftm.nl')) {
let banner_pp = document.querySelector('div.banner-pp');
removeDOMElement(banner_pp);
let banners = document.querySelectorAll('div.banner-pp, a.readmore');
removeDOMElement(...banners);
}
else if (matchDomain(['gva.be', 'hbvl.be', 'nieuwsblad.be'])) {

@ -1,4 +1,9 @@
{
"60millions-mag.com": {
"allow_cookies": 1,
"block_regex": "\\.poool\\.fr\\/",
"domain": "60millions-mag.com"
},
"Abqjournal.com": {
"allow_cookies": 1,
"block_regex": "\\.abqjournal\\.com\\/.+\\/abq-pw-manager\\.js",
@ -41,6 +46,11 @@
"Connexionfrance.com": {
"domain": "connexionfrance.com"
},
"Edweek.org": {
"allow_cookies": 1,
"block_regex": "js\\.pelcro\\.com\\/",
"domain": "edweek.org"
},
"Eluniversal.com.mx": {
"allow_cookies": 1,
"block_regex": "\\.tinypass\\.com\\/",
@ -58,7 +68,7 @@
},
"Gazette.com": {
"allow_cookies": 1,
"block_regex": "loader-cdn\\.azureedge\\.net",
"block_regex": "loader-cdn\\.azureedge\\.net\\/",
"domain": "gazette.com"
},
"Gplanet.co.il": {
@ -151,6 +161,11 @@
"Speld.nl": {
"domain": "speld.nl"
},
"Spokesman.com": {
"allow_cookies": 1,
"block_regex": "loader-cdn\\.azureedge\\.net\\/",
"domain": "spokesman.com"
},
"Supchina.com": {
"allow_cookies": 1,
"block_regex": "\\.tinypass\\.com\\/",
@ -204,5 +219,10 @@
"allow_cookies": 1,
"domain": "vigilantcitizen.com",
"random_ip": "all"
},
"Washingtontimes.com": {
"allow_cookies": 1,
"block_regex": "\\.tinypass\\.com\\/",
"domain": "washingtontimes.com"
}
}

@ -702,5 +702,5 @@
"*://gcm.omerlocdn.com/*",
"*://webcache.googleusercontent.com/*"
],
"version": "2.8.3.2"
"version": "2.8.3.3"
}

@ -24,7 +24,8 @@
Custom sites (new) are enabled automatically in <small><button><a href="options.html" style="text-decoration:none;color:inherit">Options</a></button></small> (cookies will be removed by default unless you enable allow_cookies).<br>
If you want to use custom sites (for non-listed sites) enable it in <small><button><a href="optin/opt-in.html" style="text-decoration:none;color:inherit">Opt-in</a></button></small>
<strong>Custom sites enabled: <span id="custom-enabled"></span></strong><br>
You can also just request permissions for the custom sites you added yourself & post-release added sites (below).<br>
You can also just request permissions for the custom sites & post-release added sites (below).<br>
If permission is missing the icon badge will contain a 'C' (or '+C' if you can import the custom site from GitLab).<br>
On Android: to enable custom sites you need the 'custom' add-on version (with access to all sites): <a href="https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean-custom" target="_blank">Bypass Paywalls Clean (custom)</a>
<br><br>
</div>

Loading…
Cancel
Save