@vacantthinker/firefox-addon-framework-easy 2026.619.1137 → 2026.619.1302

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.
@@ -42,4 +42,47 @@ export declare function stoOpRem(key: string): Promise<void>;
42
42
  * @param key The key to set to null.
43
43
  */
44
44
  export declare function stoOpSetNull(key: string): Promise<void>;
45
+ /**
46
+ * Checks if a key exists in sync storage.
47
+ * @param key The key to check.
48
+ * @returns Promise resolving to true if key exists, false otherwise.
49
+ */
50
+ export declare function syncStoOpCheck(key: string): Promise<boolean>;
51
+ /**
52
+ * Retrieves a value from sync storage by key.
53
+ * @param key The key to retrieve.
54
+ * @returns Promise resolving to the stored value or null if not found.
55
+ */
56
+ export declare function syncStoOpGet<T>(key: string): Promise<T | null>;
57
+ /**
58
+ * Retrieves all items from sync storage.
59
+ * @returns Promise resolving to an object containing all storage items.
60
+ */
61
+ export declare function syncStoOpGetAll<T extends Record<string, unknown>>(): Promise<T>;
62
+ /**
63
+ * Clears all data from sync storage.
64
+ */
65
+ export declare function syncStoOpClear(): Promise<void>;
66
+ /**
67
+ * Queries keys that start with a specific prefix in sync storage.
68
+ * @param prefix The prefix to filter keys.
69
+ * @returns Promise resolving to an array of matching keys.
70
+ */
71
+ export declare function syncStoOpQueryStartWith(prefix: string): Promise<string[]>;
72
+ /**
73
+ * Sets a value in sync storage.
74
+ * @param key The key to set.
75
+ * @param value The value to store. Must be JSON-serializable.
76
+ */
77
+ export declare function syncStoOpSet<T = unknown>(key: string, value: T): Promise<void>;
78
+ /**
79
+ * Removes a key from sync storage.
80
+ * @param key The key to remove.
81
+ */
82
+ export declare function syncStoOpRem(key: string): Promise<void>;
83
+ /**
84
+ * Sets a key to null in sync storage.
85
+ * @param key The key to set to null.
86
+ */
87
+ export declare function syncStoOpSetNull(key: string): Promise<void>;
45
88
  //# sourceMappingURL=opStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"opStorage.d.ts","source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AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE"}
package/dist/opStorage.js CHANGED
@@ -1,3 +1,6 @@
1
+ // ==========================================
2
+ // LOCAL STORAGE OPERATIONS
3
+ // ==========================================
1
4
  /**
2
5
  * Checks if a key exists in local storage.
3
6
  * @param key The key to check.
@@ -83,3 +86,83 @@ export async function stoOpRem(key) {
83
86
  export async function stoOpSetNull(key) {
84
87
  await stoOpSet(key, null);
85
88
  }
89
+ // ==========================================
90
+ // SYNC STORAGE OPERATIONS
91
+ // ==========================================
92
+ /**
93
+ * Checks if a key exists in sync storage.
94
+ * @param key The key to check.
95
+ * @returns Promise resolving to true if key exists, false otherwise.
96
+ */
97
+ export async function syncStoOpCheck(key) {
98
+ const result = await browser.storage.sync.get(key);
99
+ return Object.prototype.hasOwnProperty.call(result, key);
100
+ }
101
+ /**
102
+ * Retrieves a value from sync storage by key.
103
+ * @param key The key to retrieve.
104
+ * @returns Promise resolving to the stored value or null if not found.
105
+ */
106
+ export async function syncStoOpGet(key) {
107
+ const result = await browser.storage.sync.get(key);
108
+ return Object.prototype.hasOwnProperty.call(result, key) ?
109
+ result[key] :
110
+ null;
111
+ }
112
+ /**
113
+ * Retrieves all items from sync storage.
114
+ * @returns Promise resolving to an object containing all storage items.
115
+ */
116
+ export async function syncStoOpGetAll() {
117
+ const result = await browser.storage.sync.get(null);
118
+ return result;
119
+ }
120
+ /**
121
+ * Clears all data from sync storage.
122
+ */
123
+ export async function syncStoOpClear() {
124
+ await browser.storage.sync.clear();
125
+ }
126
+ /**
127
+ * Queries keys that start with a specific prefix in sync storage.
128
+ * @param prefix The prefix to filter keys.
129
+ * @returns Promise resolving to an array of matching keys.
130
+ */
131
+ export async function syncStoOpQueryStartWith(prefix) {
132
+ try {
133
+ const allItems = await browser.storage.sync.get(null);
134
+ return Object.keys(allItems).filter((key) => key.startsWith(prefix));
135
+ }
136
+ catch (error) {
137
+ console.error(`syncStoOpQueryStartWith failed. Storage might be too large:`, error);
138
+ return [];
139
+ }
140
+ }
141
+ /**
142
+ * Sets a value in sync storage.
143
+ * @param key The key to set.
144
+ * @param value The value to store. Must be JSON-serializable.
145
+ */
146
+ export async function syncStoOpSet(key, value) {
147
+ try {
148
+ await browser.storage.sync.set({ [key]: value });
149
+ }
150
+ catch (error) {
151
+ console.error(`syncStoOpSet failed to write key "${key}". Quota exceeded?`, error);
152
+ throw error;
153
+ }
154
+ }
155
+ /**
156
+ * Removes a key from sync storage.
157
+ * @param key The key to remove.
158
+ */
159
+ export async function syncStoOpRem(key) {
160
+ await browser.storage.sync.remove(key);
161
+ }
162
+ /**
163
+ * Sets a key to null in sync storage.
164
+ * @param key The key to set to null.
165
+ */
166
+ export async function syncStoOpSetNull(key) {
167
+ await syncStoOpSet(key, null);
168
+ }
@@ -21,7 +21,13 @@ export interface VideoInfoBase {
21
21
  videolink: string;
22
22
  title: string;
23
23
  }
24
- export declare function serviceGetVideoInfoBaseYTB(videolinkOrigin: string, titleOrigin: string): VideoInfoBase | undefined;
24
+ export declare function serviceGetVideoInfoBaseYTB(videolinkOrigin: string, titleOrigin: string, imageQuality: ImageQualityYTB): VideoInfoBase | undefined;
25
+ export declare function serviceGetVideoInfoYTB(videolinkOrigin: string, titleOrigin: string, imageQuality: ImageQualityYTB): VideoInfoYTB | undefined;
26
+ export interface VideoInfoYTB extends VideoInfoBase {
27
+ filenameVideo: string;
28
+ filenameImg: string;
29
+ imageUrl: string;
30
+ }
25
31
  /**
26
32
  * Extracts video ID and creates a clean YouTube URL.
27
33
  * Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
@@ -1 +1 @@
1
- {"version":3,"file":"serviceOperationYTB.d.ts","sourceRoot":"","sources":["../src/serviceOperationYTB.ts"],"names":[],"mappings":"AAEA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C;CACvB;AAGD,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,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAC1E,aAAa,GAAG,SAAS,CAM3B;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAC1E,YAAY,GAAG,SAAS,CAS1B;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAmCxF;AAED;;GAEG;AACH,iBAAS,+BAA+B,CAAC,kBAAkB,EAAE,MAAM,GACjE,mBAAmB,GAAG,IAAI,CAqB3B;AAED,eAAe,+BAA+B,CAAA"}
@@ -9,7 +9,7 @@ export function serviceGetImageURLYTB(vid, imageQuality) {
9
9
  export function serviceGetVideolinkByVid(vid) {
10
10
  return `https://www.youtube.com/watch?v=${vid}`;
11
11
  }
12
- export function serviceGetVideoInfoBaseYTB(videolinkOrigin, titleOrigin) {
12
+ export function serviceGetVideoInfoBaseYTB(videolinkOrigin, titleOrigin, imageQuality) {
13
13
  const videolinkYTB = servicePureVideolinkYTB(videolinkOrigin);
14
14
  if (!videolinkYTB)
15
15
  return;
@@ -17,6 +17,16 @@ export function serviceGetVideoInfoBaseYTB(videolinkOrigin, titleOrigin) {
17
17
  const title = serviceRemoveIllegalWord(titleOrigin);
18
18
  return { vid, videolink, title };
19
19
  }
20
+ export function serviceGetVideoInfoYTB(videolinkOrigin, titleOrigin, imageQuality) {
21
+ const infoBase = serviceGetVideoInfoBaseYTB(videolinkOrigin, titleOrigin, imageQuality);
22
+ if (!infoBase)
23
+ return;
24
+ const { vid, title } = infoBase;
25
+ const filenameVideo = `${title}.mp4`;
26
+ const filenameImg = `${title}.jpg`;
27
+ const imageUrl = serviceGetImageURLYTB(vid, imageQuality);
28
+ return { ...infoBase, filenameVideo, filenameImg, imageUrl };
29
+ }
20
30
  /**
21
31
  * Extracts video ID and creates a clean YouTube URL.
22
32
  * Supports: youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0619.1137",
3
+ "version": "2026.0619.1302",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",