Backed out 11 changesets (bug 1915762) for causing node failures in gecko.d.ts CLOSED TREE

Backed out changeset 5c7edcb3b105 (bug 1915762)
Backed out changeset 05691232a461 (bug 1915762)
Backed out changeset 964a29c9a07a (bug 1915762)
Backed out changeset 5d74e419e249 (bug 1915762)
Backed out changeset 677c35e884d3 (bug 1915762)
Backed out changeset 8a7b0b87a0ef (bug 1915762)
Backed out changeset 5e38449cd4d9 (bug 1915762)
Backed out changeset ec8a0553d97a (bug 1915762)
Backed out changeset fb2232e5f3b5 (bug 1915762)
Backed out changeset b290501f5832 (bug 1915762)
Backed out changeset 9955e42e749b (bug 1915762)
This commit is contained in:
Cristian Tuns
2025-04-22 22:15:19 -04:00
parent 2b6e70239f
commit a9d8f21da6
50 changed files with 1714 additions and 1040 deletions

View File

@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { Target } from "chrome://remote/content/cdp/targets/Target.sys.mjs";
const lazy = {};
@@ -12,6 +14,13 @@ ChromeUtils.defineESModuleGetters(lazy, {
TabSession: "chrome://remote/content/cdp/sessions/TabSession.sys.mjs",
});
XPCOMUtils.defineLazyServiceGetter(
lazy,
"Favicons",
"@mozilla.org/browser/favicon-service;1",
"nsIFaviconService"
);
/**
* Target for a local tab or a remoted frame.
*/
@@ -83,6 +92,19 @@ export class TabTarget extends Target {
return null;
}
/** @returns {Promise<string|null>} */
get faviconUrl() {
return new Promise(resolve => {
lazy.Favicons.getFaviconURLForPage(this.browser.currentURI, url => {
if (url) {
resolve(url.spec);
} else {
resolve(null);
}
});
});
}
get title() {
return this.browsingContext.currentWindowGlobal.documentTitle;
}