Add thewrap.com support (#560)

* Add thewrap.com as #379

* Update src/js/contentScript.js

* Update README.md
This commit is contained in:
Nguyễn Kim Kha 2020-04-24 11:54:17 +10:00 committed by GitHub
parent 2e247e735a
commit c22ec98069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 0 deletions

View File

@ -142,6 +142,7 @@
[The Toronto Star](https://www.thestar.com)\
[The Wall Street Journal](https://www.wsj.com)\
[The Washington Post](https://www.washingtonpost.com)\
[The Wrap](https://www.thewrap.com)\
[TheMarker](https://www.themarker.com)\
[Times Literary Supplement](https://www.the-tls.co.uk)\
[Towards Data Science](https://www.towardsdatascience.com)\

View File

@ -45,6 +45,7 @@
"*://*.theglobeandmail.com/*",
"*://*.thehindu.com/*",
"*://*.thestar.com/*",
"*://*.thewrap.com/*",
"*://*.trouw.nl/*",
"*://*.volkskrant.nl/*",
"*://*.washingtonpost.com/*",
@ -202,6 +203,7 @@
"*://*.thesaturdaypaper.com.au/*",
"*://*.thestar.com/*",
"*://*.thetimes.co.uk/*",
"*://*.thewrap.com/*",
"*://*.tijd.be/*",
"*://*.towardsdatascience.com/*",
"*://*.trouw.nl/*",

View File

@ -178,6 +178,7 @@ const blockedRegexes = {
'thecourier.com.au': /.+cdn-au\.piano\.io\/api\/tinypass.+\.js/,
'theglobeandmail.com': /theglobeandmail\.com\/pb\/resources\/scripts\/build\/chunk-bootstraps\/.+\.js/,
'thenation.com': /thenation\.com\/.+\/paywall-script\.php/,
'thewrap.com': /thewrap\.com\/.+\/wallkit\.js/,
};
const userAgentDesktop = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

View File

@ -414,6 +414,16 @@ if (matchDomain('techinasia.com')) {
removeDOMElement(splash_subscribe, paywall_hard);
}
if (matchDomain('thewrap.com')) {
const embed = document.querySelector('.embed');
if (embed) {
// Display feature video
const container = document.querySelector('.featured-image-container');
removeDOMElement(container);
embed.classList.remove('d-none');
}
}
function matchDomain(domains) {
var hostname = window.location.hostname;
if (typeof domains === 'string')

View File

@ -121,6 +121,7 @@ const defaultSites = {
'The Toronto Star': 'thestar.com',
'The Wall Street Journal': 'wsj.com',
'The Washington Post': 'washingtonpost.com',
'The Wrap': 'thewrap.com',
'Times Literary Supplement': 'the-tls.co.uk',
'Towards Data Science': 'towardsdatascience.com',
'Trouw': 'trouw.nl',