@vacantthinker/firefox-addon-framework-easy 2026.526.1121 → 2026.526.1124

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vacantthinker/firefox-addon-framework-easy",
3
- "version": "2026.0526.1121",
3
+ "version": "2026.0526.1124",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -11,7 +11,7 @@ export async function serviceCopyContentToClipboard(data) {
11
11
  * eg: fnName('this is content', 'this is a filename without ext', 'txt')
12
12
  * @param {string} content
13
13
  * @param {string} filename eg: abc
14
- * @param {string} ext txt json cmd js ...
14
+ * @param {string} ext txt json
15
15
  */
16
16
  export function serviceSaveContentToLocal(content, filename, ext = 'txt') {
17
17
  const eleBtn = document.createElement('button');
@@ -19,8 +19,12 @@ export function serviceSaveContentToLocal(content, filename, ext = 'txt') {
19
19
  'click',
20
20
  function() {
21
21
  const eleA = document.createElement('a');
22
- let type = 'text/plain';
23
- // let type = 'application/json';
22
+
23
+ const extObj = {
24
+ txt: 'text/plain',
25
+ json: 'application/json'
26
+ }
27
+ const type = extObj[ext];
24
28
 
25
29
  const file = new Blob([content], {type});
26
30
  eleA.href = URL.createObjectURL(file);