mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									b4012df160
								
							
						
					
					
						commit
						9105a20ac4
					
				| @ -896,7 +896,6 @@ export class Frame extends SdkObject { | |||||||
|           }); |           }); | ||||||
|         }); |         }); | ||||||
|         const contentPromise = context.evaluate(({ html, tag }) => { |         const contentPromise = context.evaluate(({ html, tag }) => { | ||||||
|           window.stop(); |  | ||||||
|           document.open(); |           document.open(); | ||||||
|           console.debug(tag);  // eslint-disable-line no-console
 |           console.debug(tag);  // eslint-disable-line no-console
 | ||||||
|           document.write(html); |           document.write(html); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andrey Lushnikov
						Andrey Lushnikov