diff --git a/extension/manifest.json b/extension/manifest.json index 90bc636..80baf63 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Screenshot YouTube", - "version": "2.3.0", + "version": "2.3.1", "description": "Take a screenshot of any YouTube video with one click.", "icons": { @@ -29,7 +29,6 @@ "https://www.youtube.com/*", "webNavigation", "storage", - "clipboardWrite", - "clipboardRead" + "clipboardWrite" ] } diff --git a/extension/page.js b/extension/page.js index 5cfd3d2..3b8332d 100644 --- a/extension/page.js +++ b/extension/page.js @@ -58,13 +58,13 @@ function CaptureScreenshot() { downloadLink.download = title; canvas.toBlob(async function (blob) { - if (screenshotFunctionality == 0 || screenshotFunctionality == 2) { + if (screenshotFunctionality === 0 || screenshotFunctionality === 2) { // download downloadLink.href = URL.createObjectURL(blob); downloadLink.click(); } - if (screenshotFunctionality == 1 || screenshotFunctionality == 2) { + if (screenshotFunctionality === 1 || screenshotFunctionality === 2) { // clipboard const clipboardItemInput = new ClipboardItem({ "image/png": blob }); await navigator.clipboard.write([clipboardItemInput]); @@ -171,7 +171,10 @@ activePBRButton = speed1xButton; chrome.storage.sync.get(['screenshotKey', 'playbackSpeedButtons', 'screenshotFunctionality'], function(result) { screenshotKey = result.screenshotKey; playbackSpeedButtons = result.playbackSpeedButtons; - screenshotFunctionality = result.screenshotFunctionality; + if (result.screenshotFunctionality === undefined) + screenshotFunctionality = 0; + else + screenshotFunctionality = result.screenshotFunctionality; }); document.addEventListener('keydown', function(e) {