single-file-cli 2.0.72 → 2.0.74
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/build.sh +1 -1
- package/deno.json +1 -1
- package/deno.lock +15 -10
- package/eslint.config.mjs +31 -0
- package/lib/browser.js +2 -0
- package/lib/cdp-client.js +10 -3
- package/lib/deno-polyfill.js +1 -1
- package/lib/single-file-bundle.js +1 -1
- package/lib/version.js +1 -1
- package/options.js +30 -0
- package/package.json +5 -2
- package/.eslintrc.json +0 -42
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "2.0.
|
|
1
|
+
export const version = "2.0.73";
|
package/options.js
CHANGED
|
@@ -90,6 +90,7 @@ const OPTIONS_INFO = {
|
|
|
90
90
|
"filename-template": { description: "Template used to generate the output filename (see help page of the extension for more info)", type: "string", defaultValue: "%if-empty<{page-title}|No title> ({date-locale} {time-locale}).{filename-extension}" },
|
|
91
91
|
"filename-conflict-action": { description: "Action when the filename is conflicting with existing one on the filesystem. The possible values are \"uniquify\" (default), \"overwrite\" and \"skip\"", type: "string", defaultValue: "uniquify" },
|
|
92
92
|
"filename-replacement-character": { description: "The character used for replacing invalid characters in filenames", type: "string", defaultValue: "_" },
|
|
93
|
+
"filename-replaced-character": { description: "The replaced character and the character(s) used for replacing the replacement character in filenames separated by a space, e.g. --filename-replaced-character \">\" _GT_ to replace \">\" with _GT_", type: "string[]", defaultValue: ["~ ~", "+ +", "? ?", "% %", "* *", ": :", "| |", "\" "", "< <", "> >", "\\\\ \", "\\x00-\\x1f _", "\x7F _"] },
|
|
93
94
|
"filename-max-length": { description: "Specify the maximum length of the filename", type: "number", defaultValue: 192 },
|
|
94
95
|
"filename-max-length-unit": { description: "Specify the unit of the maximum length of the filename ('bytes' or 'chars')", type: "string", defaultValue: "bytes" },
|
|
95
96
|
"replace-emojis-in-filename": { description: "Replace emojis in the filename with their unicode text representation", type: "boolean" },
|
|
@@ -104,6 +105,11 @@ const OPTIONS_INFO = {
|
|
|
104
105
|
"include-infobar": { description: "Include the infobar", type: "boolean" },
|
|
105
106
|
"infobar-template": { description: "Template used to generate the infobar content (see help page of the extension for more info)", type: "string" },
|
|
106
107
|
"open-infobar": { description: "Keep the infobar open when using --include-infobar", type: "boolean" },
|
|
108
|
+
"infobar-position-absolute": { description: "Position the infobar absolutely (fixed otherwise)", type: "boolean" },
|
|
109
|
+
"infobar-position-top": { description: "Position the infobar at the top of the page", type: "string", defaultValue: "16px" },
|
|
110
|
+
"infobar-position-bottom": { description: "Position the infobar at the bottom of the page", type: "string", defaultValue: "" },
|
|
111
|
+
"infobar-position-right": { description: "Position the infobar at the right of the page", type: "string", defaultValue: "16px" },
|
|
112
|
+
"infobar-position-left": { description: "Position the infobar at the left of the page", type: "string", defaultValue: "" },
|
|
107
113
|
"insert-meta-CSP": { description: "Include a <meta> tag with a CSP to avoid potential requests to internet when viewing a page", type: "boolean", defaultValue: true },
|
|
108
114
|
"load-deferred-images": { description: "Load deferred (a.k.a. lazy-loaded) images", type: "boolean", defaultValue: true },
|
|
109
115
|
"load-deferred-images-dispatch-scroll-event": { description: "Dispatch 'scroll' event when loading deferred images", type: "boolean" },
|
|
@@ -324,6 +330,30 @@ function parseArgs(args, setDefaultValues = true) {
|
|
|
324
330
|
result.options.blockedURLPatterns = result.options.blockedUrlPatterns;
|
|
325
331
|
delete result.options.blockedUrlPatterns;
|
|
326
332
|
}
|
|
333
|
+
if (result.options.filenameReplacedCharacters) {
|
|
334
|
+
const filenameReplacedCharacters = result.options.filenameReplacedCharacters;
|
|
335
|
+
result.options.filenameReplacedCharacters = [];
|
|
336
|
+
result.options.filenameReplacementCharacters = [];
|
|
337
|
+
filenameReplacedCharacters.forEach(replacement => {
|
|
338
|
+
let [replacedCharacter, replacementCharacter] = replacement.split(" ");
|
|
339
|
+
try {
|
|
340
|
+
replacedCharacter = JSON.parse(replacedCharacter);
|
|
341
|
+
// eslint-disable-next-line no-unused-vars
|
|
342
|
+
} catch (_error) {
|
|
343
|
+
// ignored
|
|
344
|
+
}
|
|
345
|
+
result.options.filenameReplacedCharacters.push(replacedCharacter);
|
|
346
|
+
if (replacementCharacter !== undefined) {
|
|
347
|
+
try {
|
|
348
|
+
replacementCharacter = JSON.parse(replacementCharacter);
|
|
349
|
+
// eslint-disable-next-line no-unused-vars
|
|
350
|
+
} catch (_error) {
|
|
351
|
+
// ignored
|
|
352
|
+
}
|
|
353
|
+
result.options.filenameReplacementCharacters.push(replacementCharacter);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
327
357
|
return result;
|
|
328
358
|
}
|
|
329
359
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "single-file-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.74",
|
|
4
4
|
"description": "SingleFile CLI",
|
|
5
5
|
"author": "Gildas Lormeau",
|
|
6
6
|
"engines": {
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"simple-cdp": "^1.8.5",
|
|
17
|
-
"ws": "^8.
|
|
17
|
+
"ws": "^8.18.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@eslint/js": "^9.20.0"
|
|
18
21
|
}
|
|
19
22
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"es6": true,
|
|
4
|
-
"node": false,
|
|
5
|
-
"browser": false
|
|
6
|
-
},
|
|
7
|
-
"globals": {
|
|
8
|
-
"console": true
|
|
9
|
-
},
|
|
10
|
-
"extends": "eslint:recommended",
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"ecmaVersion": 2022,
|
|
13
|
-
"sourceType": "module"
|
|
14
|
-
},
|
|
15
|
-
"ignorePatterns": [
|
|
16
|
-
"/lib/"
|
|
17
|
-
],
|
|
18
|
-
"rules": {
|
|
19
|
-
"indent": [
|
|
20
|
-
"error",
|
|
21
|
-
"tab",
|
|
22
|
-
{
|
|
23
|
-
"SwitchCase": 1
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"linebreak-style": [
|
|
27
|
-
"error",
|
|
28
|
-
"unix"
|
|
29
|
-
],
|
|
30
|
-
"quotes": [
|
|
31
|
-
"error",
|
|
32
|
-
"double"
|
|
33
|
-
],
|
|
34
|
-
"semi": [
|
|
35
|
-
"error",
|
|
36
|
-
"always"
|
|
37
|
-
],
|
|
38
|
-
"no-console": [
|
|
39
|
-
"warn"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|