From aceb6f0ab1d9251bc7adc3d6c506b654f224894f Mon Sep 17 00:00:00 2001 From: Deil Date: Sun, 4 Nov 2018 17:21:37 +0200 Subject: [PATCH] fixed getting content-type for unknown filename; allow hotkeys only when button is fully visible --- js/content-script.js | 2 +- js/download.js | 2 +- manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/content-script.js b/js/content-script.js index dab4888..c861cdf 100644 --- a/js/content-script.js +++ b/js/content-script.js @@ -172,7 +172,7 @@ const de_button = { }, isVisible: function(){ - return this.elem.classList.contains('visible'); + return this.elem.classList.contains('visible') && !this.elem.matches('.shy:not(:hover)'); }, emulateClick: function(buttonCode = 0){ diff --git a/js/download.js b/js/download.js index a32c2a9..1e9f754 100644 --- a/js/download.js +++ b/js/download.js @@ -54,7 +54,7 @@ const downloader = { const request = new XMLHttpRequest(); request.open(requestType, downloadRequest.src); request.onload = () => { - if (requestType === 'HEAD' && request.status === 501) { // HEAD request method is not implemented by server + if (requestType === 'HEAD' && [405, 501].includes(request.status)) { // HEAD request method is not allowed / not implemented by server this.getHeadersAndDownload(downloadRequest, tabId, 'GET'); return; } diff --git a/manifest.json b/manifest.json index 2451ea3..b6471b9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Cute Save Button", - "version": "0.6.0", + "version": "0.6.1", "description": "__MSG_extensionDescription__", "author": "Deil", "default_locale": "en",