@vacantthinker/firefox-addon-framework-easy 2026.613.1848 → 2026.613.2158
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/browserRuntime.d.ts +5 -0
- package/dist/browserRuntime.d.ts.map +1 -1
- package/dist/browserRuntime.js +9 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{servicePure.d.ts → serviceOperationYTB.d.ts} +8 -1
- package/dist/serviceOperationYTB.d.ts.map +1 -0
- package/dist/{servicePure.js → serviceOperationYTB.js} +23 -7
- package/package.json +1 -1
- package/dist/servicePure.d.ts.map +0 -1
package/dist/browserRuntime.d.ts
CHANGED
|
@@ -22,6 +22,11 @@ export declare function browserRuntimeGetURL(path: string): string;
|
|
|
22
22
|
* @param path
|
|
23
23
|
*/
|
|
24
24
|
export declare function browserRuntimeGetPagesURL(path: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* `pages/${path}.html`
|
|
27
|
+
* @param path
|
|
28
|
+
*/
|
|
29
|
+
export declare function browserRuntimeGetPagesURLNoNeedExtHTML(path: string): string;
|
|
25
30
|
/**
|
|
26
31
|
* Retrieves the Gecko ID from the manifest.
|
|
27
32
|
* @returns The Gecko ID or empty string if not found.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserRuntime.d.ts","sourceRoot":"","sources":["../src/browserRuntime.ts"],"names":[],"mappings":"AAAA;;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,qBAAqB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"browserRuntime.d.ts","sourceRoot":"","sources":["../src/browserRuntime.ts"],"names":[],"mappings":"AAAA;;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"}
|
package/dist/browserRuntime.js
CHANGED
|
@@ -33,13 +33,21 @@ export function browserRuntimeGetURL(path) {
|
|
|
33
33
|
export function browserRuntimeGetPagesURL(path) {
|
|
34
34
|
return browser.runtime.getURL(`pages/${path}`);
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* `pages/${path}.html`
|
|
38
|
+
* @param path
|
|
39
|
+
*/
|
|
40
|
+
export function browserRuntimeGetPagesURLNoNeedExtHTML(path) {
|
|
41
|
+
return browser.runtime.getURL(`pages/${path}.html`);
|
|
42
|
+
}
|
|
36
43
|
/**
|
|
37
44
|
* Retrieves the Gecko ID from the manifest.
|
|
38
45
|
* @returns The Gecko ID or empty string if not found.
|
|
39
46
|
*/
|
|
40
47
|
export function browserRuntimeGeckoId() {
|
|
41
48
|
const manifest = browser.runtime.getManifest();
|
|
42
|
-
return manifest.browser_specific_settings?.gecko?.id ??
|
|
49
|
+
return manifest.browser_specific_settings?.gecko?.id ??
|
|
50
|
+
'';
|
|
43
51
|
}
|
|
44
52
|
/**
|
|
45
53
|
* Gets information about the current platform.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from './serviceCommon';
|
|
|
10
10
|
export * from './serviceFetch';
|
|
11
11
|
export * from './serviceGet';
|
|
12
12
|
export * from './serviceOpContent';
|
|
13
|
+
export * from './serviceOperationYTB';
|
|
13
14
|
export * from './serviceOpJavascript';
|
|
14
|
-
export * from './servicePure';
|
|
15
15
|
export * from './serviceUpdateTabStyle';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
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,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,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"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,6 @@ export * from './serviceCommon';
|
|
|
10
10
|
export * from './serviceFetch';
|
|
11
11
|
export * from './serviceGet';
|
|
12
12
|
export * from './serviceOpContent';
|
|
13
|
+
export * from './serviceOperationYTB';
|
|
13
14
|
export * from './serviceOpJavascript';
|
|
14
|
-
export * from './servicePure';
|
|
15
15
|
export * from './serviceUpdateTabStyle';
|
|
@@ -6,6 +6,13 @@ export interface YoutubePlaylistInfo {
|
|
|
6
6
|
playlistVideolink: string;
|
|
7
7
|
playlistId: string;
|
|
8
8
|
}
|
|
9
|
+
export type ImageQualityYTB = 'maxresdefault' | 'sddefault' | 'hqdefault' | 'mqdefault';
|
|
10
|
+
export declare function serviceGetImageURLYTB(vid: string, imageQuality: ImageQualityYTB): string;
|
|
11
|
+
/**
|
|
12
|
+
* `https://www.youtube.com/watch?v=${vid}`
|
|
13
|
+
* @param vid
|
|
14
|
+
*/
|
|
15
|
+
export declare function serviceGetVideolinkByVid(vid: string): string;
|
|
9
16
|
/**
|
|
10
17
|
* Extracts video ID and creates a clean YouTube URL.
|
|
11
18
|
* Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
|
|
@@ -15,4 +22,4 @@ export declare function servicePureVideolinkYTB(videolinkOrigin: string): Youtub
|
|
|
15
22
|
* Extracts playlist ID and creates a clean YouTube playlist URL.
|
|
16
23
|
*/
|
|
17
24
|
export declare function servicePurePlaylistVideolinkYTB(videolinkOrigin: string): YoutubePlaylistInfo | null;
|
|
18
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=serviceOperationYTB.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceOperationYTB.d.ts","sourceRoot":"","sources":["../src/serviceOperationYTB.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,WAAW,GACX,WAAW,GACX,WAAW,CAAA;AAEf,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,eAAe,GAC5B,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAmCxF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,eAAe,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAoBnG"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
+
export function serviceGetImageURLYTB(vid, imageQuality) {
|
|
2
|
+
return `https://i.ytimg.com/vi/${vid}/${imageQuality}.jpg`;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* `https://www.youtube.com/watch?v=${vid}`
|
|
6
|
+
* @param vid
|
|
7
|
+
*/
|
|
8
|
+
export function serviceGetVideolinkByVid(vid) {
|
|
9
|
+
return `https://www.youtube.com/watch?v=${vid}`;
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
12
|
* Extracts video ID and creates a clean YouTube URL.
|
|
3
13
|
* Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
|
|
4
14
|
*/
|
|
5
15
|
export function servicePureVideolinkYTB(videolinkOrigin) {
|
|
6
|
-
if (!videolinkOrigin)
|
|
16
|
+
if (!videolinkOrigin) {
|
|
7
17
|
return null;
|
|
18
|
+
}
|
|
8
19
|
try {
|
|
9
20
|
const url = new URL(videolinkOrigin);
|
|
10
21
|
let vid = null;
|
|
11
22
|
// 1. Standard watch URL: youtube.com/watch?v=ID
|
|
12
23
|
vid = url.searchParams.get('v');
|
|
13
24
|
// 2. Short URL: youtu.be/ID
|
|
14
|
-
if (!vid &&
|
|
25
|
+
if (!vid &&
|
|
26
|
+
url.hostname.includes('youtu.be')) {
|
|
15
27
|
vid = url.pathname.slice(1);
|
|
16
28
|
}
|
|
17
29
|
// 3. Shorts URL: youtube.com/shorts/ID
|
|
18
|
-
if (!vid &&
|
|
30
|
+
if (!vid &&
|
|
31
|
+
url.pathname.startsWith('/shorts/')) {
|
|
19
32
|
vid = url.pathname.split('/')[2];
|
|
20
33
|
}
|
|
21
|
-
if (!vid)
|
|
34
|
+
if (!vid) {
|
|
22
35
|
return null;
|
|
36
|
+
}
|
|
23
37
|
return {
|
|
24
|
-
videolink:
|
|
38
|
+
videolink: serviceGetVideolinkByVid(vid),
|
|
25
39
|
vid,
|
|
26
40
|
};
|
|
27
41
|
}
|
|
@@ -33,13 +47,15 @@ export function servicePureVideolinkYTB(videolinkOrigin) {
|
|
|
33
47
|
* Extracts playlist ID and creates a clean YouTube playlist URL.
|
|
34
48
|
*/
|
|
35
49
|
export function servicePurePlaylistVideolinkYTB(videolinkOrigin) {
|
|
36
|
-
if (!videolinkOrigin)
|
|
50
|
+
if (!videolinkOrigin) {
|
|
37
51
|
return null;
|
|
52
|
+
}
|
|
38
53
|
try {
|
|
39
54
|
const url = new URL(videolinkOrigin);
|
|
40
55
|
const playlistId = url.searchParams.get('list');
|
|
41
|
-
if (!playlistId)
|
|
56
|
+
if (!playlistId) {
|
|
42
57
|
return null;
|
|
58
|
+
}
|
|
43
59
|
return {
|
|
44
60
|
playlistVideolink: `https://www.youtube.com/playlist?list=${playlistId}`,
|
|
45
61
|
playlistId,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"servicePure.d.ts","sourceRoot":"","sources":["../src/servicePure.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CA6BxF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,eAAe,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAgBnG"}
|