Fix-update Sacramento Bee (amp for premium)
This commit is contained in:
parent
db995dc603
commit
6cc37ecaea
@ -133,7 +133,7 @@ Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywall
|
||||
[The Seattle Times](https://www.seattletimes.com) -
|
||||
[The News-Gazette](https://www.news-gazette.com) -
|
||||
[The Philadelphia Inquirer](https://www.inquirer.com) -
|
||||
[The Sacramento Bee](https://www.sacbee.com)* -
|
||||
[The Sacramento Bee](https://www.sacbee.com) -
|
||||
[Winston-Salem Journal](https://www.journalnow.com)
|
||||
|
||||
#### Australia/New Zealand
|
||||
|
@ -199,6 +199,7 @@ var blockedRegexes = {
|
||||
'nytimes.com': /(.+meter-svc\.nytimes\.com\/meter\.js.+|.+mwcm\.nyt\.com\/.+\.js)/,
|
||||
'nzherald.co.nz': /nzherald\.co\.nz\/.+\/headjs\/.+\.js/,
|
||||
'repubblica.it': /scripts\.repubblica\.it\/pw\/pw\.js.+/,
|
||||
'sacbee.com': /cdn\.ampproject\.org\/v\d\/amp-subscriptions-.+\.js/,
|
||||
'science-et-vie.com': /.+\.qiota\.com\/.+/,
|
||||
'sciencesetavenir.fr': /.+\.poool\.fr\/.+/,
|
||||
'scmp.com': /.+\.tinypass\.com\/.+/,
|
||||
|
@ -1026,6 +1026,30 @@ else if (matchDomain("discovermagazine.com")) {
|
||||
removeDOMElement(banner);
|
||||
}
|
||||
|
||||
else if (matchDomain("sacbee.com")) {
|
||||
let url = window.location.href;
|
||||
if (url.includes('account.sacbee.com/paywall/')) {
|
||||
window.setTimeout(function () {
|
||||
window.location.href = 'https://amp.sacbee.com/article' + url.split('resume=')[1].split('#')[0] + '.html';
|
||||
}, 500); // Delay (in milliseconds)
|
||||
} else if (url.includes('amp.sacbee.com')) {
|
||||
let subscr_sections = document.querySelectorAll('div[subscriptions-section="content"]');
|
||||
for (let subscr_section of subscr_sections) {
|
||||
subscr_section.removeAttribute('subscriptions-section');
|
||||
}
|
||||
let subscr_tag = document.querySelector('div#subscriber-exclusive-tag');
|
||||
let amp_players = document.querySelectorAll('amp-connatix-player');
|
||||
removeDOMElement(subscr_tag, ...amp_players);
|
||||
}
|
||||
let premium_svgs = document.querySelectorAll('h3 > a > svg');
|
||||
let premium_link;
|
||||
for (let premium_svg of premium_svgs) {
|
||||
premium_link = premium_svg.parentElement;
|
||||
if (premium_link.href.includes('www.'))
|
||||
premium_link.href = premium_link.href.replace('www.', 'amp.');
|
||||
}
|
||||
}
|
||||
|
||||
// General Functions
|
||||
function removeDOMElement(...elements) {
|
||||
for (let element of elements) {
|
||||
|
@ -290,5 +290,5 @@
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
"version": "1.8.3.0"
|
||||
"version": "1.8.3.1"
|
||||
}
|
||||
|
@ -21,5 +21,5 @@
|
||||
"page": "options.html"
|
||||
},
|
||||
"permissions": [ "cookies", "<all_urls>", "storage", "webRequest", "webRequestBlocking"],
|
||||
"version": "1.8.3.0"
|
||||
"version": "1.8.3.1"
|
||||
}
|
||||
|
2
sites.js
2
sites.js
@ -170,7 +170,7 @@ var defaultSites =
|
||||
"The New Yorker": "newyorker.com",
|
||||
"The News-Gazette": "news-gazette.com",
|
||||
"The Philadelphia Inquirer": "inquirer.com",
|
||||
"The Sacramento Bee (free articles only)": "sacbee.com",
|
||||
"The Sacramento Bee": "sacbee.com",
|
||||
"The Saturday Paper": "thesaturdaypaper.com.au",
|
||||
"The Seattle Times": "seattletimes.com",
|
||||
"The Spectator": "spectator.co.uk",
|
||||
|
Loading…
x
Reference in New Issue
Block a user