php8.4 and new dom api

This commit is contained in:
Renan Bernordi 2025-11-10 01:40:27 -03:00
parent 0f3ce251e2
commit 9a4678fba3
2 changed files with 102 additions and 181 deletions

View file

@ -204,23 +204,6 @@ return [
'scriptTagRemove' => 'zephr',
'classElementRemove' => 'zephr'
],
'economist.com' => [
'cookies' => [
'ec_limit' => 'allow'
],
'scriptTagRemove' => ['wrapperMessagingWithoutDetection.js'],
'customCode' => '
var artBodyContainer = document.querySelector("article.article");
var artBody = artBodyContainer.innerHTML;
checkPaywall();
function checkPaywall() {
let paywallBox = document.querySelector(".layout-article-regwall");
if (paywallBox) {
artBodyContainer.innerHTML = artBody;
}
}
'
],
'nytimes.com' => [
'idElementRemove' => ['gateway-content', 'site-index', 'complianceOverlay'],
'customCode' => '
@ -722,41 +705,5 @@ return [
}, 1000);
})
'
],
// Test domain
'altendorfme.github.io' => [
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'headers' => [
'Accept-Language' => 'en-US,en;q=0.9',
'Cache-Control' => 'no-cache',
'Pragma' => 'no-cache'
],
'proxy' => true,
'idElementRemove' => ['test-id-1', 'paywall'],
'classElementRemove' => ['test-class-1'],
'scriptTagRemove' => ['analytics.js', 'test-script.js', 'paywall.js'],
'cookies' => [
'visited' => 'true',
'consent' => 'accepted',
'session_id' => null
],
'classAttrRemove' => ['test-attr-1', 'paywall'],
'customCode' => '
console.log("worked");
',
'customStyle' => '
.test-style {
background: red;
}
',
'excludeGlobalRules' => [
'scriptTagRemove' => ['excluded-script.js'],
'classElementRemove' => ['excluded-class']
],
'fetchStrategies' => 'fetchContent',
'socialReferrers' => true,
'fromGoogleBot' => true,
'removeElementsByTag' => ['iframe'],
'removeCustomAttr' => ['data-*']
]
];