From 06fbfda8c9b2ec7ef93713576c23e0215b8b78f5 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Tue, 31 Jul 2018 01:22:26 +0530 Subject: [PATCH] eslint fixes --- src/takeScreenshot.js | 4 ++-- src/utils.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/takeScreenshot.js b/src/takeScreenshot.js index 6abbd64..8706e29 100644 --- a/src/takeScreenshot.js +++ b/src/takeScreenshot.js @@ -48,7 +48,7 @@ function saveScreenshot(dataURI) { // anymore. return window.open(filePath); - chrome.downloads.download( + /* chrome.downloads.download( { url: filePath }, @@ -59,7 +59,7 @@ function saveScreenshot(dataURI) { window.open(filePath); } } - ); + ); */ } function errorHandler(e) { diff --git a/src/utils.js b/src/utils.js index e5fc6d6..4f5e495 100644 --- a/src/utils.js +++ b/src/utils.js @@ -212,9 +212,13 @@ export function downloadFile(fileName, blob) { a.click(); a.remove(); } - if (false && window.IS_EXTENSION) { - chrome.downloads.download( - { + + // HACK: because chrome.downloads isn't working on optional permissions + // anymore. + downloadWithAnchor(); + + /* if (false && window.IS_EXTENSION) { + chrome.downloads.download({ url: window.URL.createObjectURL(blob), filename: fileName, saveAs: true @@ -228,7 +232,7 @@ export function downloadFile(fileName, blob) { ); } else { downloadWithAnchor(); - } + } */ } export function writeFile(name, blob, cb) {