Skip to content

Commit

Permalink
2.3.1: * fixed screenshot not working if option for file/clipboard no…
Browse files Browse the repository at this point in the history
…t set

* removed unneeded clipboardRead permission
  • Loading branch information
FutureMillennium committed Feb 3, 2020
1 parent fe74761 commit 93b40e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -29,7 +29,6 @@
"https://www.youtube.com/*",
"webNavigation",
"storage",
"clipboardWrite",
"clipboardRead"
"clipboardWrite"
]
}
9 changes: 6 additions & 3 deletions extension/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 93b40e2

Please sign in to comment.