diff --git a/remote/cdp/targets/TabTarget.jsm b/remote/cdp/targets/TabTarget.jsm index 8b0dbb70a60e..ecc23d57b287 100644 --- a/remote/cdp/targets/TabTarget.jsm +++ b/remote/cdp/targets/TabTarget.jsm @@ -13,6 +13,7 @@ const { XPCOMUtils } = ChromeUtils.import( XPCOMUtils.defineLazyModuleGetters(this, { RemoteAgent: "chrome://remote/content/components/RemoteAgent.jsm", + TabManager: "chrome://remote/content/shared/TabManager.jsm", TabSession: "chrome://remote/content/cdp/sessions/TabSession.jsm", Target: "chrome://remote/content/cdp/targets/Target.jsm", }); @@ -37,6 +38,10 @@ class TabTarget extends Target { this.browser = browser; + // The tab target uses a unique id as shared with WebDriver to reference + // a specific tab. + this.id = TabManager.getIdForBrowser(browser); + // Define the HTTP path to query this target this.path = `/devtools/page/${this.id}`;