Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add Ability to Copy Images and Image URLs into the Clipboard #768

Merged
merged 14 commits into from
Aug 4, 2021
Prev Previous commit
remove feature gate, use filter
George-lewis committed Aug 3, 2021
commit eac18217db80eb322e19ba92e5997d3c0d254b22
3 changes: 0 additions & 3 deletions js/hoverzoom.js
Original file line number Diff line number Diff line change
@@ -2116,9 +2116,6 @@ var hoverZoom = {
const url = imgDetails.url;
if(!url) return;

const supported = window.ClipboardItem && navigator.clipboard.write;
if (!supported) return;

fetch(url)
.then(resp => resp.blob())
.then(blob => blob.arrayBuffer())
10 changes: 3 additions & 7 deletions js/options.js
Original file line number Diff line number Diff line change
@@ -33,13 +33,9 @@ function keyCodeToString(key) {
const chromiumOnly = ['copyImageKey', 'copyImageUrlKey'];

function initActionKeys() {
actionKeys.forEach(key => {
if (chromiumOnly.includes(key)) {
if (!isChromiumBased) {
return;
}
}

actionKeys
.filter(key => isChromiumBased || !chromiumOnly.includes(key))
.forEach(key => {
var id = key[0].toUpperCase() + key.substr(1);
var title = chrome.i18n.getMessage("opt" + id + "Title");
var description = chrome.i18n.getMessage("opt" + id + "Description");