|
7 | 7 | this.#waitAndCleanup();
|
8 | 8 | }
|
9 | 9 |
|
10 |
| - #glanceTabs = {}; |
11 | 10 | promiseInitialized = new Promise((resolve) => {
|
12 | 11 | this._resolveInitialized = resolve;
|
13 | 12 | });
|
|
34 | 33 | if (tabData.zenPinnedEntry) {
|
35 | 34 | tab.setAttribute('zen-pinned-entry', tabData.zenPinnedEntry);
|
36 | 35 | }
|
37 |
| - if (tabData.zenGlanceId) { |
38 |
| - // We just found the background used for glance. Find |
39 |
| - // the current |
40 |
| - if (tabData.zenIsGlance) { |
41 |
| - if (this.#glanceTabs[tabData.zenGlanceId]) { |
42 |
| - this.#glanceTabs[tabData.zenGlanceId].tab = tab; |
43 |
| - } else { |
44 |
| - this.#glanceTabs[tabData.zenGlanceId] = { |
45 |
| - tab: tab, |
46 |
| - background: null, |
47 |
| - }; |
48 |
| - } |
49 |
| - } else { |
50 |
| - if (this.#glanceTabs[tabData.zenGlanceId]) { |
51 |
| - this.#glanceTabs[tabData.zenGlanceId].background = tab; |
52 |
| - } else { |
53 |
| - this.#glanceTabs[tabData.zenGlanceId] = { |
54 |
| - tab: null, |
55 |
| - background: tab, |
56 |
| - }; |
57 |
| - } |
58 |
| - } |
59 |
| - } |
60 |
| - } |
61 |
| - |
62 |
| - async #resolveGlanceTabs() { |
63 |
| - for (const [id, data] of Object.entries(this.#glanceTabs)) { |
64 |
| - const { tab, background } = data; |
65 |
| - // TODO(Restore glance tab): Finish this implementation |
66 |
| - continue; |
67 |
| - |
68 |
| - if (!tab || !background) { |
69 |
| - tab?.removeAttribute('glance-id'); |
70 |
| - background?.removeAttribute('glance-id'); |
71 |
| - continue; |
72 |
| - } |
73 |
| - console.log(tab, background); |
74 |
| - const browserRect = gBrowser.tabbox.getBoundingClientRect(); |
75 |
| - await gZenGlanceManager.openGlance( |
76 |
| - { |
77 |
| - url: undefined, |
78 |
| - clientX: browserRect.width / 2, |
79 |
| - clientY: browserRect.height / 2, |
80 |
| - width: 0, |
81 |
| - height: 0, |
82 |
| - }, |
83 |
| - tab, |
84 |
| - background |
85 |
| - ); |
86 |
| - } |
87 | 36 | }
|
88 | 37 |
|
89 | 38 | async #waitAndCleanup() {
|
90 | 39 | await SessionStore.promiseAllWindowsRestored;
|
91 |
| - await this.#resolveGlanceTabs(); |
| 40 | + await SessionStore.promiseInitialized; |
92 | 41 | this.#cleanup();
|
93 | 42 | }
|
94 | 43 |
|
95 | 44 | #cleanup() {
|
96 | 45 | this._resolveInitialized();
|
97 |
| - delete window.gZenSessionStore; |
98 | 46 | }
|
99 | 47 | }
|
100 | 48 |
|
|
0 commit comments