@vacantthinker/firefox-addon-framework-easy 2026.623.1154 → 2026.623.1222

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.
@@ -6,5 +6,5 @@ export interface DownloadParams {
6
6
  filename?: string;
7
7
  referrer?: string;
8
8
  }
9
- export declare function browserDownloadByDownlink({ downlink, filename, referrer, }: DownloadParams): Promise<void>;
9
+ export declare function browserDownloadByDownlink(params: DownloadParams): Promise<void>;
10
10
  //# sourceMappingURL=browserDownload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserDownload.d.ts","sourceRoot":"","sources":["../src/browserDownload.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,yBAAyB,CAC7C,EACE,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBlC"}
1
+ {"version":3,"file":"browserDownload.d.ts","sourceRoot":"","sources":["../src/browserDownload.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBvC"}
@@ -1,16 +1,18 @@
1
- export async function browserDownloadByDownlink({ downlink, filename, referrer, }) {
1
+ export async function browserDownloadByDownlink(params) {
2
+ const { downlink, filename, referrer } = params;
3
+ if (downlink == undefined)
4
+ return;
2
5
  const options = {
3
6
  url: downlink,
4
- saveAs: false,
5
7
  };
6
8
  if (filename) {
7
9
  options.filename = filename;
8
10
  }
9
- // Inject the Referer header to bypass hotlink protection
11
+ // FIX: Explicitly assign the headers array if a referrer is provided
10
12
  if (referrer) {
11
13
  options.headers = [
12
14
  {
13
- name: 'Referer',
15
+ name: 'Referer', // Fix spelling: canonical HTTP header name
14
16
  value: referrer
15
17
  }
16
18
  ];
@@ -1 +1 @@
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,CAC7C,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBvC"}
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,CAC7C,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAUvC"}
@@ -16,16 +16,14 @@ export async function serviceResetAddon() {
16
16
  * * @param params The download parameters.
17
17
  */
18
18
  export async function serviceDownloadByDownlink(params) {
19
- const { filename, downlink } = params;
20
19
  try {
21
20
  // Attempt 1: Full download with provided parameters
22
21
  await browserDownloadByDownlink(params);
23
- await browserNotificationCreateBasicContent(`downloading! ${filename ?? 'file'}`);
24
22
  }
25
23
  catch (error) {
26
24
  // Notify about the failure
27
25
  await browserNotificationCreateBasicContent(`reason=${error}`);
28
- // Attempt 2: Fallback retry using only the downlink
29
- await browserDownloadByDownlink({ downlink });
26
+ const { filename, ...rest } = params;
27
+ await browserDownloadByDownlink(rest);
30
28
  }
31
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0623.1154",
3
+ "version": "2026.0623.1222",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",