mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 03:22:05 -08:00
Fix frame execution contexts leak
- Prevents the creation of execution contexts in frames on content-document-global-created. - Also fixes input events not working in Playwright
This commit is contained in:
parent
a78c5a2d91
commit
f8f868307a
2 changed files with 11 additions and 9 deletions
|
|
@ -292,7 +292,7 @@ Miscellaneous (WebGl spoofing, battery status, etc)
|
|||
- Custom implementation of Playwright for the latest Firefox
|
||||
- Various config patches to evade bot detection
|
||||
- Removed leaking Playwright patches:
|
||||
- Fixes `content-document-global-created` observer leak
|
||||
- Fixes frame execution context leaks
|
||||
- Fixes `navigator.webdriver` detection
|
||||
- Removed potentially leaking anti-zoom/meta viewport handling patches
|
||||
- Re-enable fission content isolation
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class FrameTree {
|
|||
frame._pendingNavigationId = helper.toProtocolNavigationId(loadIdentifier);
|
||||
this.emit(FrameTree.Events.NavigationStarted, frame);
|
||||
}, 'juggler-navigation-started-renderer'),
|
||||
helper.addObserver(this._onDOMWindowCreated.bind(this), 'content-document-global-created'),
|
||||
helper.addObserver(this._onDOMWindowCreated.bind(this), 'juggler-dom-window-reused'),
|
||||
helper.addObserver((browsingContext, topic, why) => {
|
||||
this._onBrowsingContextAttached(browsingContext);
|
||||
|
|
@ -558,20 +559,21 @@ class Frame {
|
|||
}
|
||||
|
||||
_onGlobalObjectCleared() {
|
||||
// Causing leaks.
|
||||
const webSocketService = this._frameTree._webSocketEventService;
|
||||
if (this._webSocketListenerInnerWindowId && webSocketService.hasListenerFor(this._webSocketListenerInnerWindowId))
|
||||
webSocketService.removeListener(this._webSocketListenerInnerWindowId, this._webSocketListener);
|
||||
this._webSocketListenerInnerWindowId = this.domWindow().windowGlobalChild.innerWindowId;
|
||||
webSocketService.addListener(this._webSocketListenerInnerWindowId, this._webSocketListener);
|
||||
// Camoufox: Causes leaks.
|
||||
// for (const context of this._worldNameToContext.values())
|
||||
// this._runtime.destroyExecutionContext(context);
|
||||
// this._worldNameToContext.clear();
|
||||
|
||||
for (const context of this._worldNameToContext.values())
|
||||
this._runtime.destroyExecutionContext(context);
|
||||
this._worldNameToContext.clear();
|
||||
|
||||
this._worldNameToContext.set('', this._runtime.createExecutionContext(this.domWindow(), this.domWindow(), {
|
||||
frameId: this._frameId,
|
||||
name: '',
|
||||
}));
|
||||
// this._worldNameToContext.set('', this._runtime.createExecutionContext(this.domWindow(), this.domWindow(), {
|
||||
// frameId: this._frameId,
|
||||
// name: '',
|
||||
// }));
|
||||
for (const [name, world] of this._frameTree._isolatedWorlds) {
|
||||
if (name)
|
||||
this._createIsolatedContext(name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue