Fix National Geographic USA

This commit is contained in:
magnolia1234 2021-06-27 09:56:42 +02:00
parent 8ef306d471
commit eabd121ec4
4 changed files with 14 additions and 8 deletions

View file

@ -1016,9 +1016,9 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
// fix blocked referer
if (!header_referer) {
if (typeof browser !== 'object')
header_referer = details.initiator;
header_referer = details.initiator ? details.initiator : '';
else
header_referer = details.originUrl;
header_referer = details.originUrl ? details.originUrl : '';
}
// 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) {
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) {
csDone = false;
currentTabUrl = currentTab.url;

View file

@ -2,6 +2,7 @@
Changelog Bypass Paywalls Clean - Firefox
Post-release
Fix National Geographic USA
Remove Finance.si (obsolete)
Fix blocked referer
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/')) {
article = article + '<embed src="' + par.reference + '" style="height:500px; width:100%" frameborder="0"></embed>';
} 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);
}
} else if (par.kind === 'unordered-list') {
@ -1247,13 +1247,13 @@ else if (matchDomain(nl_mediahuis_region_domains)) {
par_elem = '';
par_key = par[key];
if (key === 'subhead') {
par_elem = document.createElement('strong');
par_elem.innerText = par_key;
par_html = parser.parseFromString('<div><strong>' + par_key + '</strong></div>', 'text/html');
par_elem = par_html.querySelector('div');
} else if (key === 'twitter' || key === 'instagram') {
par_elem = document.createElement('a');
Object.assign(par_elem, {
href: par_key,
innerText: par_key,
innerText: par_key.split('?')[0],
target: '_blank'
});
} else if (key === 'youtube') {
@ -1923,6 +1923,11 @@ else if (matchDomain('historyextra.com')) {
removeDOMElement(ad_banner);
}
else if (matchDomain(['houstonchronicle.com', 'sfchronicle.com'])) {
let wrapper = document.querySelector('.belowMastheadWrapper');
removeDOMElement(wrapper);
}
else if (matchDomain('inkl.com')) {
document.addEventListener('DOMContentLoaded', () => {
let menu_btn = document.querySelector('div.left-buttons-container button.menu-btn');

View file

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