Fix WSJ (mobile)

This commit is contained in:
magnolia1234 2023-10-31 17:55:19 +01:00
parent d399e8bc64
commit 5c23c20cbc
4 changed files with 27 additions and 17 deletions

View file

@ -4,7 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release Post-release
Add The Impression Add The Impression
Fix WSJ (Googlebot for cn/jp subdomain) Fix WSJ (mobile & Googlebot for cn/jp subdomain)
Update custom sites (link to 1ft.io) Update custom sites (link to 1ft.io)
* v3.4.0.0 (2023-10-29) * v3.4.0.0 (2023-10-29)

View file

@ -5404,6 +5404,8 @@ else if (matchDomain('winnipegfreepress.com')) {
} }
else if (matchDomain('wsj.com')) { else if (matchDomain('wsj.com')) {
if (matchDomain('www.wsj.com'))
blockJsReferrer();
if (window.location.pathname.startsWith('/livecoverage/')) { if (window.location.pathname.startsWith('/livecoverage/')) {
window.setTimeout(function () { window.setTimeout(function () {
let paywall = document.querySelector('div#cx-lc-snippet'); let paywall = document.querySelector('div#cx-lc-snippet');
@ -5412,14 +5414,10 @@ else if (matchDomain('wsj.com')) {
removeDOMElement(paywall); removeDOMElement(paywall);
if (amphtml) { if (amphtml) {
amp_redirect_not_loop(amphtml); amp_redirect_not_loop(amphtml);
} else if (window.location.pathname.includes('/card/')) { } else {
let article = document.querySelector('div > div[class*="-ParagraphContainer"]'); let fade = document.querySelectorAll('div[class*="-CardWrapper"]');
if (article) { for (let elem of fade)
let weblink = document.createElement('a'); elem.removeAttribute('class');
weblink.href = window.location.href.split('/card/')[0];
weblink.innerText = 'BPC > full text in feed';
article.parentNode.firstChild.before(weblink);
}
} }
} }
}, 1000); }, 1000);
@ -5445,12 +5443,15 @@ else if (matchDomain('wsj.com')) {
let wsj_pro = snippet.querySelector('a[href^="https://wsjpro.com/"]'); let wsj_pro = snippet.querySelector('a[href^="https://wsjpro.com/"]');
let article = document.querySelector('article'); let article = document.querySelector('article');
if (article) { if (article) {
if (wsj_pro) window.setTimeout(function () {
article.firstChild.before(googleSearchToolLink(window.location.href)); if (wsj_pro) {
else article.firstChild.before(googleSearchToolLink(window.location.href));
article.firstChild.before(archiveLink(window.location.href)); article.firstChild.before(archiveLink(window.location.href, 'BPC > Try for full article text (articles before 2023-10-28)'));
if (!mobile) } else
header_nofix(document.querySelector('div#bpc_archive'), 'BPC > hard refresh page (for Windows: Ctrl + Enter in address bar) or use link below'); article.firstChild.before(archiveLink(window.location.href));
}, 500);
csDoneOnce = true;
waitDOMElement('div.paywall', 'DIV', node => hideDOMElement(...document.querySelectorAll('div#bpc_archive')), false);
} }
} }
} }
@ -5677,6 +5678,15 @@ function header_nofix(header, msg = 'BPC > no fix') {
} }
} }
function blockJsReferrer() {
if (document.head && !document.querySelector('head > meta[name="referrer"][content="no-referrer"]')) {
var meta = document.createElement('meta');
meta.name = "referrer";
meta.content = "no-referrer";
document.head.appendChild(meta);
}
}
function replaceDomElementExt(url, proxy, base64, selector, text_fail = '', selector_source = selector) { function replaceDomElementExt(url, proxy, base64, selector, text_fail = '', selector_source = selector) {
if (proxy) { if (proxy) {
if (!text_fail) { if (!text_fail) {

View file

@ -51,5 +51,5 @@
"webRequestBlocking", "webRequestBlocking",
"*://*/*" "*://*/*"
], ],
"version": "3.4.0.2" "version": "3.4.0.3"
} }

View file

@ -808,5 +808,5 @@
"*://*.wyleex.com/*", "*://*.wyleex.com/*",
"*://webcache.googleusercontent.com/*" "*://webcache.googleusercontent.com/*"
], ],
"version": "3.4.0.2" "version": "3.4.0.3"
} }