Bug 1845017 - Disable the TestPHCExhaustion test r=glandium
[gecko.git] / browser / components / syncedtabs / sidebar.js
blobbf65bd96d56c33572628d2e06f922e93b109a0bf
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 const { SyncedTabs } = ChromeUtils.importESModule(
8   "resource://services-sync/SyncedTabs.sys.mjs"
9 );
10 const { SyncedTabsDeckComponent } = ChromeUtils.importESModule(
11   "resource:///modules/syncedtabs/SyncedTabsDeckComponent.sys.mjs"
14 var syncedTabsDeckComponent = new SyncedTabsDeckComponent({
15   window,
16   SyncedTabs,
17 });
19 let onLoaded = () => {
20   window.top.MozXULElement.insertFTLIfNeeded("browser/syncedTabs.ftl");
21   window.top.document
22     .getElementById("SyncedTabsSidebarContext")
23     .querySelectorAll("[data-lazy-l10n-id]")
24     .forEach(el => {
25       el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
26       el.removeAttribute("data-lazy-l10n-id");
27     });
28   syncedTabsDeckComponent.init();
29   document
30     .getElementById("template-container")
31     .appendChild(syncedTabsDeckComponent.container);
34 let onUnloaded = () => {
35   removeEventListener("DOMContentLoaded", onLoaded);
36   removeEventListener("unload", onUnloaded);
37   syncedTabsDeckComponent.uninit();
40 addEventListener("DOMContentLoaded", onLoaded);
41 addEventListener("unload", onUnloaded);