From 2f570407105bfd942a69c2a2b15f1ef720f1fd0a Mon Sep 17 00:00:00 2001 From: daijro Date: Tue, 13 Aug 2024 06:24:53 -0500 Subject: [PATCH] Experimental observer leak fix Juggler will no longer notify content-document-global-created. This patch also reverses the _Runtime domain rename fix due to Playwright breakage. This was causing leaks with some WAFs. --- README.md | 2 +- additions/juggler/content/FrameTree.js | 1 - additions/juggler/protocol/Protocol.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e02289b..465468f 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,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 `Runtime` domain detection + - Fixes `content-document-global-created` observer leak - Fixes `navigator.webdriver` detection - Removed potentially leaking anti-zoom/meta viewport handling patches - Re-enable fission content isolation diff --git a/additions/juggler/content/FrameTree.js b/additions/juggler/content/FrameTree.js index 2d59b3c..55c52fb 100644 --- a/additions/juggler/content/FrameTree.js +++ b/additions/juggler/content/FrameTree.js @@ -68,7 +68,6 @@ 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); diff --git a/additions/juggler/protocol/Protocol.js b/additions/juggler/protocol/Protocol.js index e1ccc73..6c9b700 100644 --- a/additions/juggler/protocol/Protocol.js +++ b/additions/juggler/protocol/Protocol.js @@ -577,7 +577,7 @@ const Network = { }, }; -const _Runtime = { +const Runtime = { targets: ['page'], types: runtimeTypes, events: {