@vacantthinker/firefox-addon-framework-easy 2026.613.1848 → 2026.613.2149

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/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 './serviceOperationYTBURL';
13
14
  export * from './serviceOpJavascript';
14
- export * from './servicePure';
15
15
  export * from './serviceUpdateTabStyle';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -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,eAAe,CAAC;AAC9B,cAAc,yBAAyB,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,0BAA0B,CAAC;AACzC,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 './serviceOperationYTBURL';
13
14
  export * from './serviceOpJavascript';
14
- export * from './servicePure';
15
15
  export * from './serviceUpdateTabStyle';
@@ -6,6 +6,11 @@ export interface YoutubePlaylistInfo {
6
6
  playlistVideolink: string;
7
7
  playlistId: string;
8
8
  }
9
+ /**
10
+ * `https://www.youtube.com/watch?v=${vid}`
11
+ * @param vid
12
+ */
13
+ export declare function serviceGetVideolinkByVid(vid: string): string;
9
14
  /**
10
15
  * Extracts video ID and creates a clean YouTube URL.
11
16
  * Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
@@ -15,4 +20,4 @@ export declare function servicePureVideolinkYTB(videolinkOrigin: string): Youtub
15
20
  * Extracts playlist ID and creates a clean YouTube playlist URL.
16
21
  */
17
22
  export declare function servicePurePlaylistVideolinkYTB(videolinkOrigin: string): YoutubePlaylistInfo | null;
18
- //# sourceMappingURL=servicePure.d.ts.map
23
+ //# sourceMappingURL=serviceOperationYTBURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceOperationYTBURL.d.ts","sourceRoot":"","sources":["../src/serviceOperationYTBURL.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,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,38 @@
1
+ /**
2
+ * `https://www.youtube.com/watch?v=${vid}`
3
+ * @param vid
4
+ */
5
+ export function serviceGetVideolinkByVid(vid) {
6
+ return `https://www.youtube.com/watch?v=${vid}`;
7
+ }
1
8
  /**
2
9
  * Extracts video ID and creates a clean YouTube URL.
3
10
  * Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
4
11
  */
5
12
  export function servicePureVideolinkYTB(videolinkOrigin) {
6
- if (!videolinkOrigin)
13
+ if (!videolinkOrigin) {
7
14
  return null;
15
+ }
8
16
  try {
9
17
  const url = new URL(videolinkOrigin);
10
18
  let vid = null;
11
19
  // 1. Standard watch URL: youtube.com/watch?v=ID
12
20
  vid = url.searchParams.get('v');
13
21
  // 2. Short URL: youtu.be/ID
14
- if (!vid && url.hostname.includes('youtu.be')) {
22
+ if (!vid &&
23
+ url.hostname.includes('youtu.be')) {
15
24
  vid = url.pathname.slice(1);
16
25
  }
17
26
  // 3. Shorts URL: youtube.com/shorts/ID
18
- if (!vid && url.pathname.startsWith('/shorts/')) {
27
+ if (!vid &&
28
+ url.pathname.startsWith('/shorts/')) {
19
29
  vid = url.pathname.split('/')[2];
20
30
  }
21
- if (!vid)
31
+ if (!vid) {
22
32
  return null;
33
+ }
23
34
  return {
24
- videolink: `https://www.youtube.com/watch?v=${vid}`,
35
+ videolink: serviceGetVideolinkByVid(vid),
25
36
  vid,
26
37
  };
27
38
  }
@@ -33,13 +44,15 @@ export function servicePureVideolinkYTB(videolinkOrigin) {
33
44
  * Extracts playlist ID and creates a clean YouTube playlist URL.
34
45
  */
35
46
  export function servicePurePlaylistVideolinkYTB(videolinkOrigin) {
36
- if (!videolinkOrigin)
47
+ if (!videolinkOrigin) {
37
48
  return null;
49
+ }
38
50
  try {
39
51
  const url = new URL(videolinkOrigin);
40
52
  const playlistId = url.searchParams.get('list');
41
- if (!playlistId)
53
+ if (!playlistId) {
42
54
  return null;
55
+ }
43
56
  return {
44
57
  playlistVideolink: `https://www.youtube.com/playlist?list=${playlistId}`,
45
58
  playlistId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0613.1848",
3
+ "version": "2026.0613.2149",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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"}