diff --git a/changelog.txt b/changelog.txt index 0d204d3..eeab95f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Fix Freitag.de (text-break) Fix La Segunda Fix LeParisien.fr (amp-redirect) Fix NzHerald (xhr) +Fix The West Australian (timing) * v3.4.4.0 (2023-11-26) Add Freitag.de diff --git a/contentScript.js b/contentScript.js index e22303a..c93bd68 100644 --- a/contentScript.js +++ b/contentScript.js @@ -449,21 +449,19 @@ else { } else { // Australian Seven West Media if (matchDomain('thewest.com.au') || document.querySelector('li > a[href*=".sevenwestmedia.com.au"]')) { - window.setTimeout(function () { - let breach_screen = document.querySelector('div.paywall div[data-testid*="BreachScreen"], div[class*="StyledBreachWallContent"]'); - if (breach_screen) { - let scripts = document.querySelectorAll('script:not([src]):not([type])'); - let json_script; - for (let script of scripts) { - if (script.text.includes('window.PAGE_DATA =')) { - json_script = script; - break; - } + function thewest_main(node) { + let scripts = document.querySelectorAll('script:not([src]):not([type])'); + let json_script; + for (let script of scripts) { + if (script.text.includes('window.PAGE_DATA =')) { + json_script = script; + break; } - if (json_script) { - let json_text = json_script.text.split('window.PAGE_DATA =')[1].split('