@vacantthinker/firefox-addon-framework-easy 2026.618.1242 → 2026.618.1419
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/{ContentJsYTB.d.ts → ContentJs.d.ts} +12 -9
- package/dist/ContentJs.d.ts.map +1 -0
- package/dist/{ContentJsYTB.js → ContentJs.js} +50 -29
- package/dist/backgroundJs.d.ts +12 -0
- package/dist/backgroundJs.d.ts.map +1 -0
- package/dist/backgroundJs.js +64 -0
- package/dist/browserNotification.d.ts +1 -12
- package/dist/browserNotification.d.ts.map +1 -1
- package/dist/browserNotification.js +5 -11
- package/dist/browserRuntime.d.ts +2 -2
- package/dist/browserRuntime.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/serviceCommon.d.ts +2 -1
- package/dist/serviceCommon.d.ts.map +1 -1
- package/dist/serviceCommon.js +5 -4
- package/dist/serviceOpJavascript.js +2 -2
- package/dist/types.d.ts +11 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ContentJsYTB.d.ts.map +0 -1
|
@@ -29,14 +29,6 @@ export declare function ctJsRandomSleep501_800(): Promise<void>;
|
|
|
29
29
|
* @returns {string} Normalized string representation of numbers, or "unknown".
|
|
30
30
|
*/
|
|
31
31
|
export declare function ctJsExtractVideoQualityFromText(text: string): string;
|
|
32
|
-
/**
|
|
33
|
-
* Establishes a persistent baseline connection with the background script to
|
|
34
|
-
* maintain runtime context.
|
|
35
|
-
*/
|
|
36
|
-
export declare function ctJskeepAlive(tag?: string, enableLog?: boolean): void;
|
|
37
|
-
export declare function ctJsCloseTab(): Promise<void>;
|
|
38
|
-
export declare function ctJsFocusTargetTab(targetTabId: number): Promise<void>;
|
|
39
|
-
export declare function ctJsRemoveDomainCache(domain: string): Promise<void>;
|
|
40
32
|
/**
|
|
41
33
|
* Executes a provided function once the DOM is ready.
|
|
42
34
|
* If the DOM is already ready, it executes immediately.
|
|
@@ -45,6 +37,17 @@ export declare function ctJsRemoveDomainCache(domain: string): Promise<void>;
|
|
|
45
37
|
*/
|
|
46
38
|
export declare function ctJsExecuteOnReady(fn: () => void | Promise<void>): Promise<void>;
|
|
47
39
|
export declare function ctJsOpenPage(url: string): Promise<void>;
|
|
40
|
+
export declare function ctJsRemoveDomainCache(domain: string): Promise<void>;
|
|
48
41
|
export declare function ctJsOpenPageKeepOnlyOne(url: string): Promise<void>;
|
|
49
42
|
export declare function ctJsHideElements(selectors: string[]): void;
|
|
50
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Establishes a persistent baseline connection with the background script to
|
|
45
|
+
* maintain runtime context.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ctJskeepAlive(tag?: string, enableLog?: boolean): void;
|
|
48
|
+
export declare function ctJsCloseTab(): Promise<void>;
|
|
49
|
+
export declare function ctJsRemoveCurrentTab(): Promise<void>;
|
|
50
|
+
export declare function ctJsFocusTargetTab(targetTabId: number): Promise<void>;
|
|
51
|
+
export declare function ctJsInfoToBackground(info: string): Promise<void>;
|
|
52
|
+
export declare function ctJsNotification(content: string): Promise<void>;
|
|
53
|
+
//# sourceMappingURL=ContentJs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentJs.d.ts","sourceRoot":"","sources":["../src/ContentJs.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,GAAE,MAAc,GAAG,IAAI,CAmCvG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,uBAAuB,kBAE5C;AAED,wBAAsB,sBAAsB,kBAE3C;AAGD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpE;AAGD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBtF;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,iBAE7C;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,iBAEzD;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,iBAExD;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAKnD;AAQD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAW,EAAE,SAAS,UAAO,QAU/D;AAED,wBAAsB,YAAY,kBAKjC;AAED,wBAAsB,oBAAoB,kBAKzC;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,iBAM3D;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,iBAGtD;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,iBAKrD"}
|
|
@@ -77,35 +77,6 @@ export function ctJsExtractVideoQualityFromText(text) {
|
|
|
77
77
|
const num = parseInt(text, 10);
|
|
78
78
|
return Number.isNaN(num) ? 'unknown' : num.toString();
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Establishes a persistent baseline connection with the background script to
|
|
82
|
-
* maintain runtime context.
|
|
83
|
-
*/
|
|
84
|
-
export function ctJskeepAlive(tag = "", enableLog = false) {
|
|
85
|
-
setInterval(async () => {
|
|
86
|
-
if (enableLog) {
|
|
87
|
-
console.log(tag, "br send message actMarco");
|
|
88
|
-
}
|
|
89
|
-
let message = { act: 'actMarco' };
|
|
90
|
-
await browserRuntimeSendMessage(message);
|
|
91
|
-
}, 1000);
|
|
92
|
-
}
|
|
93
|
-
export async function ctJsCloseTab() {
|
|
94
|
-
let message = {
|
|
95
|
-
act: 'actRemoveCurrentTab',
|
|
96
|
-
};
|
|
97
|
-
await browserRuntimeSendMessage(message);
|
|
98
|
-
}
|
|
99
|
-
export async function ctJsFocusTargetTab(targetTabId) {
|
|
100
|
-
const message = {
|
|
101
|
-
targetTabId,
|
|
102
|
-
act: 'actFocusTargetTab'
|
|
103
|
-
};
|
|
104
|
-
await browserRuntimeSendMessage(message);
|
|
105
|
-
}
|
|
106
|
-
export async function ctJsRemoveDomainCache(domain) {
|
|
107
|
-
await browserBrowsingDataRemoveDomainCache(domain);
|
|
108
|
-
}
|
|
109
80
|
/**
|
|
110
81
|
* Executes a provided function once the DOM is ready.
|
|
111
82
|
* If the DOM is already ready, it executes immediately.
|
|
@@ -130,6 +101,9 @@ export async function ctJsExecuteOnReady(fn) {
|
|
|
130
101
|
export async function ctJsOpenPage(url) {
|
|
131
102
|
await tabOpCreateActiveTrue({ url });
|
|
132
103
|
}
|
|
104
|
+
export async function ctJsRemoveDomainCache(domain) {
|
|
105
|
+
await browserBrowsingDataRemoveDomainCache(domain);
|
|
106
|
+
}
|
|
133
107
|
export async function ctJsOpenPageKeepOnlyOne(url) {
|
|
134
108
|
await tabOpCreateKeepOnlyOneFocusTrue(url);
|
|
135
109
|
}
|
|
@@ -139,3 +113,50 @@ export function ctJsHideElements(selectors) {
|
|
|
139
113
|
.forEach(ele => ele.hidden = true);
|
|
140
114
|
});
|
|
141
115
|
}
|
|
116
|
+
//-------------------------------------------------------------------------------
|
|
117
|
+
// -------------------------------------------------------------------------------
|
|
118
|
+
// -------------------------------------------------------------------------------
|
|
119
|
+
// -------------------------------------------------------------------------------
|
|
120
|
+
// -------------------------------------------------------------------------------
|
|
121
|
+
/**
|
|
122
|
+
* Establishes a persistent baseline connection with the background script to
|
|
123
|
+
* maintain runtime context.
|
|
124
|
+
*/
|
|
125
|
+
export function ctJskeepAlive(tag = "", enableLog = true) {
|
|
126
|
+
setInterval(async () => {
|
|
127
|
+
if (enableLog) {
|
|
128
|
+
console.log(tag, "br send message actMarco");
|
|
129
|
+
}
|
|
130
|
+
let message = { act: 'actMarco' };
|
|
131
|
+
await browserRuntimeSendMessage(message);
|
|
132
|
+
}, 1000);
|
|
133
|
+
}
|
|
134
|
+
export async function ctJsCloseTab() {
|
|
135
|
+
let message = {
|
|
136
|
+
act: 'actRemoveCurrentTab',
|
|
137
|
+
};
|
|
138
|
+
await browserRuntimeSendMessage(message);
|
|
139
|
+
}
|
|
140
|
+
export async function ctJsRemoveCurrentTab() {
|
|
141
|
+
let message = {
|
|
142
|
+
act: 'actRemoveCurrentTab',
|
|
143
|
+
};
|
|
144
|
+
await browserRuntimeSendMessage(message);
|
|
145
|
+
}
|
|
146
|
+
export async function ctJsFocusTargetTab(targetTabId) {
|
|
147
|
+
const message = {
|
|
148
|
+
targetTabId,
|
|
149
|
+
act: 'actFocusTargetTab'
|
|
150
|
+
};
|
|
151
|
+
await browserRuntimeSendMessage(message);
|
|
152
|
+
}
|
|
153
|
+
export async function ctJsInfoToBackground(info) {
|
|
154
|
+
const message = { act: "actInfo", info, };
|
|
155
|
+
await browserRuntimeSendMessage(message);
|
|
156
|
+
}
|
|
157
|
+
export async function ctJsNotification(content) {
|
|
158
|
+
const message = {
|
|
159
|
+
act: "actNotification", content,
|
|
160
|
+
};
|
|
161
|
+
await browserRuntimeSendMessage(message);
|
|
162
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MessageActionBaseOptions } from "./types";
|
|
2
|
+
export type ActHandlerFunc = (rest: any, tabId: number | undefined) => Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Uses <T extends string> so the app can pass its own union type.
|
|
5
|
+
* It defaults to FrameworkBaseAction if no type is passed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function bkJsCreateActionBaseHandlers<T extends string = MessageActionBaseOptions>(): Map<T, ActHandlerFunc>;
|
|
8
|
+
/**
|
|
9
|
+
* Dispatcher also accepts the generic map
|
|
10
|
+
*/
|
|
11
|
+
export declare function bkJsRegisterMessageDispatcher<T extends string>(handlersMap: Map<T, ActHandlerFunc>, logTag?: string): void;
|
|
12
|
+
//# sourceMappingURL=backgroundJs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backgroundJs.d.ts","sourceRoot":"","sources":["../src/backgroundJs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAGjD,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAErF;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,GAAG,wBAAwB,KACpF,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CA4BzB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,MAAM,EAC5D,WAAW,EAAE,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,EACnC,MAAM,GAAE,MAAyB,QAqBlC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// --- IN YOUR FRAMEWORK ---
|
|
2
|
+
import { browserTabSendMessageMarcoPolo } from "./browserTab";
|
|
3
|
+
import { tabOpFocus, tabOpReload, tabOpRemove } from "./opTab";
|
|
4
|
+
import { browserNotificationCreateBasicContent } from "./browserNotification";
|
|
5
|
+
/**
|
|
6
|
+
* Uses <T extends string> so the app can pass its own union type.
|
|
7
|
+
* It defaults to FrameworkBaseAction if no type is passed.
|
|
8
|
+
*/
|
|
9
|
+
export function bkJsCreateActionBaseHandlers() {
|
|
10
|
+
// We use `any` internally to set the map up without TS complaining,
|
|
11
|
+
// but we return the strictly typed generic Map.
|
|
12
|
+
const map = new Map();
|
|
13
|
+
map.set("actNotification", async (rest) => {
|
|
14
|
+
if (rest && rest.content) {
|
|
15
|
+
await browserNotificationCreateBasicContent(rest.content);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
map.set('actInfo', async (rest) => {
|
|
19
|
+
console.info('actInfo', rest);
|
|
20
|
+
});
|
|
21
|
+
map.set('actMarco', async (_rest, tabId) => {
|
|
22
|
+
if (tabId)
|
|
23
|
+
await browserTabSendMessageMarcoPolo(tabId);
|
|
24
|
+
});
|
|
25
|
+
map.set('actFocusTargetTab', async (rest) => {
|
|
26
|
+
if (rest)
|
|
27
|
+
await tabOpFocus(rest.targetTabId);
|
|
28
|
+
});
|
|
29
|
+
map.set('actReloadTargetTab', async (rest) => {
|
|
30
|
+
if (rest)
|
|
31
|
+
await tabOpReload(rest.targetTabId);
|
|
32
|
+
});
|
|
33
|
+
map.set('actRemoveCurrentTab', async (_rest, tabId) => {
|
|
34
|
+
if (tabId)
|
|
35
|
+
await tabOpRemove(tabId);
|
|
36
|
+
});
|
|
37
|
+
// Cast it to the consumer's type before returning
|
|
38
|
+
return map;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Dispatcher also accepts the generic map
|
|
42
|
+
*/
|
|
43
|
+
export function bkJsRegisterMessageDispatcher(handlersMap, logTag = "background.ts ") {
|
|
44
|
+
browser.runtime.onMessage.addListener(async (message, sender) => {
|
|
45
|
+
const { act, ...rest } = message;
|
|
46
|
+
if (!act)
|
|
47
|
+
return;
|
|
48
|
+
const tabId = sender?.tab?.id;
|
|
49
|
+
if (act !== "actMarco") {
|
|
50
|
+
console.info(logTag, act, `tabId=`, tabId);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
console.log(logTag, act, `tabId=`, tabId);
|
|
54
|
+
}
|
|
55
|
+
// Cast `act` to T so it can be used to query the Map
|
|
56
|
+
const handler = handlersMap.get(act);
|
|
57
|
+
if (handler) {
|
|
58
|
+
await handler(rest, tabId);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
console.warn(act, " not match!");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
message: string;
|
|
3
|
-
title?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function browserNotificationCreateBasicMessageOnly(message: string): Promise<string>;
|
|
6
|
-
/**
|
|
7
|
-
* Creates a browser notification with basic type,
|
|
8
|
-
* if title null use addon manifest name.
|
|
9
|
-
* @returns The notification identifier.
|
|
10
|
-
* @param notificationTwoOptions
|
|
11
|
-
*/
|
|
12
|
-
export declare function browserNotificationCreateBasicMessage(notificationTwoOptions: NotificationTwoOptions): Promise<string>;
|
|
1
|
+
export declare function browserNotificationCreateBasicContent(content: string): Promise<string>;
|
|
13
2
|
export declare function browserNotificationCreate(notificationOptions: browser.notifications.CreateNotificationOptions): Promise<string>;
|
|
14
3
|
//# sourceMappingURL=browserNotification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserNotification.d.ts","sourceRoot":"","sources":["../src/browserNotification.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"browserNotification.d.ts","sourceRoot":"","sources":["../src/browserNotification.ts"],"names":[],"mappings":"AAEA,wBAAsB,qCAAqC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB5F;AAED,wBAAsB,yBAAyB,CAC7C,mBAAmB,EAAE,OAAO,CAAC,aAAa,CAAC,yBAAyB,GACnE,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { browserRuntimeManifestName } from './browserRuntime';
|
|
2
|
-
export async function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Creates a browser notification with basic type,
|
|
7
|
-
* if title null use addon manifest name.
|
|
8
|
-
* @returns The notification identifier.
|
|
9
|
-
* @param notificationTwoOptions
|
|
10
|
-
*/
|
|
11
|
-
export async function browserNotificationCreateBasicMessage(notificationTwoOptions) {
|
|
2
|
+
export async function browserNotificationCreateBasicContent(content) {
|
|
3
|
+
const notification = ({
|
|
4
|
+
content: content,
|
|
5
|
+
});
|
|
12
6
|
const notificationOptions = {
|
|
13
7
|
message: "",
|
|
14
8
|
type: 'basic',
|
|
15
9
|
title: browserRuntimeManifestName()
|
|
16
10
|
};
|
|
17
11
|
const options = {
|
|
18
|
-
...notificationOptions, ...
|
|
12
|
+
...notificationOptions, ...notification
|
|
19
13
|
};
|
|
20
14
|
return await browserNotificationCreate(options);
|
|
21
15
|
}
|
package/dist/browserRuntime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessagePayloadAction } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Reloads the current extension.
|
|
4
4
|
*/
|
|
@@ -48,5 +48,5 @@ export declare function browserRuntimeManifestVersion(): string;
|
|
|
48
48
|
* @returns The extension name.
|
|
49
49
|
*/
|
|
50
50
|
export declare function browserRuntimeManifestName(): string;
|
|
51
|
-
export declare function browserRuntimeSendMessage(message:
|
|
51
|
+
export declare function browserRuntimeSendMessage(message: MessagePayloadAction): Promise<void>;
|
|
52
52
|
//# sourceMappingURL=browserRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserRuntime.d.ts","sourceRoot":"","sources":["../src/browserRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"browserRuntime.d.ts","sourceRoot":"","sources":["../src/browserRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,CAAC,GAAG,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAExF;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,oBAAoB,iBAG9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './backgroundJs';
|
|
1
2
|
export * from './BaseNumberKeyORM';
|
|
2
3
|
export * from './BaseORM';
|
|
3
4
|
export * from './BaseStringKeyORM';
|
|
@@ -6,7 +7,7 @@ export * from './browserDownload';
|
|
|
6
7
|
export * from './browserNotification';
|
|
7
8
|
export * from './browserRuntime';
|
|
8
9
|
export * from './browserTab';
|
|
9
|
-
export * from './
|
|
10
|
+
export * from './ContentJs';
|
|
10
11
|
export * from './opStorage';
|
|
11
12
|
export * from './opTab';
|
|
12
13
|
export * from './serviceCommon';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './backgroundJs';
|
|
1
2
|
export * from './BaseNumberKeyORM';
|
|
2
3
|
export * from './BaseORM';
|
|
3
4
|
export * from './BaseStringKeyORM';
|
|
@@ -6,7 +7,7 @@ export * from './browserDownload';
|
|
|
6
7
|
export * from './browserNotification';
|
|
7
8
|
export * from './browserRuntime';
|
|
8
9
|
export * from './browserTab';
|
|
9
|
-
export * from './
|
|
10
|
+
export * from './ContentJs';
|
|
10
11
|
export * from './opStorage';
|
|
11
12
|
export * from './opTab';
|
|
12
13
|
export * from './serviceCommon';
|
package/dist/serviceCommon.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { DownloadParams } from './browserDownload';
|
|
|
5
5
|
export declare function serviceResetAddon(): Promise<void>;
|
|
6
6
|
/**
|
|
7
7
|
* Service to handle download operations.
|
|
8
|
-
* Attempts a full download with filename; if it fails, retries with downlink
|
|
8
|
+
* Attempts a full download with filename; if it fails, retries with downlink
|
|
9
|
+
* only.
|
|
9
10
|
* * @param params The download parameters.
|
|
10
11
|
*/
|
|
11
12
|
export declare function serviceDownloadByDownlink(params: DownloadParams): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceCommon.d.ts","sourceRoot":"","sources":["../src/serviceCommon.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"serviceCommon.d.ts","sourceRoot":"","sources":["../src/serviceCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAK5E;;GAEG;AACH,wBAAsB,iBAAiB,kBAGtC;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrF"}
|
package/dist/serviceCommon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browserDownloadByDownlink } from './browserDownload';
|
|
2
|
-
import {
|
|
2
|
+
import { browserNotificationCreateBasicContent } from './browserNotification';
|
|
3
3
|
import { stoOpClear } from "./opStorage";
|
|
4
4
|
import { browserRuntimeReload } from "./browserRuntime";
|
|
5
5
|
/**
|
|
@@ -11,7 +11,8 @@ export async function serviceResetAddon() {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Service to handle download operations.
|
|
14
|
-
* Attempts a full download with filename; if it fails, retries with downlink
|
|
14
|
+
* Attempts a full download with filename; if it fails, retries with downlink
|
|
15
|
+
* only.
|
|
15
16
|
* * @param params The download parameters.
|
|
16
17
|
*/
|
|
17
18
|
export async function serviceDownloadByDownlink(params) {
|
|
@@ -19,12 +20,12 @@ export async function serviceDownloadByDownlink(params) {
|
|
|
19
20
|
try {
|
|
20
21
|
// Attempt 1: Full download with provided parameters
|
|
21
22
|
await browserDownloadByDownlink(params);
|
|
22
|
-
await
|
|
23
|
+
await browserNotificationCreateBasicContent(`downloading! ${filename ??
|
|
23
24
|
'file'}`);
|
|
24
25
|
}
|
|
25
26
|
catch (error) {
|
|
26
27
|
// Notify about the failure
|
|
27
|
-
await
|
|
28
|
+
await browserNotificationCreateBasicContent(`reason=${error}`);
|
|
28
29
|
// Attempt 2: Fallback retry using only the downlink
|
|
29
30
|
await browserDownloadByDownlink({ downlink });
|
|
30
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { serviceGetCurrentDateYYYYMMDDHHMMSS } from './serviceGet';
|
|
2
2
|
import { serviceCopyContentToClipboard, serviceRemoveIllegalWord, serviceSaveContentToLocal, } from './serviceOpContent';
|
|
3
|
-
import {
|
|
3
|
+
import { browserNotificationCreateBasicContent } from './browserNotification';
|
|
4
4
|
// --- Services ---
|
|
5
5
|
/**
|
|
6
6
|
* Captures a tab's screenshot and triggers a local download in the target tab.
|
|
@@ -192,7 +192,7 @@ export async function serviceDealWithMagnetLink(message) {
|
|
|
192
192
|
if (!Array.isArray(data) ||
|
|
193
193
|
data.length ===
|
|
194
194
|
0) {
|
|
195
|
-
await
|
|
195
|
+
await browserNotificationCreateBasicContent('magnet link not found!');
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
const content = `${data.join('\n')}\n`;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export interface
|
|
3
|
-
act:
|
|
1
|
+
export type MessageActionBaseOptions = "actNotification" | 'actInfo' | "actMarco" | "actRemoveCurrentTab" | "actFocusTargetTab" | "actReloadTargetTab";
|
|
2
|
+
export interface MessagePayloadAction {
|
|
3
|
+
act: MessageActionBaseOptions;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface MessagePayloadNotification extends MessagePayloadAction {
|
|
6
|
+
content: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MessagePayloadInfo extends MessagePayloadAction {
|
|
10
|
+
info: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MessagePayloadTargetTab extends MessagePayloadAction {
|
|
6
13
|
targetTabId: number;
|
|
7
14
|
}
|
|
8
15
|
export type MessagePayloadFocusTargetTab = MessagePayloadTargetTab;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,SAAS,GACT,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,CAAA;AAExB,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,wBAAwB,CAAA;CAC9B;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AACnE,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentJsYTB.d.ts","sourceRoot":"","sources":["../src/ContentJsYTB.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,GAAE,MAAc,GAAG,IAAI,CAmCvG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,wBAAwB,kBAE7C;AAED,wBAAsB,uBAAuB,kBAE5C;AAED,wBAAsB,sBAAsB,kBAE3C;AAGD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAW,EAAE,SAAS,UAAQ,QAUhE;AAED,wBAAsB,YAAY,kBAKjC;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,iBAM3D;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,iBAEzD;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBtF;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,iBAE7C;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,iBAExD;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAKnD"}
|