Bug 1877838: Add URLs to tab preview cards for about: pages r=dwalker,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D211287
This commit is contained in:
Jeremy Swinarton 2024-05-23 13:48:27 +00:00
parent e7fd7f8a7c
commit 03a3324687

View file

@ -50,6 +50,9 @@ export default class TabHoverPreviewPanel {
getPrettyURI(uri) {
try {
const url = new URL(uri);
if (url.protocol === "about:") {
return url.href;
}
return `${url.hostname}`.replace(/^w{3}\./, "");
} catch {
return uri;