Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Add Copying an Image Directly to the Clipboard Through the Context Menu #1174

Closed
Mrfiregem opened this issue Mar 25, 2016 · 9 comments
Closed
Assignees
Milestone

Comments

@Mrfiregem
Copy link

In most other browsers, you're able to copy an image directly to the clipboard through the context menu by right-clicking it, but in Brave you can't do that. I know copying the image link was recently added to the context menu but it'd be nice to have this feature as well

@bradleyrichter bradleyrichter added this to the 0.9.4dev milestone Apr 25, 2016
@bbondy bbondy removed this from the 0.10.1dev milestone May 26, 2016
@cezaraugusto cezaraugusto added enhancement needs-info Another team member needs information from the PR/issue opener. labels Jun 17, 2016
@bradleyrichter bradleyrichter added the help wanted The PR/issue opener needs help to complete/report the task. label Jul 1, 2016
@bradleyrichter
Copy link
Contributor

let's get this party started!

image

@bsclifton ? : )

@bsclifton
Copy link
Member

This would be a good one, self assigning 😄 I was thinking about doing this the other day (along with adding Search with this image)

@bsclifton
Copy link
Member

This one ended up not being as easy as I initially thought. The electron webContents object does have a hasImageContent boolean when the context-menu event is fired and it's also easy to get the URL. However, I'm not sure how to get the image into the clipboard.

I tried loading the URL into a nativeImage object and using clipboard.writeImage(imageObjectHere), but was not successful (DataURL is a typo on their part, it's not actually a URL- it's supposed to be in Data URI format.

Any advice on what to look at? Hoping I'm missing something obvious

cc: @bbondy @bridiver

@bbondy
Copy link
Member

bbondy commented Jul 2, 2016

You can get a data URL from an image if you create a canvas element, draw an image to it and use <canvas>.toDataURL. Here's some relevant code, but I don't think you need to actually insert it into the DOM (although, maybe you do temporarily, not 100% sure).

Also for this type of task (clipboards & drag'n drop) it's useful to use a clipboard viewer program and compare to the other browsers. There are a lot of little free apps that do that out there, just grab one of those.

bbondy added a commit that referenced this issue Jul 10, 2016
I mainly just implemented what I suggested in issue #1174

Fix #1174

Auditors: @diracdeltas
@bbondy bbondy assigned bbondy and unassigned bsclifton Jul 10, 2016
@bbondy
Copy link
Member

bbondy commented Jul 10, 2016

Sorry for jumping in @bsclifton, just happened to try what I suggested and it worked. Hope you don't mind!

@bbondy bbondy added this to the 0.11.1dev milestone Jul 10, 2016
@bsclifton
Copy link
Member

It's all good, I had forgotten about this 😄

bbondy added a commit that referenced this issue Jul 10, 2016
I mainly just implemented what I suggested in issue #1174

Fix #1174

Auditors: @diracdeltas
@BrendanEich
Copy link
Member

Sweet!

@luixxiul
Copy link
Contributor

luixxiul commented Jul 20, 2016

It seems that it does not work on Ubuntu 14.04. You cannot paste image on Gimp #2585

@bbondy
Copy link
Member

bbondy commented Jul 20, 2016

You might want to try to make sure the same works on chrome, it is probably the same data clipboard format. It might just be Gimp on Ubuntu not supporting the paste format. If it's an issue though just post a new issue and reference this one.

@luixxiul luixxiul removed the needs-info Another team member needs information from the PR/issue opener. label Nov 16, 2016
@luixxiul luixxiul added feature/context-menu and removed enhancement help wanted The PR/issue opener needs help to complete/report the task. labels Jan 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants