From fafb5660aef253a05c48acb42c6ef6cbac9fa83c Mon Sep 17 00:00:00 2001
From: Gildas
Date: Mon, 1 Jun 2020 20:36:55 +0200
Subject: [PATCH 01/22] updated Japanese translation
---
_locales/ja/messages.json | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/_locales/ja/messages.json b/_locales/ja/messages.json
index 1355af09c..14e5ff591 100644
--- a/_locales/ja/messages.json
+++ b/_locales/ja/messages.json
@@ -172,7 +172,7 @@
"description": "Options page label: 'template'"
},
"optionFilenameMaxLength": {
- "message": "max length (bytes)",
+ "message": "最大長(バイト)",
"description": "Options page label: 'max length (bytes)'"
},
"optionConfirmFilename": {
@@ -196,10 +196,10 @@
"description": "Value for 'name conflict resolution' option: 'prompt for a name'"
},
"optionFilenameConflictActionSkip": {
- "message": "skip duplicate files",
- "description": "Value for 'filename conflict resolution' option: 'skip duplicate files'"
- },
- "optionsHTMLContentSubTitle": {
+ "message": "重複ファイルをスキップ",
+ "description": "Value for 'filename conflict resolution' option: 'skip duplicate files'"
+ },
+ "optionsHTMLContentSubTitle": {
"message": "HTML コンテンツ",
"description": "Options sub-title: 'HTML content'"
},
@@ -376,7 +376,7 @@
"description": "Options page label: 'save pages in background'"
},
"optionApplySystemTheme": {
- "message": "apply the system theme when formatting a page in the annotation editor",
+ "message": "(注釈エディタ)でページをフォーマットするときにシステムテーマを適用する",
"description": "Title of the button 'apply the system theme when formatting a page in the annotation editor"
},
"optionDisplayStats": {
@@ -416,7 +416,7 @@
"description": "Options page label: 'save the page of a newly created bookmark'"
},
"optionReplaceBookmarkURL": {
- "message": "link the new bookmark to the saved page",
+ "message": "新しいブックマークを保存したページにリンクさせることを可能にする",
"description": "Options page label: 'link the new bookmark to the saved page'"
},
"optionsHelpLink": {
@@ -631,4 +631,4 @@
"message": "Cancel",
"description": "Add URLs popup cancel button: 'Cancel'"
}
-}
+}
\ No newline at end of file
From 15fdb4eb812a9a5ba947e21076ca1a3389ea88a2 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Mon, 1 Jun 2020 21:14:21 +0200
Subject: [PATCH 02/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index a06793ed8..edb06abbf 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.44",
+ "version": "1.17.45",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From 618202f51628a9697d2fc99e786f6a094ce825cd Mon Sep 17 00:00:00 2001
From: Gildas
Date: Wed, 3 Jun 2020 23:13:35 +0200
Subject: [PATCH 03/22] fixed freeze issue (cf #428)
---
extension/ui/content/content-ui-main.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/extension/ui/content/content-ui-main.js b/extension/ui/content/content-ui-main.js
index 15b342af2..ca00185f3 100644
--- a/extension/ui/content/content-ui-main.js
+++ b/extension/ui/content/content-ui-main.js
@@ -58,8 +58,8 @@ this.singlefile.extension.ui.content.main = this.singlefile.extension.ui.content
let maskElement = document.querySelector(MASK_TAGNAME);
if (!maskElement) {
if (options.logsEnabled) {
- document.body.appendChild(logsWindowElement);
setLogsWindowStyle();
+ document.body.appendChild(logsWindowElement);
}
if (options.shadowEnabled) {
const maskElement = createMaskElement();
@@ -378,10 +378,9 @@ this.singlefile.extension.ui.content.main = this.singlefile.extension.ui.content
function createMaskElement() {
let maskElement = document.querySelector(MASK_TAGNAME);
if (!maskElement) {
- maskElement = createElement(MASK_TAGNAME, document.body);
+ maskElement = createElement(MASK_TAGNAME);
maskElement.style.setProperty("opacity", 0, "important");
maskElement.style.setProperty("background-color", "transparent", "important");
- maskElement.offsetWidth;
maskElement.style.setProperty("position", "fixed", "important");
maskElement.style.setProperty("top", "0", "important");
maskElement.style.setProperty("left", "0", "important");
@@ -389,6 +388,8 @@ this.singlefile.extension.ui.content.main = this.singlefile.extension.ui.content
maskElement.style.setProperty("height", "100%", "important");
maskElement.style.setProperty("z-index", 2147483646, "important");
maskElement.style.setProperty("transition", "opacity 250ms", "important");
+ document.body.appendChild(maskElement);
+ maskElement.offsetWidth;
}
return maskElement;
}
@@ -529,7 +530,9 @@ this.singlefile.extension.ui.content.main = this.singlefile.extension.ui.content
function createElement(tagName, parentElement) {
const element = document.createElement(tagName);
element.className = SINGLE_FILE_UI_ELEMENT_CLASS;
- parentElement.appendChild(element);
+ if (parentElement) {
+ parentElement.appendChild(element);
+ }
initStyle(element);
return element;
}
From 584706c6a4e6953513f08f9bf41c23f5f2e247f0 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Wed, 3 Jun 2020 23:30:40 +0200
Subject: [PATCH 04/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index edb06abbf..436bdf170 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.45",
+ "version": "1.17.46",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From 789f388abe2dc5d18ebb72f90c22b86c4ecfe25d Mon Sep 17 00:00:00 2001
From: Gildas
Date: Thu, 4 Jun 2020 22:42:10 +0200
Subject: [PATCH 05/22] ignore SVG tags (fixes #429)
---
lib/single-file/modules/html-serializer.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/single-file/modules/html-serializer.js b/lib/single-file/modules/html-serializer.js
index 3021fb96e..ba0280957 100644
--- a/lib/single-file/modules/html-serializer.js
+++ b/lib/single-file/modules/html-serializer.js
@@ -77,13 +77,13 @@ this.singlefile.lib.modules.serializer = this.singlefile.lib.modules.serializer
}
};
- function serialize(node, compressHTML) {
+ function serialize(node, compressHTML, isSVG) {
if (node.nodeType == Node_TEXT_NODE) {
return serializeTextNode(node);
} else if (node.nodeType == Node_COMMENT_NODE) {
return serializeCommentNode(node);
} else if (node.nodeType == Node_ELEMENT_NODE) {
- return serializeElement(node, compressHTML);
+ return serializeElement(node, compressHTML, isSVG);
}
}
@@ -107,7 +107,7 @@ this.singlefile.lib.modules.serializer = this.singlefile.lib.modules.serializer
return "";
}
- function serializeElement(element, compressHTML) {
+ function serializeElement(element, compressHTML, isSVG) {
const tagName = element.tagName.toLowerCase();
const omittedStartTag = compressHTML && OMITTED_START_TAGS.find(omittedStartTag => tagName == omittedStartTag.tagName && omittedStartTag.accept(element));
let content = "";
@@ -119,10 +119,10 @@ this.singlefile.lib.modules.serializer = this.singlefile.lib.modules.serializer
if (element.tagName == "TEMPLATE" && !element.childNodes.length) {
content += element.innerHTML;
} else {
- Array.from(element.childNodes).forEach(childNode => content += serialize(childNode, compressHTML));
+ Array.from(element.childNodes).forEach(childNode => content += serialize(childNode, compressHTML, isSVG || tagName == "svg"));
}
const omittedEndTag = compressHTML && OMITTED_END_TAGS.find(omittedEndTag => tagName == omittedEndTag.tagName && omittedEndTag.accept(element.nextSibling, element));
- if (!omittedEndTag && !SELF_CLOSED_TAG_NAMES.includes(tagName)) {
+ if (isSVG || (!omittedEndTag && !SELF_CLOSED_TAG_NAMES.includes(tagName))) {
content += "" + tagName + ">";
}
return content;
From f5abc11c899700b5bfba3d7d0ad6a409632d21e4 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Thu, 4 Jun 2020 22:45:48 +0200
Subject: [PATCH 06/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index 436bdf170..49726ac44 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.46",
+ "version": "1.17.47",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From 1486e5b10c64a37ce9d78c668cbf1c425f08c5ab Mon Sep 17 00:00:00 2001
From: Gildas
Date: Thu, 11 Jun 2020 21:55:53 +0200
Subject: [PATCH 07/22] pass frameId instead of windowId
---
lib/single-file/single-file-core.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/single-file/single-file-core.js b/lib/single-file/single-file-core.js
index aa85fc7e5..7ca4bb1bb 100644
--- a/lib/single-file/single-file-core.js
+++ b/lib/single-file/single-file-core.js
@@ -1526,7 +1526,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
maxResourceSize: options.maxResourceSize,
maxResourceSizeEnabled: options.maxResourceSizeEnabled,
validateTextContentType: true,
- frameId: options.windowId
+ frameId: options.frameId
});
resourceURL = content.resourceURL;
content.data = getUpdatedResourceContent(resourceURL, content, options);
@@ -1596,7 +1596,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
maxResourceSize: options.maxResourceSize,
maxResourceSizeEnabled: options.maxResourceSizeEnabled,
charset: options.charset,
- frameId: options.windowId,
+ frameId: options.frameId,
validateTextContentType: true
});
resourceURL = content.resourceURL;
From 7cbccea7083415a71b00633e82dbaabd7fb3be10 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Thu, 11 Jun 2020 22:00:26 +0200
Subject: [PATCH 08/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index 49726ac44..d05f7aba7 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.47",
+ "version": "1.17.48",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From a9190d1499a85d9fdbad231d8ebeffc5bb7f5f33 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Wed, 17 Jun 2020 15:31:11 +0200
Subject: [PATCH 09/22] updated Chinese translation (cf #432)
---
_locales/zh_CN/messages.json | 2 +-
_locales/zh_TW/messages.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json
index 6a9d10f91..1309c61f8 100644
--- a/_locales/zh_CN/messages.json
+++ b/_locales/zh_CN/messages.json
@@ -196,7 +196,7 @@
"description": "Value for 'name conflict resolution' option: 'prompt for a name'"
},
"optionFilenameConflictActionSkip": {
- "message": "skip duplicate files",
+ "message": "跳过重复文件",
"description": "Value for 'filename conflict resolution' option: 'skip duplicate files'"
},
"optionsHTMLContentSubTitle": {
diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json
index 3a43caaf1..17c421804 100644
--- a/_locales/zh_TW/messages.json
+++ b/_locales/zh_TW/messages.json
@@ -196,7 +196,7 @@
"description": "Value for 'name conflict resolution' option: 'prompt for a name'"
},
"optionFilenameConflictActionSkip": {
- "message": "skip duplicate files",
+ "message": "跳過重複文件",
"description": "Value for 'filename conflict resolution' option: 'skip duplicate files'"
},
"optionsHTMLContentSubTitle": {
From 92dcb5a8fa314fd8359b9b2cf2a0c622af195716 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Wed, 17 Jun 2020 15:32:12 +0200
Subject: [PATCH 10/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index d05f7aba7..6ff3c146c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.48",
+ "version": "1.17.49",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From 7cb64a85c1db0939a39a3a895f0bddd82bc7c2f7 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Tue, 23 Jun 2020 23:20:36 +0200
Subject: [PATCH 11/22] fix issue when autosave is enabled and duplicates are
skipped
---
extension/core/bg/downloads.js | 72 +++++++++++++++++-----------------
1 file changed, 36 insertions(+), 36 deletions(-)
diff --git a/extension/core/bg/downloads.js b/extension/core/bg/downloads.js
index 291c0a483..9540cf913 100644
--- a/extension/core/bg/downloads.js
+++ b/extension/core/bg/downloads.js
@@ -141,27 +141,12 @@ singlefile.extension.core.bg.downloads = (() => {
});
} else {
message.url = URL.createObjectURL(blob);
- const filenameConflictAction = message.filenameConflictAction;
- let skipped;
- if (filenameConflictAction == CONFLICT_ACTION_SKIP) {
- const downloadItems = await browser.downloads.search({
- filenameRegex: "(\\\\|/)" + getRegExp(message.filename) + "$",
- exists: true
- });
- if (downloadItems.length) {
- skipped = true;
- } else {
- message.filenameConflictAction = CONFLICT_ACTION_UNIQUIFY;
- }
- }
- if (!skipped) {
- await downloadPage(message, {
- confirmFilename: message.confirmFilename,
- incognito,
- filenameConflictAction: message.filenameConflictAction,
- filenameReplacementCharacter: message.filenameReplacementCharacter
- });
- }
+ await downloadPage(message, {
+ confirmFilename: message.confirmFilename,
+ incognito,
+ filenameConflictAction: message.filenameConflictAction,
+ filenameReplacementCharacter: message.filenameReplacementCharacter
+ });
}
singlefile.extension.ui.bg.main.onEnd(tabId);
} catch (error) {
@@ -238,24 +223,39 @@ singlefile.extension.core.bg.downloads = (() => {
}
async function downloadPage(pageData, options) {
- const downloadInfo = {
- url: pageData.url,
- saveAs: options.confirmFilename,
- filename: pageData.filename,
- conflictAction: options.filenameConflictAction
- };
- if (options.incognito) {
- downloadInfo.incognito = true;
+ const filenameConflictAction = options.filenameConflictAction;
+ let skipped;
+ if (filenameConflictAction == CONFLICT_ACTION_SKIP) {
+ const downloadItems = await browser.downloads.search({
+ filenameRegex: "(\\\\|/)" + getRegExp(pageData.filename) + "$",
+ exists: true
+ });
+ if (downloadItems.length) {
+ skipped = true;
+ } else {
+ options.filenameConflictAction = CONFLICT_ACTION_UNIQUIFY;
+ }
}
- const downloadData = await download(downloadInfo, options.filenameReplacementCharacter);
- if (downloadData.filename && pageData.bookmarkId && pageData.replaceBookmarkURL) {
- if (!downloadData.filename.startsWith("file:")) {
- if (downloadData.filename.startsWith("/")) {
- downloadData.filename = downloadData.filename.substring(1);
+ if (!skipped) {
+ const downloadInfo = {
+ url: pageData.url,
+ saveAs: options.confirmFilename,
+ filename: pageData.filename,
+ conflictAction: options.filenameConflictAction
+ };
+ if (options.incognito) {
+ downloadInfo.incognito = true;
+ }
+ const downloadData = await download(downloadInfo, options.filenameReplacementCharacter);
+ if (downloadData.filename && pageData.bookmarkId && pageData.replaceBookmarkURL) {
+ if (!downloadData.filename.startsWith("file:")) {
+ if (downloadData.filename.startsWith("/")) {
+ downloadData.filename = downloadData.filename.substring(1);
+ }
+ downloadData.filename = "file:///" + downloadData.filename;
}
- downloadData.filename = "file:///" + downloadData.filename;
+ await singlefile.extension.core.bg.bookmarks.update(pageData.bookmarkId, { url: downloadData.filename });
}
- await singlefile.extension.core.bg.bookmarks.update(pageData.bookmarkId, { url: downloadData.filename });
}
}
From 62ba410fb6f1c7f37c40fed476d969cca75f2b02 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Tue, 23 Jun 2020 23:23:28 +0200
Subject: [PATCH 12/22] bump version
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index 6ff3c146c..62f0863f6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -8,7 +8,7 @@
"64": "extension/ui/resources/icon_64.png",
"128": "extension/ui/resources/icon_128.png"
},
- "version": "1.17.49",
+ "version": "1.17.50",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
From 3e15a0d08fbe050e90f3e21efa194c21234cd658 Mon Sep 17 00:00:00 2001
From: Gildas
Date: Tue, 30 Jun 2020 16:45:58 +0200
Subject: [PATCH 13/22] added known issue in Firefox (see #405)
---
README.MD | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.MD b/README.MD
index abe865e31..08e391da6 100644
--- a/README.MD
+++ b/README.MD
@@ -87,6 +87,7 @@ See https://addons.mozilla.org/firefox/addon/single-file/versions/
- Sometimes, SingleFile is unable to save the contents of sandboxed iframes because of [this bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1411641).
- Waterfox
- When opening pages saved with the option "Images > group duplicate images together" enabled, some duplicate images might not displayed. It is recommended to disable this option.
+ - When processing a page from the filesystem, external resources (e.g. images, stylesheets, fonts etc.) will not be embedded into the saved page. You can find more info about this bug [here](https://bugzilla.mozilla.org/show_bug.cgi?id=1644488). This bug has been closed by Mozilla as "WontFix".
## Troubleshooting unknown issues
Please follow these steps if you find an unknown issue:
From 236c5e9bc3ff09b22b09aee96940d76d157644ed Mon Sep 17 00:00:00 2001
From: Gildas
Date: Tue, 30 Jun 2020 16:46:51 +0200
Subject: [PATCH 14/22] moved issue at the right place
---
README.MD | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.MD b/README.MD
index 08e391da6..b07cbeaf8 100644
--- a/README.MD
+++ b/README.MD
@@ -85,9 +85,9 @@ See https://addons.mozilla.org/firefox/addon/single-file/versions/
- Firefox:
- The "File name > file name conflict resolution" option does not work if set to "prompt for a name"
- Sometimes, SingleFile is unable to save the contents of sandboxed iframes because of [this bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1411641).
-- Waterfox
- - When opening pages saved with the option "Images > group duplicate images together" enabled, some duplicate images might not displayed. It is recommended to disable this option.
- When processing a page from the filesystem, external resources (e.g. images, stylesheets, fonts etc.) will not be embedded into the saved page. You can find more info about this bug [here](https://bugzilla.mozilla.org/show_bug.cgi?id=1644488). This bug has been closed by Mozilla as "WontFix".
+- Waterfox
+ - When opening pages saved with the option "Images > group duplicate images together" enabled, some duplicate images might not displayed. It is recommended to disable this option.
## Troubleshooting unknown issues
Please follow these steps if you find an unknown issue:
From c398eaddcf9cdc77607f3990802c62589e28bf6c Mon Sep 17 00:00:00 2001
From: Gildas
Date: Tue, 7 Jul 2020 20:06:32 +0200
Subject: [PATCH 15/22] added "zoom out the page" option (cf #440)
---
_locales/de/messages.json | 4 +
_locales/en/messages.json | 4 +
_locales/es/messages.json | 4 +
_locales/fr/messages.json | 4 +
_locales/ja/messages.json | 4 +
_locales/pl/messages.json | 4 +
_locales/ru/messages.json | 4 +
_locales/uk/messages.json | 4 +
_locales/zh_CN/messages.json | 4 +
_locales/zh_TW/messages.json | 4 +
extension/core/bg/business.js | 2 +-
extension/core/bg/config.js | 1 +
extension/core/content/content-main.js | 6 +
extension/ui/bg/ui-options.js | 6 +
extension/ui/pages/help.html | 7 +
extension/ui/pages/options.html | 4 +
.../hooks/content/content-hooks-frames-web.js | 152 +++++++++++-------
.../hooks/content/content-hooks-frames.js | 18 ++-
.../lazy/content/content-lazy-loader.js | 6 +
lib/single-file/single-file-core.js | 12 ++
20 files changed, 194 insertions(+), 60 deletions(-)
diff --git a/_locales/de/messages.json b/_locales/de/messages.json
index 5b95833ba..270d856bd 100644
--- a/_locales/de/messages.json
+++ b/_locales/de/messages.json
@@ -235,6 +235,10 @@
"message": "maximale Inaktivitätszeit (ms)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "Seite verkleinern",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "Bilder für alternative Bildschirmauflösungen entfernen",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 884149ce4..edf7520df 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -235,6 +235,10 @@
"message": "maximum idle time (ms)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "remove images for alternative screen resolutions",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/es/messages.json b/_locales/es/messages.json
index 6ee074d1c..c39e2f90c 100644
--- a/_locales/es/messages.json
+++ b/_locales/es/messages.json
@@ -235,6 +235,10 @@
"message": "periodo máximo de espera (ms)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "alejar la página",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "eliminar imágenes para resoluciones alternativas de pantalla",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json
index 007890e47..5190860dc 100644
--- a/_locales/fr/messages.json
+++ b/_locales/fr/messages.json
@@ -235,6 +235,10 @@
"message": "temps d'inactivité maximal (ms)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "dézoomer la page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "supprimer les images pour des résolutions d'écran alternatives",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/ja/messages.json b/_locales/ja/messages.json
index 14e5ff591..591b1e223 100644
--- a/_locales/ja/messages.json
+++ b/_locales/ja/messages.json
@@ -235,6 +235,10 @@
"message": "最大アイドル時間(ミリ秒)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "代替画面解像度用の画像を削除します",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/pl/messages.json b/_locales/pl/messages.json
index cd212cf68..3a34b3d18 100644
--- a/_locales/pl/messages.json
+++ b/_locales/pl/messages.json
@@ -235,6 +235,10 @@
"message": "maksymalny czas bezczynności (ms)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "usuwaj obrazy dla alternatywnych rozdzielczości ekranu",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json
index 2ca3aa6d7..f350e617c 100644
--- a/_locales/ru/messages.json
+++ b/_locales/ru/messages.json
@@ -235,6 +235,10 @@
"message": "максимальное время простоя (мс)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "удалить изображения для альтернативных разрешений экрана",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/uk/messages.json b/_locales/uk/messages.json
index 69125874b..35f3ee790 100644
--- a/_locales/uk/messages.json
+++ b/_locales/uk/messages.json
@@ -235,6 +235,10 @@
"message": "максимальний час простою (мс)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "видалити зображення для альтернативних розширень екрану ",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json
index 1309c61f8..503de3bb1 100644
--- a/_locales/zh_CN/messages.json
+++ b/_locales/zh_CN/messages.json
@@ -235,6 +235,10 @@
"message": "最长空闲时间(毫秒)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "移除用于备选分辨率的图片",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/_locales/zh_TW/messages.json b/_locales/zh_TW/messages.json
index 17c421804..0a28a411e 100644
--- a/_locales/zh_TW/messages.json
+++ b/_locales/zh_TW/messages.json
@@ -235,6 +235,10 @@
"message": "最長空閒時間(毫秒)",
"description": "Options page label: 'maximum idle time (ms)'"
},
+ "optionLoadDeferredImagesKeepZoomLevel": {
+ "message": "zoom out the page",
+ "description": "Options page label: 'zoom out the page'"
+ },
"optionRemoveAlternativeImages": {
"message": "移除用於備選分辨率的圖片",
"description": "Options page label: 'remove images for alternative screen resolutions'"
diff --git a/extension/core/bg/business.js b/extension/core/bg/business.js
index cb89a94cb..ec763dfb7 100644
--- a/extension/core/bg/business.js
+++ b/extension/core/bg/business.js
@@ -207,7 +207,7 @@ singlefile.extension.core.bg.business = (() => {
const tabId = taskInfo.tab.id;
const taskId = taskInfo.id;
taskInfo.cancelled = true;
- singlefile.extension.core.bg.tabs.sendMessage(tabId, { method: "content.cancelSave" });
+ singlefile.extension.core.bg.tabs.sendMessage(tabId, { method: "content.cancelSave", resetZoomLevel: taskInfo.options.loadDeferredImagesKeepZoomLevel });
if (taskInfo.cancel) {
taskInfo.cancel();
}
diff --git a/extension/core/bg/config.js b/extension/core/bg/config.js
index c66f376aa..26a59e0b6 100644
--- a/extension/core/bg/config.js
+++ b/extension/core/bg/config.js
@@ -43,6 +43,7 @@ singlefile.extension.core.bg.config = (() => {
loadDeferredImagesMaxIdleTime: 1500,
loadDeferredImagesBlockCookies: false,
loadDeferredImagesBlockStorage: false,
+ loadDeferredImagesKeepZoomLevel: false,
filenameTemplate: "{page-title} ({date-iso} {time-locale}).html",
infobarTemplate: "",
includeInfobar: false,
diff --git a/extension/core/content/content-main.js b/extension/core/content/content-main.js
index 70d6e2dd8..cf6632bbd 100644
--- a/extension/core/content/content-main.js
+++ b/extension/core/content/content-main.js
@@ -56,6 +56,9 @@ this.singlefile.extension.core.content.main = this.singlefile.extension.core.con
ui.onEndPage();
browser.runtime.sendMessage({ method: "ui.processCancelled" });
}
+ if (message.resetZoomLevel) {
+ singlefile.lib.processors.lazy.content.loader.resetZoomLevel();
+ }
return {};
}
if (message.method == "content.getSelectedLinks") {
@@ -141,6 +144,9 @@ this.singlefile.extension.core.content.main = this.singlefile.extension.core.con
if (!processor.cancelled) {
if (event.type == event.RESOURCES_INITIALIZED) {
maxIndex = event.detail.max;
+ if (options.loadDeferredImagesKeepZoomLevel) {
+ singlefile.lib.processors.lazy.content.loader.resetZoomLevel();
+ }
}
if (event.type == event.RESOURCES_INITIALIZED || event.type == event.RESOURCE_LOADED) {
if (event.type == event.RESOURCE_LOADED) {
diff --git a/extension/ui/bg/ui-options.js b/extension/ui/bg/ui-options.js
index 1c6f0e073..5ec2c11bd 100644
--- a/extension/ui/bg/ui-options.js
+++ b/extension/ui/bg/ui-options.js
@@ -42,6 +42,7 @@
const compressCSSLabel = document.getElementById("compressCSSLabel");
const loadDeferredImagesLabel = document.getElementById("loadDeferredImagesLabel");
const loadDeferredImagesMaxIdleTimeLabel = document.getElementById("loadDeferredImagesMaxIdleTimeLabel");
+ const loadDeferredImagesKeepZoomLevelLabel = document.getElementById("loadDeferredImagesKeepZoomLevelLabel");
const addMenuEntryLabel = document.getElementById("addMenuEntryLabel");
const filenameTemplateLabel = document.getElementById("filenameTemplateLabel");
const filenameMaxLengthLabel = document.getElementById("filenameMaxLengthLabel");
@@ -118,6 +119,7 @@
const compressCSSInput = document.getElementById("compressCSSInput");
const loadDeferredImagesInput = document.getElementById("loadDeferredImagesInput");
const loadDeferredImagesMaxIdleTimeInput = document.getElementById("loadDeferredImagesMaxIdleTimeInput");
+ const loadDeferredImagesKeepZoomLevelInput = document.getElementById("loadDeferredImagesKeepZoomLevelInput");
const contextMenuEnabledInput = document.getElementById("contextMenuEnabledInput");
const filenameTemplateInput = document.getElementById("filenameTemplateInput");
const filenameMaxLengthInput = document.getElementById("filenameMaxLengthInput");
@@ -437,6 +439,7 @@
compressCSSLabel.textContent = browser.i18n.getMessage("optionCompressCSS");
loadDeferredImagesLabel.textContent = browser.i18n.getMessage("optionLoadDeferredImages");
loadDeferredImagesMaxIdleTimeLabel.textContent = browser.i18n.getMessage("optionLoadDeferredImagesMaxIdleTime");
+ loadDeferredImagesKeepZoomLevelLabel.textContent = browser.i18n.getMessage("optionLoadDeferredImagesKeepZoomLevel");
addMenuEntryLabel.textContent = browser.i18n.getMessage("optionAddMenuEntry");
filenameTemplateLabel.textContent = browser.i18n.getMessage("optionFilenameTemplate");
filenameMaxLengthLabel.textContent = browser.i18n.getMessage("optionFilenameMaxLength");
@@ -620,6 +623,8 @@
loadDeferredImagesInput.checked = profileOptions.loadDeferredImages && !profileOptions.saveRawPage;
loadDeferredImagesInput.disabled = profileOptions.saveRawPage;
loadDeferredImagesMaxIdleTimeInput.value = profileOptions.loadDeferredImagesMaxIdleTime;
+ loadDeferredImagesKeepZoomLevelInput.checked = profileOptions.loadDeferredImagesKeepZoomLevel && !profileOptions.saveRawPage;
+ loadDeferredImagesKeepZoomLevelInput.disabled = !profileOptions.loadDeferredImages || profileOptions.saveRawPape;
loadDeferredImagesMaxIdleTimeInput.disabled = !profileOptions.loadDeferredImages || profileOptions.saveRawPage;
contextMenuEnabledInput.checked = profileOptions.contextMenuEnabled;
filenameTemplateInput.value = profileOptions.filenameTemplate;
@@ -696,6 +701,7 @@
compressCSS: compressCSSInput.checked,
loadDeferredImages: loadDeferredImagesInput.checked,
loadDeferredImagesMaxIdleTime: Math.max(loadDeferredImagesMaxIdleTimeInput.value, 0),
+ loadDeferredImagesKeepZoomLevel: loadDeferredImagesKeepZoomLevelInput.checked,
contextMenuEnabled: contextMenuEnabledInput.checked,
filenameTemplate: filenameTemplateInput.value,
filenameMaxLength: filenameMaxLengthInput.value,
diff --git a/extension/ui/pages/help.html b/extension/ui/pages/help.html
index e89ca09fc..85bbb723f 100644
--- a/extension/ui/pages/help.html
+++ b/extension/ui/pages/help.html
@@ -267,6 +267,13 @@
Save a complete page into a single HTML file
for example the network or system conditions are degraded. You can also decrease this value
otherwise.
+
Option: zoom out
+ the page
+
Check this option to save the entire content of a page by zooming out the page. This can help
+ saving pages using infinite virtual lists for example.
+
+
It is recommended to uncheck this option
+
Option: remove images
for alternative screen resolutions
Check this option to remove images that are alternatives in lower and/or higher resolutions
diff --git a/extension/ui/pages/options.html b/extension/ui/pages/options.html
index 557738b7b..f8ab892f8 100644
--- a/extension/ui/pages/options.html
+++ b/extension/ui/pages/options.html
@@ -135,6 +135,10 @@