Surfingkeys icon indicating copy to clipboard operation
Surfingkeys copied to clipboard

Feature: Copy image to clipboard

Open Riveascore opened this issue 1 year ago • 2 comments

Similar to ;di, activate mode where you can pick which image to copy to clipboard.

Riveascore avatar Mar 28 '23 14:03 Riveascore

I'd like this feature because I copy images a lot. I searched for code to do that online, found this:

https://stackoverflow.com/a/59461882/3942284

function copyElementToClipboard(element) {
  window.getSelection().removeAllRanges();
  let range = document.createRange();
  range.selectNode(typeof element === 'string' ? document.getElementById(elementName) : element);
  window.getSelection().addRange(range);
  document.execCommand('copy');
  window.getSelection().removeAllRanges();
 }

I don't know how to integrate this into surfingkeys though, I don't do web development. I tried searching in surfingkey's code for 5 min, but I could not find where and how to plug this.

@Riveascore would you know how to proceed?

Gattocrucco avatar Dec 27 '23 09:12 Gattocrucco

I found an alternative to surfingkeys with this feature:

https://github.com/gdh1995/vimium-c

Gattocrucco avatar Jan 12 '24 19:01 Gattocrucco