Restore stealth plugin and fix fetcher language configuration#1247
Open
clementbiron wants to merge 17 commits into
Open
Restore stealth plugin and fix fetcher language configuration#1247clementbiron wants to merge 17 commits into
clementbiron wants to merge 17 commits into
Conversation
Ndpnt
reviewed
May 27, 2026
Ndpnt
reviewed
May 27, 2026
This reverts commit 3dc2c10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR reactivates
puppeteer-extra-plugin-stealthin the full DOM fetcher. Since v10.3.1 (commit5e4945d2),puppeteer.use(stealthPlugin(...))was called insidefetch()instead of beforepuppeteer.launch(), sopuppeteer-extranever bound itsonPageCreatedhooks and the plugin was silently inert.navigator.webdriverandHeadlessChromewere exposed to every tracked service for around four months.It also applies the
@opentermsarchive/engine.fetcher.languageconfiguration tonavigator.languageandnavigator.languagesthrough the stealth sub-evasions, not just theAccept-LanguageHTTP header that was already affected. The stealth wrapper'slocaleoption was being silently ignored. The redundantsetExtraHTTPHeadersand CDPNetwork.setUserAgentOverridecalls inconfigurePageare removed: they duplicated stealth's path with subtly different results.Breaking: quality factors (
;q=...) are no longer accepted in@opentermsarchive/engine.fetcher.language. Previously accepted values such asen-IE,en-GB;q=0.9,en;q=0.8now throw atlaunchHeadlessBrowser. Combined with the now-removedsetExtraHTTPHeaderscall, those values used to produce malformed headers likeq=0.9;q=0.9, and the surface area was not worth preserving. Provide a plain comma-separated priority list instead (e.g.en-IE,en-GB,en); the browser derives theAccept-Languagequality factors from tag order.As a side effect of applying the configuration to
navigator.languages,language: "en"now exposesnavigator.languagesas["en"]instead of the previous default["en-US", "en"]. Settinglanguage: "en-US,en"restores the previous default.