@vacantthinker/firefox-addon-framework-easy 2026.604.640 → 2026.604.1615
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/README.md +2 -0
- package/package.json +1 -1
- package/src/BaseORM.js +0 -1
- package/src/browserDownload.js +2 -2
- package/src/serviceCommon.js +21 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/src/BaseORM.js
CHANGED
package/src/browserDownload.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
*
|
|
3
3
|
* @param param0
|
|
4
4
|
* @param param0.downlink{string}
|
|
5
|
-
* @param param0.filename{string}
|
|
5
|
+
* @param param0.filename{string|null|undefined}
|
|
6
6
|
* @returns {Promise<void>}
|
|
7
7
|
*/
|
|
8
8
|
export async function browserDownloadByDownlink(
|
|
9
9
|
{
|
|
10
10
|
downlink,
|
|
11
|
-
filename,
|
|
11
|
+
filename= null,
|
|
12
12
|
}) {
|
|
13
13
|
|
|
14
14
|
let url = downlink;
|
package/src/serviceCommon.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {browserDownloadByDownlink} from './browserDownload.js';
|
|
2
|
+
import {browserNotificationCreate} from './browserNotification.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* service, download by downlink, if success, notification the filename
|
|
6
|
+
*
|
|
7
|
+
* if failed, nootification the reason, then try download only use downlink
|
|
8
|
+
* @param message
|
|
9
|
+
* @returns {Promise<void>}
|
|
10
|
+
*/
|
|
11
|
+
export async function serviceDownloadByDownlink(message) {
|
|
12
|
+
let {filename, downlink} = message;
|
|
13
|
+
|
|
14
|
+
browserDownloadByDownlink(message).then(async () => {
|
|
15
|
+
await browserNotificationCreate(`downloading! ${filename}`);
|
|
16
|
+
}, async (reason) => {
|
|
17
|
+
await browserNotificationCreate(`reason=${reason}`)
|
|
18
|
+
await browserDownloadByDownlink({downlink});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
}
|