microsoft / microsoft/playwright
[Bug]: Edge 152 crashes during download after relaunching a persistent profile; bundled Chromium 151 succeeds
- Dominant language
- TypeScript
- Stars
- 96.3k
- Forks
- 6.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 180
Description
### Version
1.62.0 (Python)
### Steps to reproduce
Self-contained Python reproduction (no external website or dependencies beyond Playwright). Save as mre.py; use only a disposable profile.
```python
import argparse
from pathlib import Path
from playwright.sync_api import sync_playwright
parser = argparse.ArgumentParser()
parser.add_argument('--browser', default='msedge')
parser.add_argument('--profile', required=True)
parser.add_argument('--output', required=True)
args = parser.parse_args()
with sync_playwright() as p:
options = {'channel': 'msedge'} if args.browser == 'msedge' else {}
context = p.chromium.launch_persistent_context(
args.profile, headless=False, accept_downloads=True, **options
)
print('VERSION', context.browser.version, flush=True)
context.on('close', lambda _: print('CONTEXT_CLOSED', flush=True))
try:
page = context.pages[0]
page.set_content('download')
with page.expect_download(timeout=15000) as event:
page.locator('a').click(timeout=15000)
print('DOWNLOAD_EVENT', flush=True)
event.value.save_as(args.output)
assert Path(args.output).read_bytes() == b'local-test-only'
print('SAVE_VERIFIED', flush=True)
finally:
context.close()
```
Run twice in separate Python processes from PowerShell, with Playwright 1.62.0 and installed Edge:
```powershell
$probeRoot = Join-Path $env:TEMP ('edge-mre-' + [guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Path $probeRoot | Out-Null
$env:DEBUG = 'pw:browser'
python .\mre.py --browser msedge --profile "$probeRoot\profile" --output "$probeRoot\saved-1.txt"
python .\mre.py --browser msedge --profile "$probeRoot\profile" --output "$probeRoot\saved-2.txt"
```
The same profile is reused; the output filename differs. downloads_path is omitted. For the control, repeat with a NEW probeRoot and --browser chromium in both commands (bundled Chromium must be installed). The code above is the baseline path of the tested reproducer, with optional diagnostic branches removed.
### Expected behavior
Both invocations should save the text file successfully when reusing a persistent profile.
### Actual behavior
Edge 152.0.4191.53 succeeds on the first launch with a fresh persistent profile, but exits during the download on the second launch using that profile. No output file is saved on run 2. Bundled Chromium 151.0.7922.34 saves the expected 15 bytes on both launches.
Sanitized excerpt from the ordinary-PowerShell Edge run-2 log:
```text
VERSION 152.0.4191.53
CONTEXT_CLOSED
DOWNLOAD_EVENT
playwright._impl._errors.TargetClosedError: Download.save_as: Target page, context or browser has been closed
```
The native exit code is 0xC0000005. The close/download ordering above is as observed in the merged log. The save_as exception is where Python observes failure, not proof that save_as initiates the native crash. No faulting native module or stack is available.
### Additional context
This was reproduced on one Windows machine, including independently from ordinary PowerShell outside the agent's restricted execution environment. No application/site logic, authentication, user-supplied browser flags, personal profile, or file-moving code is required. Playwright's default launch arguments remain in effect.
Isolation results (fresh disposable profile for each scenario):
| Condition | First launch | Second launch |
| --- | --- | --- |
| Edge, same profile, new output filenames, default downloads path | Pass | Exit 0xC0000005 |
| Edge, same profile, new explicit downloads/output directories | Pass | Exit 0xC0000005 |
| Edge, fresh profile each time, same output path | Pass | Pass |
| Chromium 151, same profile | Pass | Pass |
| Edge, download.path() instead of save_as() | Bytes verified | Exit 0xC0000005 |
| Edge, locally mocked HTTP attachment instead of data URL | Pass | Exit 0xC0000005 |
| Edge, headless=True | Pass | Exit 0xC0000005 |
| Edge, no path/save_as call; page.wait_for_timeout(20000) after event | Browser stays alive | Browser stays alive |
The idle test verifies survival only, not completed download bytes. The baseline Edge/Chromium comparison was confirmed in ordinary PowerShell; additional isolation cases ran in the agent execution environment.
I have not tested Edge 151 itself or a second machine. Chromium 151 is not an equivalent Edge-version control. I am reporting the reproducible scenario, not claiming a confirmed Edge 152 regression or assigning the cause to Playwright rather than Edge/machine configuration. Is there an additional diagnostic that would help identify the native failure?
### Environment
```shell
Manually collected for the Python reproducer (not npx envinfo):
OS: Windows 11, build 26200
Python: 3.13.2 (Anaconda distribution, 64-bit)
Playwright Python: 1.62.0
Microsoft Edge: 152.0.4191.53 (channel="msedge")
Bundled Chromium: 151.0.7922.34
Execution: local ordinary PowerShell; separate Python processes; disposable persistent profiles
```
Contributor guide
Research direction
Start with the supplied mre.py and its launch_persistent_context entry point; run the two-process Edge reproduction with DEBUG=pw:browser and compare it with the Chromium control. Done means identifying a useful diagnostic or a reproducible Playwright-side failure boundary, since the report does not name a project file or test to change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100