Fix National Geographic USA

This commit is contained in:
magnolia1234 2021-06-27 09:56:22 +02:00
parent c3266f164c
commit 1e78c6a9bf
5 changed files with 15 additions and 9 deletions

View File

@ -1016,9 +1016,9 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
// fix blocked referer // fix blocked referer
if (!header_referer) { if (!header_referer) {
if (typeof browser !== 'object') if (typeof browser !== 'object')
header_referer = details.initiator; header_referer = details.initiator ? details.initiator : '';
else else
header_referer = details.originUrl; header_referer = details.originUrl ? details.originUrl : '';
} }
// remove cookies for sites medium platform (custom domains) // remove cookies for sites medium platform (custom domains)
@ -1231,7 +1231,7 @@ if (matchUrlDomain(change_headers, details.url) && (['main_frame', 'sub_frame',
if (tabId !== -1) { if (tabId !== -1) {
ext_api.tabs.get(tabId, function (currentTab) { ext_api.tabs.get(tabId, function (currentTab) {
if ((currentTab && isSiteEnabled(currentTab)) || medium_custom_domain || au_apn_site || au_swm_site) { if ((currentTab && isSiteEnabled(currentTab) && !(matchUrlDomain('nationalgeographic.com', currentTabUrl) && !header_referer)) || medium_custom_domain || au_apn_site || au_swm_site) {
if (currentTab.url !== currentTabUrl) { if (currentTab.url !== currentTabUrl) {
csDone = false; csDone = false;
currentTabUrl = currentTab.url; currentTabUrl = currentTab.url;

View File

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Chrome Changelog Bypass Paywalls Clean - Chrome
Post-release Post-release
Fix National Geographic USA
Remove Finance.si (obsolete) Remove Finance.si (obsolete)
Fix blocked referer Fix blocked referer
Update custom sites (set useragent Bingbot) Update custom sites (set useragent Bingbot)

View File

@ -193,7 +193,7 @@ else {
if (par.reference.includes('https://omny.fm/') || par.reference.includes('https://docdro.id/')) { if (par.reference.includes('https://omny.fm/') || par.reference.includes('https://docdro.id/')) {
article = article + '<embed src="' + par.reference + '" style="height:500px; width:100%" frameborder="0"></embed>'; article = article + '<embed src="' + par.reference + '" style="height:500px; width:100%" frameborder="0"></embed>';
} else { } else {
article = article + 'Embed: ' + '<a href="' + par.reference + '" target="_blank">' + par.reference + '</a>'; article = article + 'Embed: ' + '<a href="' + par.reference + '" target="_blank">' + par.reference.split('?')[0] + '</a>';
console.log('embed: ' + par.reference); console.log('embed: ' + par.reference);
} }
} else if (par.kind === 'unordered-list') { } else if (par.kind === 'unordered-list') {
@ -1247,13 +1247,13 @@ else if (matchDomain(nl_mediahuis_region_domains)) {
par_elem = ''; par_elem = '';
par_key = par[key]; par_key = par[key];
if (key === 'subhead') { if (key === 'subhead') {
par_elem = document.createElement('strong'); par_html = parser.parseFromString('<div><strong>' + par_key + '</strong></div>', 'text/html');
par_elem.innerText = par_key; par_elem = par_html.querySelector('div');
} else if (key === 'twitter' || key === 'instagram') { } else if (key === 'twitter' || key === 'instagram') {
par_elem = document.createElement('a'); par_elem = document.createElement('a');
Object.assign(par_elem, { Object.assign(par_elem, {
href: par_key, href: par_key,
innerText: par_key, innerText: par_key.split('?')[0],
target: '_blank' target: '_blank'
}); });
} else if (key === 'youtube') { } else if (key === 'youtube') {
@ -1923,6 +1923,11 @@ else if (matchDomain('historyextra.com')) {
removeDOMElement(ad_banner); removeDOMElement(ad_banner);
} }
else if (matchDomain(['houstonchronicle.com', 'sfchronicle.com'])) {
let wrapper = document.querySelector('.belowMastheadWrapper');
removeDOMElement(wrapper);
}
else if (matchDomain('inkl.com')) { else if (matchDomain('inkl.com')) {
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
let menu_btn = document.querySelector('div.left-buttons-container button.menu-btn'); let menu_btn = document.querySelector('div.left-buttons-container button.menu-btn');

View File

@ -30,5 +30,5 @@
"webRequestBlocking", "webRequestBlocking",
"<all_urls>" "<all_urls>"
], ],
"version": "2.2.6.3" "version": "2.2.6.4"
} }

View File

@ -516,5 +516,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.2.6.3" "version": "2.2.6.4"
} }