@vacantthinker/firefox-addon-framework-easy 2026.618.1336 → 2026.618.1440
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} +23 -9
- package/dist/ContentJs.d.ts.map +1 -0
- package/dist/{ContentJsYTB.js → ContentJs.js} +68 -29
- package/dist/backgroundJs.d.ts +1 -1
- package/dist/backgroundJs.d.ts.map +1 -1
- package/dist/backgroundJs.js +8 -2
- 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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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 +10 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ContentJsYTB.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MessagePayloadAction } from "./types";
|
|
1
2
|
/**
|
|
2
3
|
* Captures an <img> element from the current document, draws it to a canvas
|
|
3
4
|
* matching its expected YouTube aspect ratio dimensions, and triggers a
|
|
@@ -21,6 +22,14 @@ export declare function ctJsRandomSleep1501_2000(): Promise<void>;
|
|
|
21
22
|
export declare function ctJsRandomSleep1001_1500(): Promise<void>;
|
|
22
23
|
export declare function ctJsRandomSleep501_1000(): Promise<void>;
|
|
23
24
|
export declare function ctJsRandomSleep501_800(): Promise<void>;
|
|
25
|
+
declare const SLEEP_RANGES: {
|
|
26
|
+
readonly vShort: readonly [501, 800];
|
|
27
|
+
readonly short: readonly [501, 1000];
|
|
28
|
+
readonly medium: readonly [1001, 1500];
|
|
29
|
+
readonly long: readonly [1501, 2000];
|
|
30
|
+
readonly vLong: readonly [2001, 2500];
|
|
31
|
+
};
|
|
32
|
+
export declare function ctJsPresetSleep(preset: keyof typeof SLEEP_RANGES): Promise<void>;
|
|
24
33
|
/**
|
|
25
34
|
* Safely isolates numerals from alphanumeric video quality markers (e.g.,
|
|
26
35
|
* "1080p" -> "1080").
|
|
@@ -29,14 +38,6 @@ export declare function ctJsRandomSleep501_800(): Promise<void>;
|
|
|
29
38
|
* @returns {string} Normalized string representation of numbers, or "unknown".
|
|
30
39
|
*/
|
|
31
40
|
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
41
|
/**
|
|
41
42
|
* Executes a provided function once the DOM is ready.
|
|
42
43
|
* If the DOM is already ready, it executes immediately.
|
|
@@ -45,6 +46,19 @@ export declare function ctJsRemoveDomainCache(domain: string): Promise<void>;
|
|
|
45
46
|
*/
|
|
46
47
|
export declare function ctJsExecuteOnReady(fn: () => void | Promise<void>): Promise<void>;
|
|
47
48
|
export declare function ctJsOpenPage(url: string): Promise<void>;
|
|
49
|
+
export declare function ctJsRemoveDomainCache(domain: string): Promise<void>;
|
|
48
50
|
export declare function ctJsOpenPageKeepOnlyOne(url: string): Promise<void>;
|
|
49
51
|
export declare function ctJsHideElements(selectors: string[]): void;
|
|
50
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Establishes a persistent baseline connection with the background script to
|
|
54
|
+
* maintain runtime context.
|
|
55
|
+
*/
|
|
56
|
+
export declare function ctJskeepAlive(tag?: string, enableLog?: boolean): void;
|
|
57
|
+
export declare function ctJsCloseTab(): Promise<void>;
|
|
58
|
+
export declare function ctJsRemoveCurrentTab(): Promise<void>;
|
|
59
|
+
export declare function ctJsFocusTargetTab(targetTabId: number): Promise<void>;
|
|
60
|
+
export declare function ctJsInfoToBackground(info: string): Promise<void>;
|
|
61
|
+
export declare function ctJsNotification(content: string): Promise<void>;
|
|
62
|
+
export declare function ctJsBrowserRuntimeSendMessage<T extends MessagePayloadAction>(message: T): Promise<void>;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=ContentJs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentJs.d.ts","sourceRoot":"","sources":["../src/ContentJs.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EAIrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;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;AAED,QAAA,MAAM,YAAY;;;;;;CAMR,CAAC;AAEX,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,OAAO,YAAY,iBAGtE;AAID;;;;;;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,QAgB/D;AAED,wBAAsB,YAAY,kBAIjC;AAED,wBAAsB,oBAAoB,kBAIzC;AAED,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,iBAK3D;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,iBAGtD;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,iBAIrD;AAED,wBAAsB,6BAA6B,CAAC,CAAC,SAAS,oBAAoB,EACjF,OAAO,EAAE,CAAC,iBAEV"}
|
|
@@ -66,6 +66,18 @@ export async function ctJsRandomSleep501_1000() {
|
|
|
66
66
|
export async function ctJsRandomSleep501_800() {
|
|
67
67
|
await ctJsRandomSleep(501, 800);
|
|
68
68
|
}
|
|
69
|
+
const SLEEP_RANGES = {
|
|
70
|
+
vShort: [501, 800],
|
|
71
|
+
short: [501, 1000],
|
|
72
|
+
medium: [1001, 1500],
|
|
73
|
+
long: [1501, 2000],
|
|
74
|
+
vLong: [2001, 2500],
|
|
75
|
+
};
|
|
76
|
+
export async function ctJsPresetSleep(preset) {
|
|
77
|
+
const [min, max] = SLEEP_RANGES[preset];
|
|
78
|
+
await ctJsRandomSleep(min, max);
|
|
79
|
+
}
|
|
80
|
+
// Usage: await ctJsPresetSleep('vLong');
|
|
69
81
|
/**
|
|
70
82
|
* Safely isolates numerals from alphanumeric video quality markers (e.g.,
|
|
71
83
|
* "1080p" -> "1080").
|
|
@@ -77,35 +89,6 @@ export function ctJsExtractVideoQualityFromText(text) {
|
|
|
77
89
|
const num = parseInt(text, 10);
|
|
78
90
|
return Number.isNaN(num) ? 'unknown' : num.toString();
|
|
79
91
|
}
|
|
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
92
|
/**
|
|
110
93
|
* Executes a provided function once the DOM is ready.
|
|
111
94
|
* If the DOM is already ready, it executes immediately.
|
|
@@ -130,6 +113,9 @@ export async function ctJsExecuteOnReady(fn) {
|
|
|
130
113
|
export async function ctJsOpenPage(url) {
|
|
131
114
|
await tabOpCreateActiveTrue({ url });
|
|
132
115
|
}
|
|
116
|
+
export async function ctJsRemoveDomainCache(domain) {
|
|
117
|
+
await browserBrowsingDataRemoveDomainCache(domain);
|
|
118
|
+
}
|
|
133
119
|
export async function ctJsOpenPageKeepOnlyOne(url) {
|
|
134
120
|
await tabOpCreateKeepOnlyOneFocusTrue(url);
|
|
135
121
|
}
|
|
@@ -139,3 +125,56 @@ export function ctJsHideElements(selectors) {
|
|
|
139
125
|
.forEach(ele => ele.hidden = true);
|
|
140
126
|
});
|
|
141
127
|
}
|
|
128
|
+
//-------------------------------------------------------------------------------
|
|
129
|
+
// -------------------------------------------------------------------------------
|
|
130
|
+
// -------------------------------------------------------------------------------
|
|
131
|
+
// -------------------------------------------------------------------------------
|
|
132
|
+
// -------------------------------------------------------------------------------
|
|
133
|
+
/**
|
|
134
|
+
* Establishes a persistent baseline connection with the background script to
|
|
135
|
+
* maintain runtime context.
|
|
136
|
+
*/
|
|
137
|
+
export function ctJskeepAlive(tag = "", enableLog = true) {
|
|
138
|
+
async function ping() {
|
|
139
|
+
if (enableLog) {
|
|
140
|
+
console.log(tag, "actMarco");
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
await browserRuntimeSendMessage({ act: "actMarco" });
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
console.error("Keep-alive ping failed:", err);
|
|
147
|
+
}
|
|
148
|
+
// Schedule the next execution only after this one completes
|
|
149
|
+
setTimeout(ping, 1000);
|
|
150
|
+
}
|
|
151
|
+
// Start the loop
|
|
152
|
+
setTimeout(ping, 1000);
|
|
153
|
+
}
|
|
154
|
+
export async function ctJsCloseTab() {
|
|
155
|
+
await browserRuntimeSendMessage({
|
|
156
|
+
act: 'actRemoveCurrentTab',
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
export async function ctJsRemoveCurrentTab() {
|
|
160
|
+
await browserRuntimeSendMessage({
|
|
161
|
+
act: 'actRemoveCurrentTab',
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export async function ctJsFocusTargetTab(targetTabId) {
|
|
165
|
+
await browserRuntimeSendMessage({
|
|
166
|
+
targetTabId: targetTabId,
|
|
167
|
+
act: 'actFocusTargetTab'
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export async function ctJsInfoToBackground(info) {
|
|
171
|
+
await browserRuntimeSendMessage({ act: "actInfo", info, });
|
|
172
|
+
}
|
|
173
|
+
export async function ctJsNotification(content) {
|
|
174
|
+
await browserRuntimeSendMessage({
|
|
175
|
+
act: "actNotification", content,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export async function ctJsBrowserRuntimeSendMessage(message) {
|
|
179
|
+
await browserRuntimeSendMessage(message);
|
|
180
|
+
}
|
package/dist/backgroundJs.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type ActHandlerFunc = (rest: any, tabId: number | undefined) => Promise<v
|
|
|
4
4
|
* Uses <T extends string> so the app can pass its own union type.
|
|
5
5
|
* It defaults to FrameworkBaseAction if no type is passed.
|
|
6
6
|
*/
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function bkJsCreateActionBaseHandlers<T extends string = MessageActionBaseOptions>(): Map<T, ActHandlerFunc>;
|
|
8
8
|
/**
|
|
9
9
|
* Dispatcher also accepts the generic map
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backgroundJs.d.ts","sourceRoot":"","sources":["../src/backgroundJs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;
|
|
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"}
|
package/dist/backgroundJs.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
// --- IN YOUR FRAMEWORK ---
|
|
2
2
|
import { browserTabSendMessageMarcoPolo } from "./browserTab";
|
|
3
3
|
import { tabOpFocus, tabOpReload, tabOpRemove } from "./opTab";
|
|
4
|
+
import { browserNotificationCreateBasicContent } from "./browserNotification";
|
|
4
5
|
/**
|
|
5
6
|
* Uses <T extends string> so the app can pass its own union type.
|
|
6
7
|
* It defaults to FrameworkBaseAction if no type is passed.
|
|
7
8
|
*/
|
|
8
|
-
export function
|
|
9
|
+
export function bkJsCreateActionBaseHandlers() {
|
|
9
10
|
// We use `any` internally to set the map up without TS complaining,
|
|
10
11
|
// but we return the strictly typed generic Map.
|
|
11
12
|
const map = new Map();
|
|
13
|
+
map.set("actNotification", async (rest) => {
|
|
14
|
+
if (rest && rest.content) {
|
|
15
|
+
await browserNotificationCreateBasicContent(rest.content);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
map.set('actInfo', async (rest) => {
|
|
13
|
-
console.
|
|
19
|
+
console.info('actInfo', rest);
|
|
14
20
|
});
|
|
15
21
|
map.set('actMarco', async (_rest, tabId) => {
|
|
16
22
|
if (tabId)
|
|
@@ -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<T extends MessagePayloadAction>(message: T): 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,CAAC,CAAC,SAAS,oBAAoB,EAAE,OAAO,EAAE,CAAC,iBAEzF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export * from './browserDownload';
|
|
|
7
7
|
export * from './browserNotification';
|
|
8
8
|
export * from './browserRuntime';
|
|
9
9
|
export * from './browserTab';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './ContentJs';
|
|
11
11
|
export * from './opStorage';
|
|
12
12
|
export * from './opTab';
|
|
13
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,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,
|
|
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
|
@@ -7,7 +7,7 @@ export * from './browserDownload';
|
|
|
7
7
|
export * from './browserNotification';
|
|
8
8
|
export * from './browserRuntime';
|
|
9
9
|
export * from './browserTab';
|
|
10
|
-
export * from './
|
|
10
|
+
export * from './ContentJs';
|
|
11
11
|
export * from './opStorage';
|
|
12
12
|
export * from './opTab';
|
|
13
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 MessageActionBaseOptions = 'actInfo' | "actMarco" | "actRemoveCurrentTab" | "actFocusTargetTab" | "actReloadTargetTab";
|
|
2
|
-
export interface
|
|
1
|
+
export type MessageActionBaseOptions = "actNotification" | 'actInfo' | "actMarco" | "actRemoveCurrentTab" | "actFocusTargetTab" | "actReloadTargetTab";
|
|
2
|
+
export interface MessagePayloadAction {
|
|
3
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,wBAAwB,GAChC,SAAS,GACT,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,CAAA;AAExB,MAAM,WAAW,
|
|
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"}
|