mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-09-20 07:23:46 +02:00
Add Outlook India
This commit is contained in:
parent
f422de0f30
commit
daa461e37f
7 changed files with 40 additions and 6 deletions
|
@ -689,6 +689,7 @@ Grouped in options:\
|
||||||
[LiveMint](https://www.livemint.com) -
|
[LiveMint](https://www.livemint.com) -
|
||||||
[MediaNama](https://www.medianama.com) -
|
[MediaNama](https://www.medianama.com) -
|
||||||
[Mid-Day](https://www.mid-day.com) -
|
[Mid-Day](https://www.mid-day.com) -
|
||||||
|
[Outlook](https://www.outlookindia.com) -
|
||||||
[The Economic Times (ET Prime)](https://economictimes.indiatimes.com) -
|
[The Economic Times (ET Prime)](https://economictimes.indiatimes.com) -
|
||||||
[The Hindu](https://www.thehindu.com) -
|
[The Hindu](https://www.thehindu.com) -
|
||||||
[The Hindu BusinessLine](https://www.thehindubusinessline.com) -
|
[The Hindu BusinessLine](https://www.thehindubusinessline.com) -
|
||||||
|
|
|
@ -149,7 +149,7 @@ function set_rules(sites, sites_updated, sites_custom) {
|
||||||
let site_default = defaultSites.hasOwnProperty(site) ? site : Object.keys(defaultSites).find(default_key => compareKey(default_key, site));
|
let site_default = defaultSites.hasOwnProperty(site) ? site : Object.keys(defaultSites).find(default_key => compareKey(default_key, site));
|
||||||
if (site_default) {
|
if (site_default) {
|
||||||
rule = defaultSites[site_default];
|
rule = defaultSites[site_default];
|
||||||
if (sites_updated.hasOwnProperty(site_default))
|
if (sites_updated.hasOwnProperty(site_default) && !sites_updated[site_default].new_site)
|
||||||
rule = sites_updated[site_default];
|
rule = sites_updated[site_default];
|
||||||
} else if (sites_updated.hasOwnProperty(site)) { // updated (new) sites
|
} else if (sites_updated.hasOwnProperty(site)) { // updated (new) sites
|
||||||
rule = sites_updated[site];
|
rule = sites_updated[site];
|
||||||
|
|
|
@ -5,6 +5,7 @@ Post-release
|
||||||
Add Aftonbladet.se
|
Add Aftonbladet.se
|
||||||
Add Investors' Chronicle (UK)
|
Add Investors' Chronicle (UK)
|
||||||
Add Nzz.ch Regional (opt-in to custom sites)
|
Add Nzz.ch Regional (opt-in to custom sites)
|
||||||
|
Add Outlook India
|
||||||
Fix ABC.es (mobile)
|
Fix ABC.es (mobile)
|
||||||
Fix Adweek (free articles only)
|
Fix Adweek (free articles only)
|
||||||
Fix Quartz (newsletter)
|
Fix Quartz (newsletter)
|
||||||
|
|
|
@ -64,7 +64,7 @@ if ((bg2csData !== undefined) && bg2csData.ld_json && dompurify_loaded) {
|
||||||
removeDOMElement(paywall);
|
removeDOMElement(paywall);
|
||||||
let json_script = getArticleJsonScript();
|
let json_script = getArticleJsonScript();
|
||||||
if (json_script) {
|
if (json_script) {
|
||||||
let json_text = JSON.parse(json_script.text).articleBody;
|
let json_text = parseHtmlEntities(JSON.parse(json_script.text).articleBody);
|
||||||
let content = document.querySelector(article_sel);
|
let content = document.querySelector(article_sel);
|
||||||
if (json_text && content) {
|
if (json_text && content) {
|
||||||
let parser = new DOMParser();
|
let parser = new DOMParser();
|
||||||
|
@ -2753,7 +2753,7 @@ else if (matchDomain('hilltimes.com')) {
|
||||||
if (json_script) {
|
if (json_script) {
|
||||||
let json = JSON.parse(json_script.text).filter(x => x.articleBody)[0];
|
let json = JSON.parse(json_script.text).filter(x => x.articleBody)[0];
|
||||||
if (json) {
|
if (json) {
|
||||||
let json_text = json.articleBody.replace(/ /g, '').replace(/(\.|\%)\s{3,}/g, "$&\r\n\r\n");
|
let json_text = parseHtmlEntities(json.articleBody).replace(/(\.|\%)\s{3,}/g, "$&\r\n\r\n");
|
||||||
let content = document.querySelector('div#xorg');
|
let content = document.querySelector('div#xorg');
|
||||||
if (json_text && content)
|
if (json_text && content)
|
||||||
content.innerText = '\r\n' + json_text;
|
content.innerText = '\r\n' + json_text;
|
||||||
|
@ -3120,6 +3120,27 @@ else if (matchDomain('nytimes.com')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (matchDomain('outlookindia.com')) {
|
||||||
|
let paywall = document.querySelector('div.paywall');
|
||||||
|
if (paywall) {
|
||||||
|
removeDOMElement(paywall);
|
||||||
|
let json_script = getArticleJsonScript();
|
||||||
|
if (json_script) {
|
||||||
|
let json = JSON.parse(json_script.text);
|
||||||
|
if (json) {
|
||||||
|
let json_text = parseHtmlEntities(json.articleBody).replace(/\n/g, "$&\r\n");
|
||||||
|
let content = document.querySelector('div#articleBody');
|
||||||
|
if (json_text && content) {
|
||||||
|
content.innerHTML = '';
|
||||||
|
let article_new = document.createElement('p');
|
||||||
|
article_new.innerText = json_text;
|
||||||
|
content.appendChild(article_new);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (matchDomain('quora.com')) {
|
else if (matchDomain('quora.com')) {
|
||||||
let overlays = document.querySelectorAll('div[class*="_overlay"]');
|
let overlays = document.querySelectorAll('div[class*="_overlay"]');
|
||||||
removeDOMElement(...overlays);
|
removeDOMElement(...overlays);
|
||||||
|
@ -3956,9 +3977,9 @@ function breakText(str) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function parseHtmlEntities(encodedString) {
|
function parseHtmlEntities(encodedString) {
|
||||||
let translate_re = /&(nbsp|amp|quot|lt|gt|deg|hellip|laquo|raquo|ldquo|rdquo|lsquo|rsquo|mdash);/g;
|
let translate_re = /&(nbsp|amp|quot|lt|gt|deg|hellip|laquo|raquo|ldquo|rdquo|lsquo|rsquo|mdash|shy);/g;
|
||||||
let translate = {"nbsp": " ", "amp": "&", "quot": "\"", "lt": "<", "gt": ">", "deg": "°", "hellip": "…",
|
let translate = {"nbsp": " ", "amp": "&", "quot": "\"", "lt": "<", "gt": ">", "deg": "°", "hellip": "…",
|
||||||
"laquo": "«", "raquo": "»", "ldquo": "“", "rdquo": "”", "lsquo": "‘", "rsquo": "’", "mdash": "—"};
|
"laquo": "«", "raquo": "»", "ldquo": "“", "rdquo": "”", "lsquo": "‘", "rsquo": "’", "mdash": "—", "shy": ""};
|
||||||
return encodedString.replace(translate_re, function (match, entity) {
|
return encodedString.replace(translate_re, function (match, entity) {
|
||||||
return translate[entity];
|
return translate[entity];
|
||||||
}).replace(/&#(\d+);/gi, function (match, numStr) {
|
}).replace(/&#(\d+);/gi, function (match, numStr) {
|
||||||
|
|
|
@ -445,6 +445,7 @@
|
||||||
"*://*.orlandosentinel.com/*",
|
"*://*.orlandosentinel.com/*",
|
||||||
"*://*.ostsee-zeitung.de/*",
|
"*://*.ostsee-zeitung.de/*",
|
||||||
"*://*.otz.de/*",
|
"*://*.otz.de/*",
|
||||||
|
"*://*.outlookindia.com/*",
|
||||||
"*://*.outsideonline.com/*",
|
"*://*.outsideonline.com/*",
|
||||||
"*://*.oxygenmag.com/*",
|
"*://*.oxygenmag.com/*",
|
||||||
"*://*.paloaltoonline.com/*",
|
"*://*.paloaltoonline.com/*",
|
||||||
|
@ -666,5 +667,5 @@
|
||||||
"*://*.wsj.net/*",
|
"*://*.wsj.net/*",
|
||||||
"*://webcache.googleusercontent.com/*"
|
"*://webcache.googleusercontent.com/*"
|
||||||
],
|
],
|
||||||
"version": "2.6.4.6"
|
"version": "2.6.4.7"
|
||||||
}
|
}
|
||||||
|
|
4
sites.js
4
sites.js
|
@ -1277,6 +1277,10 @@ var defaultSites = {
|
||||||
allow_cookies: 1,
|
allow_cookies: 1,
|
||||||
block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-((sticky-)?ad|subscriptions)-.+\.js)/
|
block_regex: /(\.tinypass\.com\/|cdn\.ampproject\.org\/v\d\/amp-((sticky-)?ad|subscriptions)-.+\.js)/
|
||||||
},
|
},
|
||||||
|
"Outlook India": {
|
||||||
|
domain: "outlookindia.com",
|
||||||
|
allow_cookies: 1
|
||||||
|
},
|
||||||
"Outside magazines": {
|
"Outside magazines": {
|
||||||
domain: "###_usa_outside_mag",
|
domain: "###_usa_outside_mag",
|
||||||
group: [
|
group: [
|
||||||
|
|
|
@ -24,5 +24,11 @@
|
||||||
"Nürnberger Nachrichten": {
|
"Nürnberger Nachrichten": {
|
||||||
"domain": "nn.de",
|
"domain": "nn.de",
|
||||||
"block_regex": "(cdn\\.cxense\\.com\\/|\\.piano\\.io\\/)"
|
"block_regex": "(cdn\\.cxense\\.com\\/|\\.piano\\.io\\/)"
|
||||||
|
},
|
||||||
|
"Outlook India": {
|
||||||
|
"domain": "outlookindia.com",
|
||||||
|
"allow_cookies": 1,
|
||||||
|
"ld_json": "div.paywall|div#articleBody",
|
||||||
|
"new_site": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue