Fix-update Irish Times (amp for premium)

This commit is contained in:
magnolia1234 2020-07-18 08:42:02 +02:00
parent 76f884625e
commit af350e41a9
4 changed files with 12 additions and 2 deletions

View file

@ -168,7 +168,7 @@ Install add-on by downloading xpi-file.
[London Review of Books](https://www.lrb.co.uk) -
[The Athletic UK](https://theathletic.com) -
[The Economist](https://www.economist.com) -
[The Irish Times](https://www.irishtimes.com)* -
[The Irish Times](https://www.irishtimes.com) -
[The New Statesman](https://www.newstatesman.com) -
[The Spectator](https://www.spectator.co.uk) -
[The Telegraph](https://www.telegraph.co.uk) -

View file

@ -168,6 +168,7 @@ var blockedRegexes = {
'ilmessaggero.it': /(utils\.cedsdigital\.it\/js\/PaywallMeter\.js|static\.viralize\.tv\/viralize_player)/,
'independent.ie': /cdn\.flip-pay\.com\/clients\/inm\/flip-pay\.js/,
'inquirer.com': /.+\.tinypass\.com\/.+/,
'irishtimes.com': /cdn\.ampproject\.org\/v\d\/amp-access-.+\.js/,
'knack.be': /.+\.knack\.be\/js\/responsive\/rmgModal\.js/,
'ladepeche.fr': /.+\.poool\.fr\/.+/,
'lastampa.it': /.+\.repstatic\.it\/minify\/sites\/lastampa\/.+\/config\.cache\.php\?name=social_js/,

View file

@ -854,6 +854,15 @@ else if (matchDomain("harpers.org")) {
removeDOMElement(overlay);
}
else if (matchDomain("irishtimes.com")) {
document.addEventListener('DOMContentLoaded', () => {
let stub_article_msg = document.querySelector('div.stub-article-msg');
let url = window.location.href;
if (url.includes('mode=sample') || stub_article_msg)
window.location.href = new URL(url).pathname + '?mode=amp';
});
}
// General Functions
function removeDOMElement(...elements) {
for (let element of elements) {

View file

@ -148,7 +148,7 @@ var defaultSites =
"The Economist": "economist.com",
"The Globe and Mail": "theglobeandmail.com",
"The Hindu": "thehindu.com",
"The Irish Times (free articles only)": "irishtimes.com",
"The Irish Times": "irishtimes.com",
"The Japan Times": "japantimes.co.jp",
"The Marker": "themarker.com",
"The Mercury News": "mercurynews.com",