Browse Source

fixed download issue when save pages in background is disabled

Gildas 7 years ago
parent
commit
89a3fdaaa4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      extension/core/content/content.js

+ 2 - 2
extension/core/content/content.js

@@ -18,7 +18,7 @@
  *   along with SingleFile.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* global browser, SingleFileBrowser, singlefile, frameTree, document, MouseEvent, addEventListener, window, lazyLoader, URL, setTimeout, docHelper */
+/* global browser, SingleFileBrowser, singlefile, frameTree, document, MouseEvent, addEventListener, window, lazyLoader, URL, setTimeout, docHelper, Blob */
 
 this.singlefile.top = this.singlefile.top || (() => {
 
@@ -178,7 +178,7 @@ this.singlefile.top = this.singlefile.top || (() => {
 			const link = document.createElement("a");
 			document.body.appendChild(link);
 			link.download = page.filename;
-			link.href = page.url;
+			link.href = URL.createObjectURL(new Blob([page.content], { type: "text/html" }));
 			link.dispatchEvent(new MouseEvent("click"));
 			link.remove();
 			URL.revokeObjectURL(page.url);