From c77464575e2a8c2950a8ab7b4cac506e445882bc Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Mon, 26 Jul 2021 20:02:44 +0200 Subject: [PATCH] Fix custom sites (no useragent/referer on restart) Plus fix El Mercurio (timing) --- background.js | 1 + changelog.txt | 2 ++ contentScript.js | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/background.js b/background.js index 3cb980e6..01d09d70 100644 --- a/background.js +++ b/background.js @@ -657,6 +657,7 @@ ext_api.storage.local.get({ } } + change_headers = use_google_bot.concat(use_bing_bot, use_facebook_referer, use_google_referer, use_twitter_referer, use_random_ip); disableJavascriptOnListedSites(); }); diff --git a/changelog.txt b/changelog.txt index 2ee9f84a..162d29cd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Changelog Bypass Paywalls Clean - Firefox Post-release +Fix El Mercurio (timing) +Fix custom sites (no useragent/referer on restart) * v2.3.0.0 (2021-07-25) Add NHST Media Group (TradeWinds) diff --git a/contentScript.js b/contentScript.js index 2b115945..403be827 100644 --- a/contentScript.js +++ b/contentScript.js @@ -1525,13 +1525,15 @@ else if (matchDomain('elmercurio.com')) { let elem_hidden = document.querySelectorAll('[style="visibility:hidden"]'); for (let elem of elem_hidden) elem.removeAttribute('style'); - let cont_articlelight = document.querySelector('div.cont_articlelight:not([style])'); - if (cont_articlelight) - cont_articlelight.setAttribute('style', 'height: 100% !important; width: 90% !important'); let page_pdf_content = document.querySelector('div.page_pdf_content'); let close_html = document.querySelector('div.close_html'); removeDOMElement(page_pdf_content, close_html) }, 1000); // Delay (in milliseconds) + window.setTimeout(function () { + let cont_articlelight = document.querySelector('div.cont_articlelight'); + if (cont_articlelight) + cont_articlelight.setAttribute('style', 'height: 100% !important; width: 90% !important'); + }, 3000); // Delay (in milliseconds) } else if (matchDomain('estadao.com.br')) {