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
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)
Add Medienhaus Aachen

View file

@ -3457,19 +3457,27 @@ else if (matchDomain('ipolitics.ca')) {
removeDOMElement(login);
let json_script = document.querySelector('script#__NEXT_DATA__');
if (json_script) {
try {
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 = document.querySelector('.post-header');
let article = document.querySelector('.post-body');
if (article) {
article.innerHTML = '';
article.classList.remove('locked');
let parser = new DOMParser();
let doc = parser.parseFromString('<div>' + article_new + '</div>', 'text/html');
let content_new = doc.querySelector('div');
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",
"*://*/*"
],
"version": "3.0.9.1"
"version": "3.0.9.2"
}

View file

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