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
5 changed files with 15 additions and 0 deletions

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',