single-file-core 1.3.16 → 1.3.18
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.
|
@@ -16947,7 +16947,8 @@ async function evalTemplate(template = "", options, content, doc, dontReplaceSla
|
|
|
16947
16947
|
"bookmark-pathname": { getter: () => bookmarkFolder, dontReplaceSlash: dontReplaceSlashIfUndefined },
|
|
16948
16948
|
"bookmark-pathname-flat": { getter: () => bookmarkFolder, dontReplaceSlash: false },
|
|
16949
16949
|
"profile-name": { getter: () => options.profileName },
|
|
16950
|
-
"filename-extension": { getter: () => getFilenameExtension(options) }
|
|
16950
|
+
"filename-extension": { getter: () => getFilenameExtension(options) },
|
|
16951
|
+
"save-action": { getter: () => options.selected ? "selection" : "page" }
|
|
16951
16952
|
};
|
|
16952
16953
|
if (content) {
|
|
16953
16954
|
variables["digest-sha-256"] = { getter: async () => digest("SHA-256", content) };
|
package/package.json
CHANGED
|
@@ -91,6 +91,7 @@ async function process(pageData, options, lastModDate = new Date()) {
|
|
|
91
91
|
zipDataWriter.writable.size = 0;
|
|
92
92
|
let extraDataOffset, extraData, embeddedImageDataOffset, endTag;
|
|
93
93
|
if (options.embeddedImage) {
|
|
94
|
+
options.embeddedImage = Array.from(options.embeddedImage);
|
|
94
95
|
const embeddedImageData = options.embeddedImage.slice(PNG_SIGNATURE_LENGTH + PNG_IHDR_LENGTH, options.embeddedImage.length - PNG_IEND_LENGTH);
|
|
95
96
|
await writeData(zipDataWriter.writable, options.embeddedImage.slice(0, PNG_SIGNATURE_LENGTH + PNG_IHDR_LENGTH));
|
|
96
97
|
if (options.selfExtractingArchive) {
|
|
@@ -190,7 +191,7 @@ async function process(pageData, options, lastModDate = new Date()) {
|
|
|
190
191
|
return new Blob([
|
|
191
192
|
pageContent,
|
|
192
193
|
getCRC32(pageContent, embeddedImageDataOffset),
|
|
193
|
-
options.embeddedImage.slice(options.embeddedImage.length - PNG_IEND_LENGTH)
|
|
194
|
+
new Uint8Array(options.embeddedImage.slice(options.embeddedImage.length - PNG_IEND_LENGTH))
|
|
194
195
|
], { type: "application/octet-stream" });
|
|
195
196
|
} else {
|
|
196
197
|
return new Blob([pageContent], { type: "application/octet-stream" });
|