diff --git a/changelog.txt b/changelog.txt index 1417317..80348dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Changelog Bypass Paywalls Clean - Firefox Post-release Add Diario de Ibiza/Mallorca, Faro de Vigo & La Provincia (Spain) Add Le Un (France) +Fix-update Stratfor (style; not menu) * v2.0.6.0 (2021-01-31) Add Griffith Review (Australia) diff --git a/contentScript.js b/contentScript.js index 3d3c74a..3f84138 100644 --- a/contentScript.js +++ b/contentScript.js @@ -2009,12 +2009,27 @@ else if (matchDomain('elmercurio.com')) { }, 1000); // Delay (in milliseconds) } -else if (matchDomain('stratfor.com')) { +else if (matchDomain('stratfor.com') && window.location.href.match(/((\w)+(\-)+){3,}/)) { let banner = document.querySelector('.free-cta-container'); removeDOMElement(banner); - let css_link = document.querySelector('link[rel="stylesheet"]:not([href="/assets/worldview.d6b47e5305e05acb0c45.css"])'); - if (css_link) - css_link.href = '/assets/worldview.d6b47e5305e05acb0c45.css'; + let css_link = document.querySelector('link[rel="stylesheet"]'); + if (css_link && !css_link.getAttribute('style')) { + css_link.setAttribute('style', 'done'); + url = 'https://' + new URL(window.location.href).hostname; + fetch(url) + .then(response => { + if (response.ok) { + response.text().then(html => { + var parser = new DOMParser(); + var doc = parser.parseFromString(html, 'text/html'); + let css_home = doc.querySelector('link[rel="stylesheet"]'); + if (css_home) { + css_link.href = css_home.href; + } + }); + } + }); + } let hidden_images = document.querySelectorAll('img[src^="data:image/gif"][data-src]'); for (let hidden_image of hidden_images) hidden_image.setAttribute('src', hidden_image.getAttribute("data-src")); diff --git a/manifest.json b/manifest.json index ac04074..1ff6cb8 100644 --- a/manifest.json +++ b/manifest.json @@ -451,5 +451,5 @@ "*://*.userzoom.com/*", "*://*.wsj.net/*" ], - "version": "2.0.6.2" + "version": "2.0.6.3" } \ No newline at end of file