mirror of
https://gitlab.com/magnolia1234/bypass-paywalls-firefox-clean.git
synced 2024-11-10 06:07:47 +01:00
Fix ET Prime (mobile epaper)
This commit is contained in:
parent
c311523c1d
commit
be7009a35b
6 changed files with 47 additions and 20 deletions
|
@ -626,7 +626,7 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function (details) {
|
|||
|
||||
// economictimes redirect
|
||||
ext_api.webRequest.onBeforeRequest.addListener(function (details) {
|
||||
if (!isSiteEnabled(details)) {
|
||||
if (!isSiteEnabled(details) || details.url.includes('.com/epaper/')) {
|
||||
return;
|
||||
}
|
||||
var updatedUrl = details.url.split('?')[0].replace('economictimes.indiatimes.com', 'm.economictimes.com');
|
||||
|
|
|
@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox
|
|||
Post-release
|
||||
Add Cellesche Zeitung
|
||||
Add DvhN.nl
|
||||
Fix ET Prime (mobile epaper)
|
||||
Fix Fd.nl (search)
|
||||
Fix Statista (outlook)
|
||||
Fix StuDocu
|
||||
|
@ -20,7 +21,7 @@ Fix Vogue Business
|
|||
Remove Repubblica.it (fix obsolete)
|
||||
Remove Republic.ru (fix obsolete)
|
||||
Update custom sites (default block cookies)
|
||||
Update popup (Google Mobile-Friendly tool)
|
||||
Update popup (Google Search Tool)
|
||||
|
||||
* v3.0.0.0 (2023-01-08)
|
||||
Add Deutscher Fachverlag Mediengruppe (opt-in to custom sites)
|
||||
|
|
|
@ -275,7 +275,7 @@ else {
|
|||
comments = document.querySelector('#story-comments, .comments-wrapper');
|
||||
} else if (window.location.search.match(/(\?|&)amp/)) {
|
||||
amp_unhide_subscr_section(amp_ads_sel, true, true, '.newscdn.com.au');
|
||||
comments = document.querySelector('#comments-load');
|
||||
comments = document.querySelector('#comments-load, .comments-module');
|
||||
let amp_iframe_sizers = document.querySelectorAll('amp-iframe > i-amphtml-sizer');
|
||||
removeDOMElement(...amp_iframe_sizers)
|
||||
}
|
||||
|
@ -2992,6 +2992,8 @@ else if (matchDomain('economictimes.com')) {
|
|||
let content = document.querySelector('.paywall[style="display:none;"]');
|
||||
if (content)
|
||||
content.setAttribute('style', 'display:block;');
|
||||
else
|
||||
window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname.replace('amp_prime', 'prime');
|
||||
let intro = document.querySelector('.art_wrap');
|
||||
let article_blocker = document.querySelector('.articleBlocker');
|
||||
let amp_ads = document.querySelectorAll('amp-ad');
|
||||
|
@ -3002,11 +3004,17 @@ else if (matchDomain('economictimes.com')) {
|
|||
let paywall = document.querySelector('div#blocker_layer');
|
||||
let data_prime = document.querySelector('div[data-prime="1"]');
|
||||
let amphtml = document.querySelector('link[rel="amphtml"]');
|
||||
if ((paywall || data_prime) && amphtml) {
|
||||
if (paywall || data_prime) {
|
||||
removeDOMElement(paywall);
|
||||
if (data_prime)
|
||||
data_prime.removeAttribute('data-prime');
|
||||
if (amphtml)
|
||||
window.location.href = amphtml.href;
|
||||
else if (window.location.pathname.startsWith('/epaper/'))
|
||||
window.location.href = 'https://economictimes.indiatimes.com' + window.location.pathname;
|
||||
} else {
|
||||
let ads = document.querySelectorAll('.adContainer');
|
||||
removeDOMElement(...ads);
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
|
|
@ -190,11 +190,6 @@
|
|||
"block_regex": "\\.irishexaminer\\.com\\/pu_examiner\\/scripts\\/engage",
|
||||
"domain": "irishexaminer.com"
|
||||
},
|
||||
"Kaleva.fi": {
|
||||
"allow_cookies": 1,
|
||||
"domain": "kaleva.fi",
|
||||
"useragent": "googlebot"
|
||||
},
|
||||
"Kapital.no": {
|
||||
"allow_cookies": 1,
|
||||
"domain": "kapital.no",
|
||||
|
|
|
@ -723,5 +723,5 @@
|
|||
"*://*.wallkit.net/*",
|
||||
"*://webcache.googleusercontent.com/*"
|
||||
],
|
||||
"version": "3.0.1.4"
|
||||
"version": "3.0.1.5"
|
||||
}
|
||||
|
|
|
@ -62,12 +62,14 @@ function showArchiveLinks() {
|
|||
active: true,
|
||||
currentWindow: true
|
||||
}, function (tabs) {
|
||||
if (tabs && tabs[0] && tabs[0].url && tabs[0].url.startsWith('http')) {
|
||||
let url = encodeURIComponent(tabs[0].url.split('?')[0]);
|
||||
if (tabs && tabs[0] && /^http/.test(tabs[0].url)) {
|
||||
let url = tabs[0].url.split('?')[0];
|
||||
let url_enc = encodeURIComponent(url);
|
||||
let hostname = urlHost(url);
|
||||
let archive_array = {
|
||||
'Archive.today': 'https://archive.today?run=1&url=' + url,
|
||||
'Google webcache': 'https://webcache.googleusercontent.com/search?q=cache:' + url,
|
||||
'Google Mobile-Friendly Tool\n(use online html-viewer - no fix)': 'https://search.google.com/test/mobile-friendly?url=' + url
|
||||
'Archive.today': 'https://archive.today?run=1&url=' + url_enc,
|
||||
'Google webcache': 'https://webcache.googleusercontent.com/search?q=cache:' + url_enc,
|
||||
'Google Search Tool\n(use online html-viewer - no fix)': 'https://search.google.com/test/rich-results?url=' + url_enc
|
||||
};
|
||||
let archive_id = document.querySelector('span#archive');
|
||||
if (archive_id) {
|
||||
|
@ -76,6 +78,7 @@ function showArchiveLinks() {
|
|||
let elem_div = document.createElement('div');
|
||||
let elem = document.createElement('a');
|
||||
elem.innerText = key;
|
||||
if (!(matchDomain(['google.com', 'googleusercontent.com'], hostname) || hostname.match(/^archive\.\w{2}$/))) {
|
||||
elem.href = archive_array[key];
|
||||
elem.target = '_blank';
|
||||
elem_div.appendChild(elem);
|
||||
|
@ -83,10 +86,30 @@ function showArchiveLinks() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
showArchiveLinks();
|
||||
|
||||
function matchDomain(domains, hostname = window.location.hostname) {
|
||||
let matched_domain = false;
|
||||
if (typeof domains === 'string')
|
||||
domains = [domains];
|
||||
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
|
||||
return matched_domain;
|
||||
}
|
||||
|
||||
function urlHost(url) {
|
||||
if (/^http/.test(url)) {
|
||||
try {
|
||||
return new URL(url).hostname;
|
||||
} catch (e) {
|
||||
console.log(`url not valid: ${url} error: ${e}`);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
function closeButton() {
|
||||
window.close();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue