mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:57:48 +01:00
Fix Bloomberg (permission block js)
This commit is contained in:
parent
0fb982c4bc
commit
1bcb2ebc86
3 changed files with 45 additions and 53 deletions
|
@ -2,6 +2,7 @@
|
||||||
Changelog Bypass Paywalls Clean - Firefox
|
Changelog Bypass Paywalls Clean - Firefox
|
||||||
|
|
||||||
Post-release
|
Post-release
|
||||||
|
Fix Bloomberg (permission block js)
|
||||||
|
|
||||||
* v2.4.7.0 (2021-12-12)
|
* v2.4.7.0 (2021-12-12)
|
||||||
Add Koelner Stadt-Anzeiger & Koelnische Rundschau
|
Add Koelner Stadt-Anzeiger & Koelnische Rundschau
|
||||||
|
|
|
@ -1714,28 +1714,16 @@ else if (matchDomain('billboard.com')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('bloomberg.com')) {
|
else if (matchDomain('bloomberg.com')) {
|
||||||
function bloomberg_noscroll(node) {
|
|
||||||
node.removeAttribute('data-paywall-overlay-status');
|
|
||||||
}
|
|
||||||
waitDOMElement('div#fortress-paywall-container-root', 'DIV', removeDOMElement, true);
|
|
||||||
waitDOMAttribute('body', 'BODY', 'data-paywall-overlay-status', bloomberg_noscroll, true);
|
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
let paywall = document.querySelector('div#fortress-paywall-container-root');
|
|
||||||
let counter = document.querySelector('div#fortress-preblocked-container-root');
|
|
||||||
let noscroll = document.querySelector('body[data-paywall-overlay-status]');
|
|
||||||
if (noscroll)
|
|
||||||
noscroll.removeAttribute('data-paywall-overlay-status');
|
|
||||||
removeDOMElement(paywall, counter);
|
|
||||||
let url = window.location.href;
|
let url = window.location.href;
|
||||||
if (url.match(/\/(articles|features)\//)) {
|
if (url.match(/\/(articles|features)\//)) {
|
||||||
let leaderboard = document.querySelector('div[id^="leaderboard"], div.leaderboard-wrapper');
|
let leaderboard = document.querySelector('div[id^="leaderboard"], div.leaderboard-wrapper');
|
||||||
let shimmering_content = document.querySelectorAll('div[class^="shimmering-"]');
|
|
||||||
let page_ad = document.querySelectorAll('div.page-ad, div[data-ad-placeholder]');
|
let page_ad = document.querySelectorAll('div.page-ad, div[data-ad-placeholder]');
|
||||||
let reg_ui_client = document.querySelector('div#reg-ui-client');
|
let reg_ui_client = document.querySelector('div#reg-ui-client');
|
||||||
removeDOMElement(leaderboard, ...shimmering_content, ...page_ad, reg_ui_client);
|
removeDOMElement(leaderboard, ...page_ad, reg_ui_client);
|
||||||
let hidden_images = document.querySelectorAll('img.lazy-img__image[src][data-native-src]');
|
let hidden_images = document.querySelectorAll('img.lazy-img__image[src][data-native-src]');
|
||||||
for (let hidden_image of hidden_images) {
|
for (let hidden_image of hidden_images) {
|
||||||
if (hidden_image.src.match(/\/60x-1\.(png|jpg)$/))
|
if (hidden_image.src.match(/\/(60|150)x-1\.(png|jpg)$/))
|
||||||
hidden_image.setAttribute('src', hidden_image.getAttribute('data-native-src'));
|
hidden_image.setAttribute('src', hidden_image.getAttribute('data-native-src'));
|
||||||
hidden_image.style.filter = 'none';
|
hidden_image.style.filter = 'none';
|
||||||
}
|
}
|
||||||
|
@ -1755,14 +1743,21 @@ else if (matchDomain('bloomberg.com')) {
|
||||||
blur.classList.remove('blur');
|
blur.classList.remove('blur');
|
||||||
blur.removeAttribute('style');
|
blur.removeAttribute('style');
|
||||||
}
|
}
|
||||||
|
let shimmering_content = document.querySelectorAll('div.shimmering-text');
|
||||||
|
let body_transparent = document.querySelector('div[class*="nearly-transparent-text-blur"]');
|
||||||
|
if (shimmering_content || body_transparent) {
|
||||||
|
removeDOMElement(...shimmering_content);
|
||||||
|
if (body_transparent)
|
||||||
|
removeClassesByPrefix(body_transparent, 'nearly-transparent-text-blur');
|
||||||
let json_script = document.querySelector('script[data-component-props="ArticleBody"], script[data-component-props="FeatureBody"]');
|
let json_script = document.querySelector('script[data-component-props="ArticleBody"], script[data-component-props="FeatureBody"]');
|
||||||
if (json_script && dompurify_loaded) {
|
if (json_script && dompurify_loaded) {
|
||||||
let json = JSON.parse(json_script.innerHTML);
|
let json = JSON.parse(json_script.innerHTML);
|
||||||
if (json) {
|
if (json) {
|
||||||
let json_text;
|
let json_text;
|
||||||
json_text = json.body ? json.body : '';
|
if (json.body)
|
||||||
if (!json_text)
|
json_text = json.body;
|
||||||
json_text = json.story.body ? json.story.body : '';
|
else if (json.story && json.story.body)
|
||||||
|
json_text = json.story.body;
|
||||||
if (json_text) {
|
if (json_text) {
|
||||||
removeDOMElement(json_script);
|
removeDOMElement(json_script);
|
||||||
let article = document.querySelector('div.body-copy-v2:not(.art_done)');
|
let article = document.querySelector('div.body-copy-v2:not(.art_done)');
|
||||||
|
@ -1784,9 +1779,9 @@ else if (matchDomain('bloomberg.com')) {
|
||||||
article.parentNode.replaceChild(article_new, article);
|
article.parentNode.replaceChild(article_new, article);
|
||||||
let teaser_body = document.querySelector('div.body-content[class*="teaser-content_"]');
|
let teaser_body = document.querySelector('div.body-content[class*="teaser-content_"]');
|
||||||
removeDOMElement(teaser_body);
|
removeDOMElement(teaser_body);
|
||||||
let body_transparent = document.querySelector('div[class*="nearly-transparent-text-blur_"]');
|
let thirdparty_embed = document.querySelector('div.thirdparty-embed__container[style*="height: 0;"]');
|
||||||
if (body_transparent)
|
if (thirdparty_embed)
|
||||||
removeClassesByPrefix(body_transparent, 'nearly-transparent-text-blur_');
|
thirdparty_embed.setAttribute('style', 'height: 550px !important;');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1794,11 +1789,6 @@ else if (matchDomain('bloomberg.com')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('bloombergquint.com')) {
|
|
||||||
let articlesLeftModal = document.querySelector('.paywall-meter-module__story-paywall-container__1UgCE');
|
|
||||||
let paywall = document.getElementById('paywallDmp');
|
|
||||||
removeDOMElement(articlesLeftModal, paywall);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (matchDomain('bostonglobe.com')) {
|
else if (matchDomain('bostonglobe.com')) {
|
||||||
|
|
|
@ -564,6 +564,7 @@
|
||||||
"*://*.amazonaws.com/*",
|
"*://*.amazonaws.com/*",
|
||||||
"*://*.apnarm.net.au/*",
|
"*://*.apnarm.net.au/*",
|
||||||
"*://*.bntech.io/*",
|
"*://*.bntech.io/*",
|
||||||
|
"*://*.bwbx.io/*",
|
||||||
"*://*.cedsdigital.it/*",
|
"*://*.cedsdigital.it/*",
|
||||||
"*://*.corriereobjects.it/*",
|
"*://*.corriereobjects.it/*",
|
||||||
"*://*.eestatic.com/*",
|
"*://*.eestatic.com/*",
|
||||||
|
@ -586,5 +587,5 @@
|
||||||
"*://*.wallkit.net/*",
|
"*://*.wallkit.net/*",
|
||||||
"*://*.wsj.net/*"
|
"*://*.wsj.net/*"
|
||||||
],
|
],
|
||||||
"version": "2.4.7.0"
|
"version": "2.4.7.1"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue