Add Polityka.pl

This commit is contained in:
magnolia1234 2024-02-22 16:40:34 +01:00
parent a25ddb9f45
commit 7bbd2398bd
8 changed files with 55 additions and 17 deletions

View file

@ -786,6 +786,7 @@ Grouped in options:\
##### Poland
[Business Insider Polska](https://businessinsider.com.pl) -
[Newsweek.pl](https://www.newsweek.pl) -
[Polityka](https://www.polityka.pl) -
[Rzeczpospolita](https://www.rp.pl)
##### Portugal

View file

@ -4,6 +4,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Forbes.com.au
Add Polityka.pl
Add Vogue.co.uk (Conde Nast)
Remove Arkansas Democrat-Gazette (fix obsolete)
Fix Epoch.org.il (css)

View file

@ -239,6 +239,7 @@ if (bg2csData.amp_unhide) {
if (amp_page_hide) {
amp_unhide_subscr_section();
amp_unhide_access_hide();
amp_images_replace();
amp_iframes_replace();
}
}, 100);
@ -1639,7 +1640,7 @@ else if (matchDomain(es_epiberica_domains) || matchDomain(es_epiberica_custom_do
for (let amp_image of amp_images) {
let elem = document.createElement('img');
elem.src = amp_image.getAttribute('src');
elem.style = 'margin: 0px 50px;';
elem.style = 'width: 75%; margin: 0px 50px;';
amp_image.parentNode.replaceChild(elem, amp_image);
}
} else {
@ -3472,14 +3473,7 @@ else if (matchDomain('globo.com')) {
amp_redirect('div.paywall');
} else {
amp_unhide_subscr_section('amp-ad, amp-embed');
let amp_images = document.querySelectorAll('figure > amp-img[src^="https://"]');
for (let amp_image of amp_images) {
let elem = document.createElement('img');
elem.src = amp_image.getAttribute('src');
elem.alt = amp_image.getAttribute('alt');
elem.style = mobile ? 'width: 320px;' : 'margin: 0px 250px; display:block;';
amp_image.parentNode.replaceChild(elem, amp_image);
}
amp_images_replace();
}
} else if (window.location.pathname.includes('/amp/'))
ampToHtml();
@ -3683,14 +3677,9 @@ else if (matchDomain('barrons.com')) {
hideDOMElement(...ads);
} else {
amp_unhide_subscr_section('.wsj-ad, amp-ad');
amp_images_replace();
let login = document.querySelector('div.login-section-container');
removeDOMElement(login);
let amp_images = document.querySelectorAll('div.article__body amp-img');
for (let amp_img of amp_images) {
let img_new = document.createElement('img');
img_new.src = amp_img.getAttribute('src');
amp_img.parentNode.replaceChild(img_new, amp_img);
}
}
}
@ -4770,6 +4759,19 @@ else if (matchDomain('outlookindia.com')) {
}
}
else if (matchDomain('polityka.pl')) {
let paywall = document.querySelector('div.cg-article-salebox');
if (paywall) {
removeDOMElement(paywall);
let elem_hidden = document.querySelectorAll('div.cg_article_meat > [style]');
for (let elem of elem_hidden)
elem.removeAttribute('style');
let fade = document.querySelector('article.article_status-cut');
if (fade)
fade.classList.remove('article_status-cut');
}
}
else if (matchDomain('project-syndicate.org')) {
let url = window.location.href;
getArchive(url, 'div.paywall--base', '', 'div[data-page-area="article-body"]');
@ -6317,6 +6319,19 @@ function replaceTextFail(url, article, proxy, text_fail) {
}
}
function amp_images_replace() {
window.setTimeout(function () {
let amp_images = document.querySelectorAll('figure amp-img[src^="http"]');
for (let amp_image of amp_images) {
let elem = document.createElement('img');
elem.src = amp_image.getAttribute('src');
elem.alt = amp_image.getAttribute('alt');
elem.style = 'width: 100%;';
amp_image.parentNode.replaceChild(elem, amp_image);
}
}, 1000);
}
function amp_iframes_replace(weblink = false, source = '') {
let amp_iframes = document.querySelectorAll('amp-iframe' + (source ? '[src*="' + source + '"]' : ''));
let par, elem;

View file

@ -51,5 +51,5 @@
"webRequestBlocking",
"*://*/*"
],
"version": "3.5.6.5"
"version": "3.5.6.6"
}

View file

@ -725,6 +725,14 @@
"block_regex": "\\.qiota\\.com",
"domain": "strategies.fr"
},
"Stratford-herald.com": {
"allow_cookies": 1,
"amp_redirect": "div#article_panel_paywall",
"amp_unhide": 1,
"block_regex": "cdn\\.ampproject\\.org\\/v\\d\\/amp-access-.+\\.js",
"cs_code": "[{\"cond\":\"div.PremNotice\", \"rm_elem\":1}]",
"domain": "stratford-herald.com"
},
"Stripes.com": {
"allow_cookies": 1,
"block_regex": "js\\.pelcro\\.com",

View file

@ -571,6 +571,7 @@
"*://*.piqd.de/*",
"*://*.plasticsnews.com/*",
"*://*.politicaexterior.com/*",
"*://*.polityka.pl/*",
"*://*.popsci.com/*",
"*://*.popularmechanics.com/*",
"*://*.post-gazette.com/*",
@ -860,5 +861,5 @@
"*://archive.vn/*",
"*://webcache.googleusercontent.com/*"
],
"version": "3.5.6.5"
"version": "3.5.6.6"
}

View file

@ -1980,6 +1980,11 @@ var defaultSites = {
domain: "politicaexterior.com",
allow_cookies: 1
},
"Polityka.pl": {
domain: "polityka.pl",
allow_cookies: 1,
useragent: "googlebot"
},
"Popular Science": {
domain: "popsci.com",
allow_cookies: 1,

View file

@ -112,6 +112,13 @@
"random_ip": "eu",
"upd_version": "3.5.4.2"
},
"Polityka.pl": {
"domain": "polityka.pl",
"allow_cookies": 1,
"useragent": "googlebot",
"cs_code": "[{\"cond\":\"div.cg-article-salebox\", \"rm_elem\":1, \"elems\":[{\"cond\":\"div.cg_article_meat>[style]\", \"rm_attrib\":\"style\"}, {\"cond\":\"article.article_status-cut\", \"rm_class\":\"article_status-cut\"}]}]",
"upd_version": "3.5.6.6"
},
"San Diego Union Tribune": {
"domain": "sandiegouniontribune.com",
"allow_cookies": 1,