Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser(firefox): do not wait for initial navigation in default context #937

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser_patches/firefox/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1027
1028
14 changes: 10 additions & 4 deletions browser_patches/firefox/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -1450,10 +1450,10 @@ index 0000000000000000000000000000000000000000..66f61d432f9ad2f50931b780ec5ea0e3
+this.NetworkObserver = NetworkObserver;
diff --git a/testing/juggler/TargetRegistry.js b/testing/juggler/TargetRegistry.js
new file mode 100644
index 0000000000000000000000000000000000000000..d660fc4747cadfb85a55184d59b28f96a6bd2af4
index 0000000000000000000000000000000000000000..2b1a1bd0f931d82824a86ecbb46f86483177a4e0
--- /dev/null
+++ b/testing/juggler/TargetRegistry.js
@@ -0,0 +1,208 @@
@@ -0,0 +1,214 @@
+const {EventEmitter} = ChromeUtils.import('resource://gre/modules/EventEmitter.jsm');
+const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js');
+const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
Expand Down Expand Up @@ -1489,7 +1489,12 @@ index 0000000000000000000000000000000000000000..d660fc4747cadfb85a55184d59b28f96
+ for (const tab of this._mainWindow.gBrowser.tabs)
+ this._createTargetForTab(tab);
+ this._mainWindow.gBrowser.tabContainer.addEventListener('TabOpen', event => {
+ this._createTargetForTab(event.target);
+ const target = this._createTargetForTab(event.target);
+ // If we come here, content will have juggler script from the start,
+ // and we should wait for initial navigation, unless the tab was window.open'ed.
+ target._waitForInitialNavigation = !event.target.linkedBrowser.hasContentOpener;
+ // For pages created before we attach to them, we don't wait for initial
+ // navigation (target._waitForInitialNavigation is false by default).
+ });
+ this._mainWindow.gBrowser.tabContainer.addEventListener('TabClose', event => {
+ const tab = event.target;
Expand Down Expand Up @@ -1581,6 +1586,7 @@ index 0000000000000000000000000000000000000000..d660fc4747cadfb85a55184d59b28f96
+ ];
+
+ this._contentReadyPromise = new Promise(f => this._contentReadyCallback = f);
+ this._waitForInitialNavigation = false;
+
+ if (browserContext && browserContext.options.viewport)
+ this.setViewportSize(browserContext.options.viewport.viewportSize);
Expand Down Expand Up @@ -1610,7 +1616,7 @@ index 0000000000000000000000000000000000000000..d660fc4747cadfb85a55184d59b28f96
+ this._contentReadyCallback();
+ return {
+ browserContextOptions: this._browserContext ? this._browserContext.options : {},
+ waitForInitialNavigation: !this._tab.linkedBrowser.hasContentOpener,
+ waitForInitialNavigation: this._waitForInitialNavigation,
+ sessionIds
+ };
+ }
Expand Down