Fix iPolitics.ca (refresh)

This commit is contained in:
magnolia1234 2023-03-15 18:37:22 +01:00
parent f35f017dee
commit db9229c76c
4 changed files with 24 additions and 15 deletions

View File

@ -4,7 +4,8 @@ Updates: https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean/-/release
Post-release Post-release
Remove Iltalehti.fi (fix obsolete) Remove Iltalehti.fi (fix obsolete)
Fix Sciences et Avenir.fr Fix iPolitics.ca (refresh)
Fix Sciences et Avenir.fr (css)
* v3.0.9.0 (2023-03-12) * v3.0.9.0 (2023-03-12)
Add Medienhaus Aachen Add Medienhaus Aachen

View File

@ -3457,19 +3457,27 @@ else if (matchDomain('ipolitics.ca')) {
removeDOMElement(login); removeDOMElement(login);
let json_script = document.querySelector('script#__NEXT_DATA__'); let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) { if (json_script) {
try {
let json = JSON.parse(json_script.innerText); let json = JSON.parse(json_script.innerText);
if (json && json.props.pageProps.post.content) { if (json && json.props.pageProps.post && json.props.pageProps.post.content) {
let url_next = json.props.pageProps.post.slug;
if (url_next && !window.location.pathname.includes(url_next))
refreshCurrentTab();
let article_new = json.props.pageProps.post.content; let article_new = json.props.pageProps.post.content;
let article = document.querySelector('.post-header'); let article = document.querySelector('.post-body');
if (article) { if (article) {
article.innerHTML = '';
article.classList.remove('locked');
let parser = new DOMParser(); let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + article_new + '</div>', 'text/html'); let doc = parser.parseFromString('<div>' + article_new + '</div>', 'text/html');
let content_new = doc.querySelector('div'); let content_new = doc.querySelector('div');
article.appendChild(content_new); article.appendChild(content_new);
let locked = document.querySelector('div.locked');
if (locked)
locked.classList.remove('locked');
} }
} else {
refreshCurrentTab();
}
} catch (err) {
console.log(err);
} }
} }
} }

View File

@ -51,5 +51,5 @@
"webRequestBlocking", "webRequestBlocking",
"*://*/*" "*://*/*"
], ],
"version": "3.0.9.1" "version": "3.0.9.2"
} }

View File

@ -736,5 +736,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://webcache.googleusercontent.com/*" "*://webcache.googleusercontent.com/*"
], ],
"version": "3.0.9.1" "version": "3.0.9.2"
} }