@vacantthinker/firefox-addon-framework-easy 2026.608.855 → 2026.608.1034
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/package.json +1 -1
- package/src/browserTab.js +14 -7
- package/src/opTab.js +8 -5
- package/src/servicePure.js +1 -1
package/package.json
CHANGED
package/src/browserTab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
import {browserNotificationCreate} from './browserNotification.js';
|
|
4
|
-
import {tabOpCreateNear, tabOpRemove} from './opTab.js';
|
|
4
|
+
import {tabOpCreateNear, tabOpGet, tabOpRemove} from './opTab.js';
|
|
5
5
|
|
|
6
6
|
export async function browserTabSendMessage(tabId, message) {
|
|
7
7
|
await browser.tabs.sendMessage(tabId, message);
|
|
@@ -62,14 +62,21 @@ export async function browserTabCreateToDownload(message) {
|
|
|
62
62
|
* @returns {Promise<void>}
|
|
63
63
|
*/
|
|
64
64
|
export async function browserTabCreateNearSendMessageToContentJs(message) {
|
|
65
|
-
let {title, url} = message;
|
|
66
|
-
await browserNotificationCreate(`new tab! ${title || url}`);
|
|
67
|
-
|
|
68
|
-
let {focusNewTab} = message;
|
|
69
65
|
let properties = {
|
|
70
|
-
url
|
|
71
|
-
active: focusNewTab || false,
|
|
66
|
+
url: message.url,
|
|
72
67
|
};
|
|
68
|
+
if (message.tabId) {
|
|
69
|
+
let tabId = message.tabId;
|
|
70
|
+
try {
|
|
71
|
+
await tabOpGet(tabId);
|
|
72
|
+
Object.assign(properties, {tabId});
|
|
73
|
+
} catch (e) {
|
|
74
|
+
delete message.tabId;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (message.focusNewTab) {
|
|
78
|
+
Object.assign(properties, {active: message.focusNewTab});
|
|
79
|
+
}
|
|
73
80
|
|
|
74
81
|
let {tabId} = await tabOpCreateNear(properties);
|
|
75
82
|
browser.tabs.onUpdated.addListener(
|
package/src/opTab.js
CHANGED
|
@@ -26,11 +26,14 @@ export async function tabOpCreate(properties) {
|
|
|
26
26
|
* @returns {Promise<(browser.tabs.Tab & {tabId: number})>}
|
|
27
27
|
*/
|
|
28
28
|
export async function tabOpCreateNear(properties) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
if (properties.tabId) {
|
|
30
|
+
let tabPrev = await tabOpGet(properties.tabId);
|
|
31
|
+
delete properties.tabId;
|
|
32
|
+
Object.assign(properties, {
|
|
33
|
+
index: tabPrev.index + 1,
|
|
34
|
+
openerTabId: tabPrev.id,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
34
37
|
|
|
35
38
|
let tab = await tabOpCreate(properties);
|
|
36
39
|
return tabOpEnhance(tab);
|
package/src/servicePure.js
CHANGED
|
@@ -35,7 +35,7 @@ export function servicePurePlaylistVideolinkYTB(videolinkOrigin) {
|
|
|
35
35
|
const u = new URL(videolinkOrigin);
|
|
36
36
|
let playlistId = u.searchParams.get('list');
|
|
37
37
|
|
|
38
|
-
let prefix =
|
|
38
|
+
let prefix = 'https://www.youtube.com/playlist?list=';
|
|
39
39
|
let playlistVideolink = `${prefix}${playlistId}`;
|
|
40
40
|
const ret = {playlistVideolink, playlistId};
|
|
41
41
|
return ret;
|