@vacantthinker/firefox-addon-framework-easy 2026.622.1927 → 2026.622.2000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/opTab.d.ts +7 -7
- package/dist/opTab.d.ts.map +1 -1
- package/dist/opTab.js +20 -2
- package/package.json +1 -1
package/dist/opTab.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare function tabOpCreateByWindow(url: string): Promise<EnhancedTab |
|
|
|
35
35
|
/**
|
|
36
36
|
* Retrieves details about the specified tab.
|
|
37
37
|
*/
|
|
38
|
-
export declare function tabOpGet(tabId: number): Promise<browser.tabs.Tab>;
|
|
38
|
+
export declare function tabOpGet(tabId: number | undefined): Promise<browser.tabs.Tab | undefined>;
|
|
39
39
|
/**
|
|
40
40
|
* Retrieves all tabs across all windows.
|
|
41
41
|
*/
|
|
@@ -65,26 +65,26 @@ export declare function tabOpQueryUrlThenRemove(url: string): Promise<void>;
|
|
|
65
65
|
* @param tabId The tab ID to reload.
|
|
66
66
|
* @param bypassCache Whether to bypass the cache.
|
|
67
67
|
*/
|
|
68
|
-
export declare function tabOpReload(tabId: number, bypassCache?: boolean): Promise<void>;
|
|
68
|
+
export declare function tabOpReload(tabId: number | undefined, bypassCache?: boolean): Promise<void>;
|
|
69
69
|
/**
|
|
70
70
|
* Closes one or more tabs.
|
|
71
71
|
*/
|
|
72
|
-
export declare function tabOpRemove(tabId: number | number[]): Promise<void>;
|
|
72
|
+
export declare function tabOpRemove(tabId: number | number[] | undefined): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* Hides one or more tabs.
|
|
75
75
|
*/
|
|
76
|
-
export declare function tabOpHide(tabId: number | number[]): Promise<number[]>;
|
|
76
|
+
export declare function tabOpHide(tabId: number | number[] | undefined): Promise<number[] | undefined>;
|
|
77
77
|
/**
|
|
78
78
|
* Modifies the properties of a tab.
|
|
79
79
|
*/
|
|
80
|
-
export declare function tabOpUpdate(tabId: number, updateProperties: browser.tabs._UpdateUpdateProperties): Promise<EnhancedTab>;
|
|
80
|
+
export declare function tabOpUpdate(tabId: number | undefined, updateProperties: browser.tabs._UpdateUpdateProperties): Promise<EnhancedTab | undefined>;
|
|
81
81
|
/**
|
|
82
82
|
* Updates a tab to be inactive and muted.
|
|
83
83
|
*/
|
|
84
|
-
export declare function tabOpUpdateActiveFalse(tabId: number): Promise<EnhancedTab>;
|
|
84
|
+
export declare function tabOpUpdateActiveFalse(tabId: number | undefined): Promise<EnhancedTab | undefined>;
|
|
85
85
|
/**
|
|
86
86
|
* Focuses the window containing the tab, then highlights and activates the tab.
|
|
87
87
|
*/
|
|
88
|
-
export declare function tabOpFocus(tabId: number): Promise<EnhancedTab>;
|
|
88
|
+
export declare function tabOpFocus(tabId: number | undefined): Promise<EnhancedTab | undefined>;
|
|
89
89
|
export {};
|
|
90
90
|
//# sourceMappingURL=opTab.d.ts.map
|
package/dist/opTab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opTab.d.ts","sourceRoot":"","sources":["../src/opTab.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,WACf,SAAQ,OAAO,CAAC,IAAI,CAAC,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,WAAW,GAAG,IAAI,CAGtE;
|
|
1
|
+
{"version":3,"file":"opTab.d.ts","sourceRoot":"","sources":["../src/opTab.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,WACf,SAAQ,OAAO,CAAC,IAAI,CAAC,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,WAAW,GAAG,IAAI,CAGtE;AA6BD;;GAEG;AACH,wBAAsB,WA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MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhF;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxE;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrD;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAGnG;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,uBAAuB,GACrD,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAMlC;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAMxG;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAe5F"}
|
package/dist/opTab.js
CHANGED
|
@@ -21,6 +21,8 @@ async function _create(properties) {
|
|
|
21
21
|
* Internal helper to unify tab updates.
|
|
22
22
|
*/
|
|
23
23
|
async function _update(tabId, properties) {
|
|
24
|
+
if (tabId == undefined)
|
|
25
|
+
return;
|
|
24
26
|
const tab = await browser.tabs.update(tabId, properties);
|
|
25
27
|
const enhanced = tabOpEnhance(tab);
|
|
26
28
|
if (!enhanced)
|
|
@@ -60,8 +62,10 @@ export async function tabOpCreateNear(options) {
|
|
|
60
62
|
if (previousTabId !== undefined) {
|
|
61
63
|
try {
|
|
62
64
|
const previousTab = await tabOpGet(previousTabId);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
if (previousTab) {
|
|
66
|
+
properties.index = previousTab.index + 1;
|
|
67
|
+
properties.openerTabId = previousTab.id;
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
catch {
|
|
67
71
|
}
|
|
@@ -82,6 +86,8 @@ export async function tabOpCreateByWindow(url) {
|
|
|
82
86
|
* Retrieves details about the specified tab.
|
|
83
87
|
*/
|
|
84
88
|
export async function tabOpGet(tabId) {
|
|
89
|
+
if (tabId == undefined)
|
|
90
|
+
return;
|
|
85
91
|
return await browser.tabs.get(tabId);
|
|
86
92
|
}
|
|
87
93
|
/**
|
|
@@ -160,36 +166,48 @@ export async function tabOpQueryUrlThenRemove(url) {
|
|
|
160
166
|
* @param bypassCache Whether to bypass the cache.
|
|
161
167
|
*/
|
|
162
168
|
export async function tabOpReload(tabId, bypassCache = false) {
|
|
169
|
+
if (tabId == undefined)
|
|
170
|
+
return;
|
|
163
171
|
await browser.tabs.reload(tabId, { bypassCache });
|
|
164
172
|
}
|
|
165
173
|
/**
|
|
166
174
|
* Closes one or more tabs.
|
|
167
175
|
*/
|
|
168
176
|
export async function tabOpRemove(tabId) {
|
|
177
|
+
if (tabId == undefined)
|
|
178
|
+
return;
|
|
169
179
|
await browser.tabs.remove(tabId);
|
|
170
180
|
}
|
|
171
181
|
/**
|
|
172
182
|
* Hides one or more tabs.
|
|
173
183
|
*/
|
|
174
184
|
export async function tabOpHide(tabId) {
|
|
185
|
+
if (tabId == undefined)
|
|
186
|
+
return;
|
|
175
187
|
return await browser.tabs.hide(tabId);
|
|
176
188
|
}
|
|
177
189
|
/**
|
|
178
190
|
* Modifies the properties of a tab.
|
|
179
191
|
*/
|
|
180
192
|
export async function tabOpUpdate(tabId, updateProperties) {
|
|
193
|
+
if (tabId == undefined)
|
|
194
|
+
return;
|
|
181
195
|
return _update(tabId, updateProperties);
|
|
182
196
|
}
|
|
183
197
|
/**
|
|
184
198
|
* Updates a tab to be inactive and muted.
|
|
185
199
|
*/
|
|
186
200
|
export async function tabOpUpdateActiveFalse(tabId) {
|
|
201
|
+
if (tabId == undefined)
|
|
202
|
+
return;
|
|
187
203
|
return _update(tabId, { active: false, muted: true });
|
|
188
204
|
}
|
|
189
205
|
/**
|
|
190
206
|
* Focuses the window containing the tab, then highlights and activates the tab.
|
|
191
207
|
*/
|
|
192
208
|
export async function tabOpFocus(tabId) {
|
|
209
|
+
if (tabId == undefined)
|
|
210
|
+
return;
|
|
193
211
|
const tab = await tabOpGet(tabId);
|
|
194
212
|
if (!tab || typeof tab.windowId !== 'number') {
|
|
195
213
|
throw new Error(`Tab ${tabId} not found or has no window.`);
|