#463·Scrapling

StealthyFetcher fails to launch from an elevated shell on Windows: extra --disable-features replaces driver's list (drops AutoDeElevate)

Author: dimension-zeroCreated Sep 27, 2026Updated Sep 27, 2026

Summary

StealthySession / StealthyFetcher fail to launch on Windows when the Python process runs elevated (administrator):

patchright._impl._errors.TargetClosedError: BrowserType.launch_persistent_context: Target page, context or browser has been closed

Cause

Playwright/patchright launch Chromium with their own --disable-features=... list, which includes AutoDeElevate. STEALTH_ARGS in scrapling/engines/constants.py adds a second switch:

--disable-features=AudioServiceOutOfProcess,TranslateUI,BlinkGenPropertyTrees

Chromium honours only one --disable-features switch, so this replaces the driver's list. With AutoDeElevate no longer disabled, Chromium started from an elevated process relaunches itself de-elevated and the original process exits, which the driver reports as TargetClosedError.

Confirmed by launching patchright directly with Scrapling's browser options and removing arguments one at a time: any extra --disable-features=<anything> reproduces the failure, and a single merged --disable-features= list that includes AutoDeElevate launches fine.

Reproduce

From an elevated (administrator) shell on Windows:

python
from scrapling.fetchers import StealthyFetcher
StealthyFetcher.fetch("https://example.com", headless=True)

Workaround

python
StealthyFetcher.fetch("https://example.com", headless=True, extra_flags=["--do-not-de-elevate"])

Suggested fix

Merge Scrapling's disabled features into the driver's list (or drop the separate --disable-features switch) instead of passing a second one.

Environment

  • Windows 11
  • scrapling 0.4.15
  • patchright 1.63.0 (Chromium revision 1243)
  • Python 3.14