Bug 1646289 - [CDP] Share unique TabTarget id with WebDriver. r=webdriver-reviewers,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D139316
This commit is contained in:
Henrik Skupin 2022-02-22 18:08:35 +00:00
Родитель 1122860dcd
Коммит 59bcc5d5fb
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -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}`;