@vacantthinker/firefox-addon-framework-easy 2026.527.1212 → 2026.527.2043
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/README.md +2 -0
- package/package.json +1 -1
- package/src/opTab.js +19 -3
package/README.md
CHANGED
|
@@ -105,6 +105,8 @@ export async function tabOpCreate(urlOrArgs) { }
|
|
|
105
105
|
|
|
106
106
|
export async function tabOpCreateNormal(urlOrArgs) { }
|
|
107
107
|
|
|
108
|
+
export async function tabOpCreateByWindow(url) { }
|
|
109
|
+
|
|
108
110
|
export async function tabOpRemove(tabId) { }
|
|
109
111
|
|
|
110
112
|
export async function tabOpHide(tabId) { }
|
package/package.json
CHANGED
package/src/opTab.js
CHANGED
|
@@ -51,7 +51,6 @@ export async function tabOpReload(tabId) {
|
|
|
51
51
|
* @returns {Promise<(browser.tabs.Tab & {tabId: number})>}
|
|
52
52
|
*/
|
|
53
53
|
export async function tabOpCreate(urlOrArgs) {
|
|
54
|
-
try {
|
|
55
54
|
/**
|
|
56
55
|
* @type {browser.tabs._CreateCreateProperties}
|
|
57
56
|
*/
|
|
@@ -66,8 +65,6 @@ export async function tabOpCreate(urlOrArgs) {
|
|
|
66
65
|
Object.assign(urlOrArgs, source);
|
|
67
66
|
let tab = await browser.tabs.create(urlOrArgs);
|
|
68
67
|
return tabOpEnhance(tab)
|
|
69
|
-
} catch (e) {
|
|
70
|
-
}
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
/**
|
|
@@ -88,6 +85,25 @@ export async function tabOpCreateNormal(urlOrArgs) {
|
|
|
88
85
|
return tabOpEnhance(tab)
|
|
89
86
|
}
|
|
90
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Creates a normal tab using either a URL string or a properties object.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} url
|
|
92
|
+
* @returns {Promise<(browser.tabs.Tab & {tabId: number})>}
|
|
93
|
+
*/
|
|
94
|
+
export async function tabOpCreateByWindow(url) {
|
|
95
|
+
// If it's a string, wrap it in an object
|
|
96
|
+
if (typeof url === 'string') {
|
|
97
|
+
let window = await browser.windows.create({
|
|
98
|
+
url
|
|
99
|
+
});
|
|
100
|
+
let tab = window.tabs.shift();
|
|
101
|
+
return tabOpEnhance(tab)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
91
107
|
/**
|
|
92
108
|
*
|
|
93
109
|
* @param tabId{number}
|