fix: remove window.stop() from page.setContent() implementation (#26886)

The call was added back in 2019 to stop network loading. See commit:
56a48559c2

However, there's no evidence that this call is needed any more:
- all the tests pass without it
- `window.stop()` behavior is poorly defined, so relying on it is
unfortunate.

The `window.stop()` call, however, causes trouble while rolling firefox:
under certain condititions, the call prevents document from firing the
`load` event in the `document.open().write(..).close()` sequence that
comes immediately after the call. While this does look like a bug in
Firefox itself, we failed to reproduce it in isolation.

For the reference, the following tests fail with the Firefox 116 (using
`PWTEST_TRACE=1` triggers the race condition somewhere):

```bash
PWTEST_TRACE=1 npm run ftest cli-codegen
```
This commit is contained in:
Andrey Lushnikov 2023-09-06 11:02:38 -07:00 committed by GitHub
parent b4012df160
commit 9105a20ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -896,7 +896,6 @@ export class Frame extends SdkObject {
});
});
const contentPromise = context.evaluate(({ html, tag }) => {
window.stop();
document.open();
console.debug(tag); // eslint-disable-line no-console
document.write(html);