Add The West Australian (+ regional)

merge-requests/1/head
magnolia1234 4 years ago
parent f49603502d
commit 8144db6d35

@ -221,6 +221,7 @@ So don't update to Firefox 79 or use F-droid's [Fennec-release](https://f-droid.
[The Saturday Paper](https://www.thesaturdaypaper.com.au) -
[The Spectator Australia](https://www.spectator.com.au) -
[The Sydney Morning Herald](https://www.smh.com.au)
[The West Australian (+ regional)](https://thewest.com.au) -
[WAtoday](https://www.watoday.com.au)
##### > News Corp Australia

@ -78,6 +78,7 @@ var allow_cookies = [
'the-american-interest.com',
'thehindu.com',
'themarker.com',
'thewest.com.au',
'timeshighereducation.com',
'trouw.nl',
'variety.com',
@ -540,8 +541,9 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
let inkl_site = (matchUrlDomain('cdn.jsdelivr.net', details.url) && matchUrlDomain('inkl.com', header_referer) && isSiteEnabled({url: header_referer}));
let bloomberg_site = (matchUrlDomain('assets.bwbx.io', details.url) && matchUrlDomain('bloomberg.com', header_referer) && isSiteEnabled({url: header_referer}));
let au_apn_site = (header_referer && (urlHost(header_referer).endsWith('com.au') || urlHost(header_referer).endsWith('net.au'))) && details.url.includes('https://media.apnarm.net.au/');
if (!isSiteEnabled(details) && !(inkl_site) && !(bloomberg_site) && !(au_apn_site)) {
let au_apn_site = (header_referer && (urlHost(header_referer).endsWith('com.au') || urlHost(header_referer).endsWith('net.au')) && details.url.includes('https://media.apnarm.net.au/'));
let au_swm_site = (header_referer && urlHost(header_referer).endsWith('com.au') && details.url.includes('https://s.thewest.com.au/'));
if (!isSiteEnabled(details) && !(inkl_site) && !(bloomberg_site) && !(au_apn_site) && !(au_swm_site)) {
return;
}
@ -616,7 +618,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
if (tabId !== -1) {
ext_api.tabs.get(tabId, function (currentTab) {
if (isSiteEnabled(currentTab) || medium_custom_domain || au_apn_site) {
if (isSiteEnabled(currentTab) || medium_custom_domain || au_apn_site || au_swm_site) {
ext_api.tabs.executeScript(tabId, {
file: 'contentScript.js',
runAt: 'document_start'

@ -2,6 +2,8 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Add The West Australian (+ regional)
Update opt-in tab (default settings)
* v1.9.0.2 (2020-10-14)
Fix-update MIT Sloan Management Review (modal)

@ -63,8 +63,8 @@ else if (domain = matchDomain(["brisbanetimes.com.au", "smh.com.au", "theage.com
}
}
// Australian Community Media newspapers
else if (window.location.hostname.endsWith(".com.au") || window.location.hostname.endsWith(".net.au")) {
// Australian Community Media newspapers
let au_sites = ['bendigoadvertiser.com.au', 'bordermail.com.au', 'canberratimes.com.au', 'centralwesterndaily.com.au', 'dailyadvertiser.com.au', 'dailyliberal.com.au', 'examiner.com.au', 'illawarramercury.com.au', 'newcastleherald.com.au', 'northerndailyleader.com.au', 'portnews.com.au', 'standard.net.au', 'theadvocate.com.au', 'thecourier.com.au', 'westernadvocate.com.au'];
let au_piano_script = document.querySelector('script[src="https://cdn-au.piano.io/api/tinypass.min.js"]');
if (matchDomain(au_sites) || au_piano_script) {
@ -75,6 +75,87 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam
for (let subscriber_hider of subscriber_hiders) {
subscriber_hider.classList.remove('subscriber-hider');
}
} else if (window.location.hostname.endsWith(".com.au")) {
// Australian Seven West Media
let swm_script = document.querySelector('script[src^="https://s.thewest.com.au"]');
if (matchDomain("thewest.com.au") || swm_script) {
window.setTimeout(function () {
let breach_screen = document.querySelector('div[data-testid*="BreachScreen"]');
if (breach_screen) {
let scripts = document.querySelectorAll('script');
let json_script;
for (let script of scripts) {
if (script.innerText.includes('window.PAGE_DATA ='))
json_script = script;
continue;
}
if (json_script) {
let json_text = json_script.innerHTML.split('window.PAGE_DATA =')[1].split('</script')[0];
json_text = json_text.replace(/undefined/g, '"undefined"');
let json_article = JSON.parse(json_text);
let json_pub = Object.entries(json_article)[0][1].data.result.resolution.publication;
let json_content = json_pub.content.blocks;
//let json_video = json_pub.mainVideo;
let url = window.location.href;
let url_loaded = json_pub._self;
if (!url.includes(url_loaded.slice(-10)))
document.location.reload(true);
let article = '';
let div_content = document.createElement('div');
for (let par of json_content) {
if (par.kind === 'text') {
article = article + '<p>' + par.text + '</p>';
} else if (par.kind === 'subhead') {
article = article + '<h2>' + par.text + '</h2>';
} else if (par.kind === 'pull-quote') {
article = article + '<i>' + (par.attribution ? par.attribution + ': ' : '') + par.text + '</i>';
} else if (par.kind === 'embed') {
if (par.reference.includes('https://omny.fm/') || par.reference.includes('https://docdro.id/')) {
article = article + '<embed src="' + par.reference + '" style="height:500px; width:100%" frameborder="0"></embed>';
} else {
article = article + 'Embed: ' + '<a href="' + par.reference + '" target="_blank">' + par.reference + '</a>';
console.log('embed: ' + par.reference);
}
} else if (par.kind === 'unordered-list') {
if (par.items) {
article = article + '<ul>';
for (let item of par.items)
if (item.text && item.intentions[0].href) {
article = article + '<li><a href="' + item.intentions[0].href + '">' + item.text + '</a></li>';
}
article = article + '</ul>';
}
} else if (par.kind === 'inline') {
if (par.asset.kind === 'image') {
article = article + '<figure><img src="' + par.asset.original.reference + '" style="width:100%">';
article = article + '<figcaption>' +
par.asset.captionText + ' ' + par.asset.copyrightByline +
((par.asset.copyrightCredit && par.asset.captionText !== par.asset.copyrightByline) ? '/' + par.asset.copyrightCredit : '') +
'<figcaption></figure>';
}
} else {
article = article + '<p>' + par.text + '</p>';
console.log(par.kind);
}
}
let content = document.querySelector('div[class*="StyledArticleContent"]');
let parser = new DOMParser();
let par_html = parser.parseFromString('<div>' + article + '</div>', 'text/html');
let par_dom = par_html.querySelector('div');
if (content) {
content.appendChild(par_dom);
} else {
par_dom.setAttribute('style', 'margin: 20px;');
breach_screen.parentElement.insertBefore(par_dom, breach_screen);
}
}
removeDOMElement(breach_screen);
}
}, 1000); // Delay (in milliseconds)
let header_advert = document.querySelector('.headerAdvertisement');
if (header_advert)
header_advert.setAttribute('style', 'display: none;');
}
}
}

@ -1,327 +0,0 @@
{
"background": {
"scripts": ["sites.js", "bpc_count_daily_users.js", "background.js"]
},
"content_security_policy": "script-src 'self'; object-src 'self'",
"applications": {
"gecko": {
"id": "magnolia_limited_permissions@12.34",
"update_url": "https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean/raw/master/updates_lp.json"
}
},
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"128": "bypass.png"
},
"theme_icons": [{
"light": "bypass-dark.png",
"dark": "bypass.png",
"size": 128
}
]
},
"description": "Bypass Paywalls of news sites",
"homepage_url": "https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean",
"icons": {
"128": "bypass.png"
},
"manifest_version": 2,
"name": "Bypass Paywalls Clean (lp - no more updates)",
"short_name": "Bypass Paywall",
"options_ui": {
"browser_style": true,
"open_in_tab": true,
"page": "options.html"
},
"optional_permissions": [
"<all_urls>"
],
"permissions": [
"cookies",
"*://*.abc.es/*",
"*://*.ad.nl/*",
"*://*.adelaidenow.com.au/*",
"*://*.adweek.com/*",
"*://*.afr.com/*",
"*://*.aftonbladet.se/*",
"*://*.americanaffairsjournal.org/*",
"*://*.americanbanker.com/*",
"*://*.asia.nikkei.com/*",
"*://*.atavist.com/*",
"*://*.baltimoresun.com/*",
"*://*.barrons.com/*",
"*://*.belfasttelegraph.co.uk/*",
"*://*.bendigoadvertiser.com.au/*",
"*://*.bizjournals.com/*",
"*://*.bloomberg.com/*",
"*://*.bloombergquint.com/*",
"*://*.bordermail.com.au/*",
"*://*.bostonglobe.com/*",
"*://*.brisbanetimes.com.au/*",
"*://*.britannica.com/*",
"*://*.business-standard.com/*",
"*://*.businessinsider.com/*",
"*://*.cairnspost.com.au/*",
"*://*.caixinglobal.com/*",
"*://*.canberratimes.com.au/*",
"*://*.cen.acs.org/*",
"*://*.centralwesterndaily.com.au/*",
"*://*.challenges.fr/*",
"*://*.charliehebdo.fr/*",
"*://*.chicagobusiness.com/*",
"*://*.chicagotribune.com/*",
"*://*.chronicle.com/*",
"*://*.clarin.com/*",
"*://*.commentarymagazine.com/*",
"*://*.corriere.it/*",
"*://*.courant.com/*",
"*://*.couriermail.com.au/*",
"*://*.csmonitor.com/*",
"*://*.cw.com.tw/*",
"*://*.dailyadvertiser.com.au/*",
"*://*.dailyexaminer.com.au/*",
"*://*.dailyliberal.com.au/*",
"*://*.dailymercury.com.au/*",
"*://*.dailypress.com/*",
"*://*.dailytelegraph.com.au/*",
"*://*.darkreading.com/*",
"*://*.demorgen.be/*",
"*://*.denverpost.com/*",
"*://*.df.cl/*",
"*://*.digiday.com/*",
"*://*.dn.se/*",
"*://*.dvhn.nl/*",
"*://*.economist.com/*",
"*://*.editorialedomani.it/*",
"*://*.elcomercio.pe/*",
"*://*.elmercurio.com/*",
"*://*.elmundo.es/*",
"*://*.elpais.com/*",
"*://*.estadao.com.br/*",
"*://*.eurekareport.com.au/*",
"*://*.exame.abril.com.br/*",
"*://*.examiner.com.au/*",
"*://*.faz.net/*",
"*://*.fd.nl/*",
"*://*.firstthings.com/*",
"*://*.fnlondon.com/*",
"*://*.folha.uol.com.br/*",
"*://*.foreignpolicy.com/*",
"*://*.fortune.com/*",
"*://*.frasercoastchronicle.com.au/*",
"*://*.fresnobee.com/*",
"*://*.ft.com/*",
"*://*.ftm.nl/*",
"*://*.geelongadvertiser.com.au/*",
"*://*.gestion.pe/*",
"*://*.gladstoneobserver.com.au/*",
"*://*.glassdoor.com/*",
"*://*.globes.co.il/*",
"*://*.globo.com/*",
"*://*.goldcoastbulletin.com.au/*",
"*://*.groene.nl/*",
"*://*.gympietimes.com.au/*",
"*://*.haaretz.co.il/*",
"*://*.haaretz.com/*",
"*://*.handelsblatt.com/*",
"*://*.harpers.org/*",
"*://*.haz.de/*",
"*://*.hbr.org/*",
"*://*.hbrtaiwan.com/*",
"*://*.heraldsun.com.au/*",
"*://*.historyextra.com/*",
"*://*.humo.be/*",
"*://*.ilfattoquotidiano.it/*",
"*://*.illawarramercury.com.au/*",
"*://*.ilmanifesto.it/*",
"*://*.ilmessaggero.it/*",
"*://*.inc.com/*",
"*://*.independent.ie/*",
"*://*.inkl.com/*",
"*://*.inquirer.com/*",
"*://*.intelligentinvestor.com.au/*",
"*://*.irishtimes.com/*",
"*://*.japantimes.co.jp/*",
"*://*.journaldunet.com/*",
"*://*.journalnow.com/*",
"*://*.knack.be/*",
"*://*.labusinessjournal.com/*",
"*://*.ladepeche.fr/*",
"*://*.lanacion.com.ar/*",
"*://*.lasegunda.com/*",
"*://*.lastampa.it/*",
"*://*.latercera.com/*",
"*://*.latimes.com/*",
"*://*.lc.nl/*",
"*://*.lecho.be/*",
"*://*.ledevoir.com/*",
"*://*.lejdd.fr/*",
"*://*.leparisien.fr/*",
"*://*.lescienze.it/*",
"*://*.lesechos.com/*",
"*://*.lesechos.fr/*",
"*://*.lesoir.be/*",
"*://*.liberation.fr/*",
"*://*.limesonline.com/*",
"*://*.livemint.com/*",
"*://*.loebclassics.com/*",
"*://*.lopinion.fr/*",
"*://*.lrb.co.uk/*",
"*://*.lvz.de/*",
"*://*.mcall.com/*",
"*://*.medium.com/*",
"*://*.mercuriovalpo.cl/*",
"*://*.mercurynews.com/*",
"*://*.mexiconewsdaily.com/*",
"*://*.miamiherald.com/*",
"*://*.modernhealthcare.com/*",
"*://*.mv-voice.com/*",
"*://*.nationalgeographic.com/*",
"*://*.nationalpost.com/*",
"*://*.nationalreview.com/*",
"*://*.nautil.us/*",
"*://*.newcastleherald.com.au/*",
"*://*.newrepublic.com/*",
"*://*.news-gazette.com/*",
"*://*.news-mail.com.au/*",
"*://*.newstatesman.com/*",
"*://*.newsweek.com/*",
"*://*.newyorker.com/*",
"*://*.nknews.org/*",
"*://*.noordhollandsdagblad.nl/*",
"*://*.northerndailyleader.com.au/*",
"*://*.northernstar.com.au/*",
"*://*.nrc.nl/*",
"*://*.nrz.de/*",
"*://*.ntnews.com.au/*",
"*://*.nymag.com/*",
"*://*.nytimes.com/*",
"*://*.nzherald.co.nz/*",
"*://*.nzz.ch/*",
"*://*.ocregister.com/*",
"*://*.orlandosentinel.com/*",
"*://*.paloaltoonline.com/*",
"*://*.parool.nl/*",
"*://*.philosophynow.org/*",
"*://*.portnews.com.au/*",
"*://*.post-gazette.com/*",
"*://*.qt.com.au/*",
"*://*.quora.com/*",
"*://*.qz.com/*",
"*://*.repubblica.it/*",
"*://*.republic.ru/*",
"*://*.rollingstone.com/*",
"*://*.sacbee.com/*",
"*://*.sandiegouniontribune.com/*",
"*://*.science-et-vie.com/*",
"*://*.sciencesetavenir.fr/*",
"*://*.scientificamerican.com/*",
"*://*.scmp.com/*",
"*://*.scribd.com/*",
"*://*.seattletimes.com/*",
"*://*.seekingalpha.com/*",
"*://*.sfchronicle.com/*",
"*://*.slader.com/*",
"*://*.slate.com/*",
"*://*.sloanreview.mit.edu/*",
"*://*.smh.com.au/*",
"*://*.sofrep.com/*",
"*://*.spectator.co.uk/*",
"*://*.spectator.com.au/*",
"*://*.standard.net.au/*",
"*://*.startribune.com/*",
"*://*.statista.com/*",
"*://*.stocknews.com/*",
"*://*.sueddeutsche.de/*",
"*://*.sun-sentinel.com/*",
"*://*.sunshinecoastdaily.com.au/*",
"*://*.techinasia.com/*",
"*://*.technologyreview.com/*",
"*://*.telegraaf.nl/*",
"*://*.telegraph.co.uk/*",
"*://*.the-american-interest.com/*",
"*://*.the-tls.co.uk/*",
"*://*.theadvocate.com.au/*",
"*://*.theage.com.au/*",
"*://*.theatlantic.com/*",
"*://*.theaustralian.com.au/*",
"*://*.thechronicle.com.au/*",
"*://*.thecourier.com.au/*",
"*://*.thedailybeast.com/*",
"*://*.thediplomat.com/*",
"*://*.theglobeandmail.com/*",
"*://*.thehindu.com/*",
"*://*.themarker.com/*",
"*://*.themercury.com.au/*",
"*://*.themorningbulletin.com.au/*",
"*://*.thenation.com/*",
"*://*.thesaturdaypaper.com.au/*",
"*://*.thestar.com/*",
"*://*.thetimes.co.uk/*",
"*://*.tijd.be/*",
"*://*.timeshighereducation.com/*",
"*://*.towardsdatascience.com/*",
"*://*.townsvillebulletin.com.au/*",
"*://*.trouw.nl/*",
"*://*.valeursactuelles.com/*",
"*://*.vanityfair.com/*",
"*://*.variety.com/*",
"*://*.volkskrant.nl/*",
"*://*.warwickdailynews.com.au/*",
"*://*.washingtonpost.com/*",
"*://*.watoday.com.au/*",
"*://*.waz.de/*",
"*://*.weeklytimesnow.com.au/*",
"*://*.westernadvocate.com.au/*",
"*://*.wired.com/*",
"*://*.worldpoliticsreview.com/*",
"*://*.wp.de/*",
"*://*.wr.de/*",
"*://*.wsj.com/*",
"*://*.zeit.de/*",
"*://*.apnarm.net.au/*",
"*://*.blueconic.net/*",
"*://*.matheranalytics.com/*",
"*://*.onecount.net/*",
"*://*.piano.io/*",
"*://*.poool.fr/*",
"*://*.qiota.com/*",
"*://*.tinypass.com/*",
"*://*.tribdss.com/*",
"*://*.ampproject.org/*",
"*://*.bwbx.io/*",
"*://*.cedsdigital.it/*",
"*://*.corriereobjects.it/*",
"*://*.ctfassets.net/*",
"*://*.cxense.com/*",
"*://*.emol.cl/*",
"*://*.epimg.net/*",
"*://*.evolok.net/*",
"*://*.flip-pay.com/*",
"*://*.googletagmanager.com/*",
"*://*.htmedia.in/*",
"*://*.jsdelivr.net/*",
"*://*.lightboxcdn.com/*",
"*://*.lp4.io/*",
"*://*.nyt.com/*",
"*://*.pasedigital.cl/*",
"*://*.pelcro.com/*",
"*://*.rcsobjects.it/*",
"*://*.repstatic.it/*",
"*://*.userzoom.com/*",
"*://*.viralize.tv/*",
"*://*.bndestem.nl/*",
"*://*.bd.nl/*",
"*://*.ed.nl/*",
"*://*.gelderlander.nl/*",
"*://*.pzc.nl/*",
"*://*.destentor.nl/*",
"*://*.tubantia.nl/*",
"storage",
"tabs",
"webRequest",
"webRequestBlocking"
],
"version": "1.9.0.2"
}

@ -259,6 +259,7 @@
"*://*.thesaturdaypaper.com.au/*",
"*://*.thestar.com/*",
"*://*.thetimes.co.uk/*",
"*://*.thewest.com.au/*",
"*://*.tijd.be/*",
"*://*.timeshighereducation.com/*",
"*://*.towardsdatascience.com/*",
@ -323,5 +324,5 @@
"webRequest",
"webRequestBlocking"
],
"version": "1.9.0.2"
"version": "1.9.0.3"
}

@ -191,6 +191,7 @@ var defaultSites =
"The Toronto Star": "thestar.com",
"The Wall Street Journal (not Chinese)": "wsj.com",
"The Washington Post": "washingtonpost.com",
"The West Australian (+ regional)": "thewest.com.au",
"Times Higher Education": "timeshighereducation.com",
"Towards Data Science": "towardsdatascience.com",
"Trouw": "trouw.nl",

Loading…
Cancel
Save