diff --git a/README.md b/README.md index 0343016..02bee81 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/changelog.txt b/changelog.txt index fc65bd0..3adbfe3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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) diff --git a/contentScript.js b/contentScript.js index 28d13fa..7115711 100644 --- a/contentScript.js +++ b/contentScript.js @@ -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; diff --git a/custom/manifest.json b/custom/manifest.json index 192703f..6827da7 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.5.6.5" + "version": "3.5.6.6" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index 04514b0..2be5de6 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -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", diff --git a/manifest.json b/manifest.json index d1bbfb5..07fafcc 100644 --- a/manifest.json +++ b/manifest.json @@ -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" } diff --git a/sites.js b/sites.js index 3058bbe..b2a1902 100644 --- a/sites.js +++ b/sites.js @@ -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, diff --git a/sites_updated.json b/sites_updated.json index bcf211d..4c07be4 100644 --- a/sites_updated.json +++ b/sites_updated.json @@ -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,