mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 01:11:04 +00:00
Fix Bloomberg
This commit is contained in:
parent
154d1b9c22
commit
97e1e3c120
@ -1228,7 +1228,7 @@ if (matchUrlDomain(change_headers, details.url) && (['main_frame', 'sub_frame',
|
|||||||
}
|
}
|
||||||
if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) {
|
if ((!['font', 'stylesheet'].includes(details.type) || matchUrlDomain(cs_limit_except, currentTabUrl)) && !csDone) {
|
||||||
let lib_file = 'lib/empty.js';
|
let lib_file = 'lib/empty.js';
|
||||||
if (matchUrlDomain(['cicero.de', 'economictimes.com', 'gva.be', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'tradewindsnews.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains), currentTabUrl))
|
if (matchUrlDomain(['bloomberg.com', 'cicero.de', 'economictimes.com', 'gva.be', 'lesechos.fr', 'newleftreview.org', 'newyorker.com', 'nzherald.co.nz', 'prospectmagazine.co.uk', 'sudouest.fr', 'techinasia.com', 'tradewindsnews.com', 'valor.globo.com', 'washingtonpost.com'].concat(nl_mediahuis_region_domains), currentTabUrl))
|
||||||
lib_file = 'lib/purify.min.js';
|
lib_file = 'lib/purify.min.js';
|
||||||
ext_api.tabs.executeScript(tabId, {
|
ext_api.tabs.executeScript(tabId, {
|
||||||
file: lib_file,
|
file: lib_file,
|
||||||
@ -1440,7 +1440,7 @@ function remove_cookies_fn(domainVar, exclusions = false) {
|
|||||||
// remove cookies after page load
|
// remove cookies after page load
|
||||||
ext_api.webRequest.onCompleted.addListener(function (details) {
|
ext_api.webRequest.onCompleted.addListener(function (details) {
|
||||||
let domainVar = matchUrlDomain(remove_cookies, details.url);
|
let domainVar = matchUrlDomain(remove_cookies, details.url);
|
||||||
if (domainVar && ['main_frame', 'xmlhttprequest', 'other'].includes(details.type) && enabledSites.includes(domainVar))
|
if (domainVar && ['main_frame', 'sub_frame', 'xmlhttprequest', 'other'].includes(details.type) && enabledSites.includes(domainVar))
|
||||||
remove_cookies_fn(domainVar, true);
|
remove_cookies_fn(domainVar, true);
|
||||||
}, {
|
}, {
|
||||||
urls: ["<all_urls>"]
|
urls: ["<all_urls>"]
|
||||||
|
@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
|
|||||||
|
|
||||||
Post-release
|
Post-release
|
||||||
Add Southern Weekly (China)
|
Add Southern Weekly (China)
|
||||||
|
Fix Bloomberg
|
||||||
Fix The Daily Telegraph (au)
|
Fix The Daily Telegraph (au)
|
||||||
|
|
||||||
* v2.2.9.0 (2021-07-11)
|
* v2.2.9.0 (2021-07-11)
|
||||||
|
@ -1651,21 +1651,43 @@ else if (matchDomain('barrons.com')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('bloomberg.com')) {
|
else if (matchDomain('bloomberg.com')) {
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
sessionStorage.clear();
|
||||||
let fence = document.querySelector('.fence-body');
|
let counter = document.querySelector('div#fortress-preblocked-container-root');
|
||||||
if (fence) {
|
let leaderboard = document.querySelector('div[id^="leaderboard"]');
|
||||||
fence.classList.remove('fence-body');
|
let shimmering_content = document.querySelectorAll('div[class^="shimmering-"]');
|
||||||
|
removeDOMElement(counter, leaderboard, ...shimmering_content);
|
||||||
|
let hidden_images = document.querySelectorAll('div.lazy-img > img.lazy-img__image[src$="x-1.png"][data-native-src]');
|
||||||
|
for (let hidden_image of hidden_images) {
|
||||||
|
hidden_image.setAttribute('src', hidden_image.getAttribute('data-native-src'));
|
||||||
|
hidden_image.removeAttribute('class');
|
||||||
|
hidden_image.parentElement.removeAttribute('class');
|
||||||
|
}
|
||||||
|
let json_script = document.querySelector('script[data-component-props="ArticleBody"], script[data-component-props="FeatureBody"]');
|
||||||
|
if (json_script) {
|
||||||
|
let json = JSON.parse(json_script.innerHTML);
|
||||||
|
if (json) {
|
||||||
|
let json_text = json.body;
|
||||||
|
let json_id = json.id;
|
||||||
|
let meta_id = document.querySelector('meta[name="parsely-post-id"][content]');
|
||||||
|
if (json_text && json_text !== 'undefined' && json_id && json_id !== 'undefined' && meta_id && meta_id.content === json_id) {
|
||||||
|
removeDOMElement(json_script);
|
||||||
|
let article = document.querySelector('div.body-copy-v2');
|
||||||
|
let article_class = 'body-copy-v2';
|
||||||
|
if (!article) {
|
||||||
|
article = document.querySelector('div.body-copy');
|
||||||
|
article_class = 'body-copy';
|
||||||
|
}
|
||||||
|
let parser = new DOMParser();
|
||||||
|
let doc = parser.parseFromString('<div class="' + article_class + '">' + DOMPurify.sanitize(json_text, {ADD_TAGS: ['iframe']}) + '</div>', 'text/html');
|
||||||
|
let article_new = doc.querySelector('div');
|
||||||
|
if (article_new) {
|
||||||
|
if (article) {
|
||||||
|
article.parentNode.replaceChild(article_new, article);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
let body_overlay = document.querySelector('body[data-paywall-overlay-status="show"]');
|
|
||||||
if (body_overlay)
|
|
||||||
body_overlay.removeAttribute('data-paywall-overlay-status');
|
|
||||||
let noscroll = document.querySelector('body[class*="noScroll"]');
|
|
||||||
if (noscroll)
|
|
||||||
removeClassesByPrefix(noscroll, 'noScroll');
|
|
||||||
let paywall_overlay = document.querySelector('div#graphics-paywall-overlay');
|
|
||||||
let banner = document.getElementById('paywall-banner');
|
|
||||||
removeDOMElement(banner, paywall_overlay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('bloombergquint.com')) {
|
else if (matchDomain('bloombergquint.com')) {
|
||||||
|
@ -535,5 +535,5 @@
|
|||||||
"*://*.wallkit.net/*",
|
"*://*.wallkit.net/*",
|
||||||
"*://*.wsj.net/*"
|
"*://*.wsj.net/*"
|
||||||
],
|
],
|
||||||
"version": "2.2.9.2"
|
"version": "2.2.9.3"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user