Fix Toronto Star (enable Javascript)

This commit is contained in:
magnolia1234 2020-01-05 17:08:07 +01:00 committed by GitHub
parent 0494d43a65
commit b36da10715
4 changed files with 13 additions and 3 deletions

View file

@ -307,7 +307,7 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) {
return {cancel: true};
},
{
urls: ["*://*.theglobeandmail.com/*", "*://*.thestar.com/*", "*://*.newstatesman.com/*", "*://*.afr.com/*"],
urls: ["*://*.theglobeandmail.com/*", "*://*.newstatesman.com/*", "*://*.afr.com/*"],
types: ["script"]
},
["blocking"]

View file

@ -248,6 +248,15 @@ if (window.location.href.indexOf("newcastleherald.com.au") !== -1) {
}
}
if (window.location.href.indexOf("thestar.com") !== -1) {
const paywall = document.querySelector('.basic-paywall-new');
removeDOMElement(paywall);
const tbc = document.querySelectorAll('.text-block-container');
for (let i = 0; i < tbc.length; i++) {
tbc[i].removeAttribute('style');
}
}
function removeDOMElement(...elements) {
for (let element of elements) {
if (element) element.remove();

View file

@ -27,7 +27,8 @@
"*://*.nrc.nl/*",
"*://*.theathletic.com/*",
"*://*.techinasia.com/*",
"*://*.newcastleherald.com.au/*"
"*://*.newcastleherald.com.au/*",
"*://*.thestar.com/*"
],
"js": ["contentScript.js"]
}

View file

@ -89,7 +89,7 @@ var defaultSites = {
'The Sydney Morning Herald': 'smh.com.au',
'The Telegraph': 'telegraph.co.uk',
'The Times': 'thetimes.co.uk',
'The Toronto Star (javascript disabled)': 'thestar.com',
'The Toronto Star': 'thestar.com',
'The Washington Post': 'washingtonpost.com',
'The Wall Street Journal': 'wsj.com',
'Times Literary Supplement': 'the-tls.co.uk',