fix playwright._impl._errors.TargetClosedError: Target page, context or browser has been closed on Windows #259
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.
Fix #221
The main issue is that Chromium on Windows is built with
chrome_multiple_dll=0
, which does not support the--single-process
flag. This leads to failures when attempting to run Chromium in a single process mode on Windows, the browser crashes immediately after launch.Fix:
If the platform is Windows, the
--single-process
flag will be automatically disabled to ensure compatibility. On non-Windows platforms, the flag will still be used as expected.Testing Results:
Tested on my fork, and the following outcomes were observed:
--single-process
is disabled, and Chromium runs without issues.--single-process
works as expected, with no failures.All relevant test have passed successfully in both environments.