Update block general paywall script (Pigeon)
This commit is contained in:
parent
4ce9504093
commit
2d2ac607f6
@ -640,6 +640,7 @@ var block_js = [
|
||||
"*://*.qiota.com/*",
|
||||
"*://*.tribdss.com/*",
|
||||
"*://*.zephr.com/zephr-browser/*",
|
||||
"*://*/c/assets/pigeon.js*",
|
||||
"*://cdn.ampproject.org/v*/amp-access-*.*js",
|
||||
"*://cdn.ampproject.org/v*/amp-subscriptions-*.*js",
|
||||
"*://cdn.tinypass.com/*",
|
||||
@ -652,7 +653,8 @@ var block_js = [
|
||||
function disableJavascriptOnListedSites() {
|
||||
ext_api.webRequest.onBeforeRequest.addListener(function (details) {
|
||||
let header_referer = details.originUrl ? details.originUrl : details.initiator;
|
||||
if (!isSiteEnabled(details) || matchUrlDomain(excludedSites.concat(['asia.nikkei.com', 'cambridge.org']), header_referer)) {
|
||||
if (!(isSiteEnabled(details) || (enabledSites.includes('###_wp_pigeon') && details.url.includes('/c/assets/pigeon.js')))
|
||||
|| matchUrlDomain(excludedSites.concat(['asia.nikkei.com', 'cambridge.org']), header_referer)) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
|
@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Chrome
|
||||
Post-release
|
||||
Fix Lequipe.fr (json)
|
||||
Fix Neue Osnabrucker Zeitung (amp)
|
||||
Update block general paywall script (Pigeon)
|
||||
|
||||
* v2.5.6.0 (2022-02-13)
|
||||
Add Condé Nast magazines & Vogue Business
|
||||
|
@ -1130,14 +1130,18 @@ else if (matchDomain('lequipe.fr')) {
|
||||
if (par_type) {
|
||||
article.innerHTML = '';
|
||||
let json_split = json.split('__type:' + par_type);
|
||||
json_split.shift();
|
||||
let article_dom;
|
||||
let article_text = '';
|
||||
let parser = new DOMParser();
|
||||
let par_main_title = '';
|
||||
for (let par_main of json_split) {
|
||||
if (par_main.includes(',content:')) {
|
||||
if (par_main.split(',content:"').length > 2) {
|
||||
if (par_main.startsWith(',title:'))
|
||||
article_text += '<p><strong>' + par_main.split(',title:')[1].split(',')[0].replace(/^\"|\"$/g, '') + '</strong></p>';
|
||||
if (par_main.split(',content:"').filter(x => !x.startsWith('\\')).length > 2) {
|
||||
if (par_main.startsWith(',title:')) {
|
||||
par_main_title = par_main.split(',title:')[1].split(',')[0].replace(/^\"|\"$/g, '');
|
||||
article_text += '<p><strong>' + par_main_title + '</strong></p>';
|
||||
}
|
||||
par_type = json.split('content:')[1].split('"},{__type:')[1].split(',')[0];
|
||||
pars = par_main.split('__type:' + par_type);
|
||||
} else {
|
||||
@ -1152,7 +1156,7 @@ else if (matchDomain('lequipe.fr')) {
|
||||
par_title = par.split(',title:')[1].split(',')[0].replace(/^\"|\"$/g, '');
|
||||
if (content) {
|
||||
par = content.replace('class=', '');
|
||||
if (par_title.length > 2)
|
||||
if (par_title.length > 2 && par_title !== par_main_title)
|
||||
par = '<strong>' + par_title + '</strong><br><br>' + content;
|
||||
par = par.replace(/\\u003C/g, '<').replace(/\\u003E/g, '>').replace(/\\u002F/g, '/').replace(/\\"/g, '"').replace(/^\"|\"$/g, '');
|
||||
article_text += '<p>' + par + '</p>';
|
||||
@ -1160,6 +1164,18 @@ else if (matchDomain('lequipe.fr')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
par_main = par_main.split('}]')[0];
|
||||
if (par_main.includes(',media:')) {
|
||||
let media = par_main.split(',media:')[1].split('}}')[0] + '}';
|
||||
if (media.includes('ratio:')) {
|
||||
let ratio = media.split('ratio:')[1].split(',')[0].split('}')[0];
|
||||
if (!parseInt(ratio))
|
||||
ratio = 1.5;
|
||||
let url = media.split('url:"')[1].split('"')[0].replace(/\\u002F/g, '/').replace('{width}', '400').replace('{height}', parseInt(400 / ratio)).replace('{quality}', '75');
|
||||
if (url)
|
||||
article_text += '<p><img src="' + url + '"</img></p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
article_dom = parser.parseFromString('<div style="margin:20px; font-famile:"DINNextLTPro-Regular",sans-serif; fot-size:18px;">' + DOMPurify.sanitize(article_text) + '</div>', 'text/html');
|
||||
article.appendChild(article_dom.querySelector('div'));
|
||||
@ -2632,14 +2648,6 @@ else if (matchDomain('medianama.com')) {
|
||||
csDoneOnce = true;
|
||||
}
|
||||
|
||||
else if (matchDomain('mexiconewsdaily.com')) {
|
||||
window.setTimeout(function () {
|
||||
let popup = document.querySelector('div.pigeon-widget-prompt');
|
||||
let cpro_overlay = document.querySelector('.cpro-overlay');
|
||||
removeDOMElement(popup, cpro_overlay);
|
||||
}, 500); // Delay (in milliseconds)
|
||||
}
|
||||
|
||||
else if (matchDomain('nation.africa')) {
|
||||
let datawall_content = document.querySelector('.datawall-content');
|
||||
if (datawall_content)
|
||||
|
@ -39,5 +39,5 @@
|
||||
"webRequestBlocking",
|
||||
"<all_urls>"
|
||||
],
|
||||
"version": "2.5.6.2"
|
||||
"version": "2.5.6.3"
|
||||
}
|
||||
|
@ -608,5 +608,5 @@
|
||||
"*://*.wallkit.net/*",
|
||||
"*://*.wsj.net/*"
|
||||
],
|
||||
"version": "2.5.6.2"
|
||||
"version": "2.5.6.3"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user