@ -1,6 +1,7 @@
//"use strict";
var ext _api = ( typeof browser === 'object' ) ? browser : chrome ;
var domain ;
var csDone = false ;
// clean local storage of sites (with an exemption for hold-list)
var arr _localstorage _hold = [ 'elmundo.es' , 'kurier.at' , 'nknews.org' , 'nrz.de' , 'seekingalpha.com' , 'sfchronicle.com' , 'thehindu.com' , 'thetimes.co.uk' , 'waz.de' , 'wp.de' , 'wr.de' ] ;
@ -73,6 +74,8 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam
for ( let subscriber _hider of subscriber _hiders ) {
subscriber _hider . classList . remove ( 'subscriber-hider' ) ;
}
let story _generic _iframe = document . querySelector ( '.story-generic__iframe' ) ;
removeDOMElement ( story _generic _iframe ) ;
} else if ( window . location . hostname . endsWith ( ".com.au" ) ) {
// Australia News Corp
let au _nc _sites = [ 'adelaidenow.com.au' , 'cairnspost.com.au' , 'couriermail.com.au' , 'dailytelegraph.com.au' , 'geelongadvertiser.com.au' , 'goldcoastbulletin.com.au' , 'heraldsun.com.au' , 'ntnews.com.au' , 'theaustralian.com.au' , 'themercury.com.au' , 'townsvillebulletin.com.au' , 'weeklytimesnow.com.au' ] ;
@ -104,7 +107,11 @@ else if (window.location.hostname.endsWith(".com.au") || window.location.hostnam
json _pub = json _article [ key ] . data . result . resolution . publication ;
continue ;
}
let json _content = json _pub . content . blocks ;
let json _content
if ( json _pub )
json _content = json _pub . content . blocks ;
else
window . location . reload ( true ) ;
//let json_video = json_pub.mainVideo;
let url = window . location . href ;
let url _loaded = json _pub . _self ;
@ -182,6 +189,7 @@ else if (matchDomain('rep.repubblica.it')) {
paywall . removeAttribute ( 'subscriptions-section' ) ;
const preview = document . querySelector ( 'div[subscriptions-section="content-not-granted"]' ) ;
removeDOMElement ( preview ) ;
csDone = true ;
}
}
}
@ -230,6 +238,7 @@ else if (matchDomain('telegraaf.nl')) {
} ) ;
div _main . appendChild ( div _elem ) ;
article _body . appendChild ( div _main ) ;
csDone = true ;
}
}
}
@ -258,6 +267,8 @@ else if (matchDomain("washingtonpost.com")) {
}
} , 300 ) ; // Delay (in milliseconds)
}
else if ( adverts || leaderboard )
csDone = true ;
}
else if ( matchDomain ( "wsj.com" ) && ! matchDomain ( "cn.wsj.com" ) ) {
@ -273,20 +284,16 @@ else if (matchDomain("wsj.com") && !matchDomain("cn.wsj.com")) {
let snippet = document . querySelector ( '.snippet-promotion' ) ;
let wsj _pro = document . querySelector ( 'meta[name="page.site"][content="wsjpro"]' ) ;
if ( snippet || wsj _pro ) {
window . location . href = window . location . href . replace ( 'wsj.com' , 'wsj.com/amp' ) .replace ( '#refreshed' , '' ) ;
window . location . href = window . location . href . replace ( 'wsj.com' , 'wsj.com/amp' ) ;
}
} ) ;
}
else if ( matchDomain ( "sloanreview.mit.edu" ) ) {
const read _more = document . querySelector ( '.btn-read-more' ) ;
if ( read _more )
read _more . click ( ) ;
}
else if ( matchDomain ( "mexiconewsdaily.com" ) ) {
window . setTimeout ( function ( ) {
let cpro _overlay = document . querySelector ( '.cpro-overlay' ) ;
removeDOMElement ( cpro _overlay ) ;
} , 500 ) ; // Delay (in milliseconds)
}
else if ( matchDomain ( "the-american-interest.com" ) ) {
@ -317,6 +324,7 @@ else if (matchDomain("nzherald.co.nz")) {
if ( first _span )
first _span . removeAttribute ( 'class' ) ;
removeDOMElement ( article _offer ) ;
csDone = true ;
}
}
let premium _toaster = document . querySelector ( '#premium-toaster' ) ;
@ -354,6 +362,8 @@ else if (matchDomain("bloomberg.com")) {
let paywall _overlay = document . querySelector ( 'div#graphics-paywall-overlay' ) ;
let banner = document . getElementById ( 'paywall-banner' ) ;
removeDOMElement ( banner , paywall _overlay ) ;
if ( banner )
csDone = true ;
}
else if ( matchDomain ( "bloombergquint.com" ) ) {
@ -409,6 +419,7 @@ else if (matchDomain("nytimes.com")) {
let preview _button = document . querySelector ( '.css-3s1ce0' ) ;
if ( preview _button )
preview _button . click ( ) ;
csDone = true ;
}
else if ( matchDomain ( "economist.com" ) ) {
@ -447,17 +458,17 @@ else if (matchDomain("the-tls.co.uk")) {
}
else if ( matchDomain ( "caixinglobal.com" ) ) {
window . setTimeout ( function ( ) {
let pay _tips = document . querySelectorAll ( '.cons-pay-tip' ) ;
for ( let pay _tip of pay _tips ) {
for ( let pay _tip of pay _tips )
pay _tip . removeAttribute ( 'style' ) ;
}
let appContent = document . getElementById ( 'appContent' ) ;
if ( appContent ) {
let hidden _pars = document . querySelectorAll ( 'p:not([style="display:block;"])' ) ;
for ( let hidden _par of hidden _pars ) {
for ( let hidden _par of hidden _pars )
hidden _par . setAttribute ( 'style' , 'display:block;' ) ;
}
}
} , 500 ) ; // Delay (in milliseconds)
}
else if ( matchDomain ( "nrc.nl" ) ) {
@ -524,6 +535,7 @@ else if (matchDomain("techinasia.com")) {
const paywall = document . querySelector ( '.paywall-content' ) ;
if ( paywall ) {
paywall . classList . remove ( 'paywall-content' ) ;
csDone = true ;
}
const splash _subscribe = document . querySelector ( '.splash-subscribe' ) ;
const paywall _hard = document . querySelector ( '.paywall-hard' ) ;
@ -531,6 +543,7 @@ else if (matchDomain("techinasia.com")) {
}
else if ( matchDomain ( "thestar.com" ) ) {
window . setTimeout ( function ( ) {
let meter _banner = document . querySelector ( '.c-article-meter-banner' ) ;
removeDOMElement ( meter _banner ) ;
let rightrail = document . querySelector ( '.c-article-body__rightrail' ) ;
@ -601,18 +614,18 @@ else if (matchDomain("thestar.com")) {
}
}
}
} , 500 ) ;
}
else if ( matchDomain ( "afr.com" ) ) {
let hidden _images = document . querySelectorAll ( 'img ') ;
let hidden _images = document . querySelectorAll ( 'img [src*=".gif"] ') ;
for ( let hidden _image of hidden _images ) {
var src = hidden _image . src ;
if ( src . includes ( ".gif" ) ) {
var data _src = hidden _image . getAttribute ( "data-src" ) ;
if ( data _src )
hidden _image . setAttribute ( 'src' , data _src ) ;
}
}
if ( hidden _images )
csDone = true ;
let plista = document . querySelector ( 'div[data-plista-placement="underArticle_Group"]' ) ;
removeDOMElement ( plista ) ;
}
@ -621,6 +634,7 @@ else if (matchDomain("theglobeandmail.com")) {
let article _body _subscribed = document . querySelector ( '.c-article-body--subscribed' ) ;
if ( article _body _subscribed ) {
article _body _subscribed . removeAttribute ( 'class' ) ;
csDone = true ;
}
function tgam _main ( ) {
document . addEventListener ( 'bpc_event' , function ( e ) {
@ -799,15 +813,17 @@ else if (matchDomain('barrons.com')) {
}
else if ( matchDomain ( 'lescienze.it' ) ) {
const paywall = document . querySelector ( '.paywall-adagio' ) ;
const body _paywall = document . getElementById ( 'detail-body-paywall' ) ;
const shade = document . querySelector ( '.shade' ) ;
window . setTimeout ( function ( ) {
let paywall = document . querySelector ( '.paywall-adagio' ) ;
let body _paywall = document . getElementById ( 'detail-body-paywall' ) ;
let shade = document . querySelector ( '.shade' ) ;
removeDOMElement ( paywall , body _paywall , shade ) ;
cons t hidden _bodies = document . querySelectorAll ( '.detail_body' ) ;
le t hidden _bodies = document . querySelectorAll ( '.detail_body' ) ;
for ( let hidden _body of hidden _bodies ) {
hidden _body . removeAttribute ( 'hidden' ) ;
hidden _body . setAttribute ( 'style' , 'display:block; max-height:auto; overflow:visible' ) ;
}
} , 1000 ) ; // Delay (in milliseconds)
}
else if ( matchDomain ( 'faz.net' ) ) {
@ -874,6 +890,7 @@ else if (matchDomain('faz.net')) {
elem . innerText = p _text ;
article _text . appendChild ( elem ) ;
} ) ;
ext _api . runtime . sendMessage ( { csDone : true } ) ;
}
} )
}
@ -950,6 +967,8 @@ else if (matchDomain('historyextra.com')) {
}
let ad _banner = document . querySelector ( '.ad-banner-container' ) ;
removeDOMElement ( ad _banner ) ;
if ( ad _banner )
csDone = true ;
}
else if ( matchDomain ( 'republic.ru' ) ) {
@ -984,7 +1003,7 @@ else if (matchDomain('inkl.com')) {
removeDOMElement ( shared _banner ) ;
let dive _deeper _summary _bodies = document . querySelectorAll ( 'div.dive-deeper-container div.summary-body' ) ;
if ( dive _deeper _summary _bodies ) {
for ( summary _body of dive _deeper _summary _bodies ) {
for ( let summary _body of dive _deeper _summary _bodies ) {
if ( ! summary _body . querySelector ( 'a' ) ) {
var ng _click = summary _body . getAttribute ( 'ng-click' ) . replace ( "showArticle('" , '' ) . replace ( "')" , '' ) ;
var weblink = document . createElement ( 'a' ) ;
@ -1407,7 +1426,8 @@ else if (matchDomain("elpais.com")) {
else if ( matchDomain ( "slate.com" ) ) {
let slate _roadblock = document . querySelector ( '.slate-roadblock' ) ;
removeDOMElement ( slate _roadblock ) ;
let ads = document . querySelectorAll ( 'section[class*="-ad"]' ) ;
removeDOMElement ( slate _roadblock , ... ads ) ;
}
else if ( matchDomain ( [ "ilrestodelcarlino.it" , "quotidiano.net" ] ) ) {
@ -1509,7 +1529,8 @@ else if (matchDomain("gva.be")) {
bullet _link . innerText = bullet _link . href ;
par _elem . appendChild ( par _li ) ;
}
} else if ( key === 'streamone' ) {
}
else if ( key === 'streamone' ) {
if ( ! streamone ) {
let streamone _script = document . createElement ( 'script' ) ;
streamone _script . setAttribute ( 'src' , "https://shared.mediahuis.be/videoplayers/mediahuis/video-theoplayer.js?v=20201111T131002" ) ;
@ -1581,6 +1602,7 @@ else if (matchDomain("hs.fi")) {
window . location . href = iframe . src ;
} , 500 ) ; // Delay (in milliseconds)
}
csDone = true ;
} else {
let paywall = document . querySelector ( '.paywall-container' ) ;
if ( paywall ) {
@ -1653,6 +1675,7 @@ else if (matchDomain("hs.fi")) {
main . appendChild ( document . createElement ( 'br' ) ) ;
}
removeDOMElement ( paywall ) ;
csDone = true ;
}
}
}
@ -1716,6 +1739,7 @@ else if (matchDomain("elperiodico.com")) {
let subscr _section = document . querySelector ( 'div[amp-access="logged"]' ) ;
if ( subscr _section )
subscr _section . removeAttribute ( 'amp-access-hide' ) ;
csDone = true ;
}
}
}
@ -1725,6 +1749,8 @@ else if (matchDomain('la-croix.com')) {
if ( ! url . includes ( 'la-croix.com/amp/' ) ) {
let paywall _host _param = document . querySelector ( '#paywall-host-param' ) ;
removeDOMElement ( paywall _host _param ) ;
if ( paywall _host _param )
csDone = true ;
} else {
let paywall _block = document . querySelector ( '#paywall_block' ) ;
removeDOMElement ( paywall _block ) ;
@ -1761,6 +1787,12 @@ else if (matchDomain('esprit.presse.fr')) {
removeDOMElement ( paywall ) ;
}
else
csDone = true ;
if ( csDone )
ext _api . runtime . sendMessage ( { csDone : true } ) ;
// General Functions
function removeDOMElement ( ... elements ) {
for ( let element of elements ) {