fune/browser/components/firefoxview/firefoxview.mjs
Shane Hughes 9c7a1ae2e1 Bug 1821826 - Refactor FeatureCallout to support generic triggers. r=omc-reviewers,fxview-reviewers,tabbrowser-reviewers,dao,jprickett,sclements
Also disable the Firefox View feature tour to avoid any risk of
regressions. The feature tour code will be removed in a later patch.
It's still present for now for testing purposes.

Differential Revision: https://phabricator.services.mozilla.com/D180927
2023-07-11 16:00:40 +00:00

28 lines
1.1 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
window.addEventListener("DOMContentLoaded", async () => {
Services.telemetry.setEventRecordingEnabled("firefoxview", true);
Services.telemetry.recordEvent("firefoxview", "entered", "firefoxview", null);
document.getElementById("recently-closed-tabs-container").onLoad();
// If Firefox View was reloaded by the user, force syncing of tabs
// to get the most up to date synced tabs.
if (
performance
.getEntriesByType("navigation")
.map(nav => nav.type)
.includes("reload")
) {
await document.getElementById("tab-pickup-container").onReload();
}
});
window.addEventListener("unload", () => {
const tabPickupList = document.querySelector("tab-pickup-list");
if (tabPickupList) {
tabPickupList.cleanup();
}
document.getElementById("tab-pickup-container").cleanup();
document.getElementById("recently-closed-tabs-container").cleanup();
});