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

copy image to clipboard fails on paste #7388

Closed
larry5b6 opened this issue Feb 25, 2017 · 24 comments · Fixed by #13108
Closed

copy image to clipboard fails on paste #7388

larry5b6 opened this issue Feb 25, 2017 · 24 comments · Fixed by #13108

Comments

@larry5b6
Copy link

  • Did you search for similar issues before submitting this one?
    yes

  • Describe the issue you encountered:
    Right click and Copy Image, then attempt to paste image into Thunderbird 45.7.1 email message. No action. Paste image into windows paint, copy from there, and then past into Thunderbird works fine. Not a Thunderbird issue - this works correctly with Firefox, Chrome, and MSIE.

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Windows 7 home edition 64 bit, Service Pack 1

  • Brave Version (revision SHA):
    Brave 0.13.4
    rev 71d8ffc
    Muon 2.56.4
    libchromiumcontent 56.0.2924.87
    V8 5.6.326.50
    Node.js 7.4.0
    Update Channel dev
    os.platform win32
    os.release 6.1.7601
    os.arch x64

  • Steps to reproduce:
    (see above)

  • Actual result:
    Image does not paste

  • Expected result:
    Image pastes

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    yes

  • Is this an issue in the currently released version?
    yes

  • Can this issue be consistently reproduced?
    Yes

  • Extra QA steps:
    1.
    2.
    3.

  • Screenshot if needed:

  • Any related issues:

@bsclifton bsclifton added needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. misc/clipboard labels Mar 1, 2017
@bsclifton
Copy link
Member

This is a good one- it would be nice to test and see what the raw clipboard contents are

@larry5b6 would you be able to download a free Windows clipboard viewer (there are tons available- any that you feel comfortable with) to try this out with?

The data is obviously there... I suspect it's a formatting issue. The metadata in the clipboard might not be understood by Thunderbird

@bsclifton bsclifton added needs-info Another team member needs information from the PR/issue opener. and removed needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. labels Mar 1, 2017
@JamborJan
Copy link

Hey guys, I'm experiencing the same issue but with macOS. Additionally I have a lot of trouble with right click and saving images. Nearly always the result is "aborted" immediately.

Please let me know what I can do to help tracking down this issue.

@scottbroadway
Copy link

Whenever I click 'Copy Image', it pastes only the URL. I didn't click on 'Copy Image Address'.

@scottbroadway
Copy link

This issue is still present in 0.14.0...and it doesn't seem like it's scheduled to be fixed at all.

@cndouglas
Copy link

@scottbroadway Where are you trying to paste the image?

@larry5b6
Copy link
Author

larry5b6 commented Mar 31, 2017 via email

@scottbroadway
Copy link

Still failing in 0.15.0.

@eljuno
Copy link
Contributor

eljuno commented Jun 24, 2017

+1 from community -- it's paste image link, not the image itself.

In Chrome it is often that I find an image on a website, right click, and select "copy image." I can then actually paste the image into a Facebook message, photo editor, etc.

The current behavior in Brave "0.16.12 rev 72624a2" is to paste the image's link rather than the image itself.

@srirambv srirambv added this to the 0.19.x (Nightly Channel) milestone Jun 26, 2017
@alexwykoff alexwykoff removed this from the 0.19.x (Beta Channel) milestone Jul 18, 2017
@Kagetsuki
Copy link

Confirming on Ubuntu 16 and 17.

Don't mean to "me too" but this is actually the only thing preventing me from abandoning FF as my primary browser. I constantly paste images from the clipboard during my work day.

@luixxiul
Copy link
Contributor

@eljuno
Copy link
Contributor

eljuno commented Sep 10, 2017

@CapitanPlanet
Copy link

+1 from me. Buttons "copy image" and "copy image address" have the same result. Both coping images URL.

@jonathansampson
Copy link
Collaborator

+1 (I believe) from Twitter: https://twitter.com/weems/status/934965671166869504

Also, @too4words reported seeing something similar in Brave recently.

@bsclifton bsclifton added this to the Triage Backlog milestone Nov 27, 2017
@eljuno
Copy link
Contributor

eljuno commented Dec 6, 2017

@yordan-kanchelov
Copy link

+1

@bsclifton
Copy link
Member

+1 from @JMccormick264 via #12540

  1. I am doing this from the latest commits from github.
  2. Go to google images, or Imgur, or any image hosting site. (I only checked those two)
  3. Find an image
  4. Right click on it and press "Copy Image".
  5. Go to an app that can paste images. I used Discord and Telegram
  6. Paste the image
  7. If you had copied something before the image, you will see that paste instead of the image you just copied.

brave copy and paste issue

Reproduces 100% of the time in the latest commits from GitHub (667f95d); does not reproduce in latest release channel version (0.19.123)

@vonBarbarosa
Copy link

+1

currently using latest windows x64 version downloaded from main website (0.20.29). It seems like copying image on Brave doesn't overwrite previously copied thing, because when I paste it, the previously copied thing shows up.

@Testa0
Copy link

Testa0 commented Feb 4, 2018

+1

Windows 7, latest brave version. Right click "copy image address" works and copying text works but not "copy image" instead it shows the last thing on the clipboard.
I can copy images fine from other browsers.

@StephenBass
Copy link

@bbondy
Copy link
Member

bbondy commented Feb 12, 2018

I think we need to change the way we're copying images since one of the chromium updates.

The console error is:

gen/app.entry.js:39 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
    at Image.o.onload (chrome://brave/Applications/Brave.app/Contents/Resources/app.asar/app/extensions/brave/gen/app.entry.js:39:183473)
o.onload @ gen/app.entry.js:39

The way we used to copy is from the Window renderer:

module.exports.getBase64FromImageUrl = (url) => {
  return new Promise((resolve, reject) => {
    const img = new window.Image()
    img.onerror = function () {
      reject(new Error('unable to load image'))
    }
    img.onload = function () {
      const canvas = document.createElement('canvas')
      canvas.width = this.naturalWidth
      canvas.height = this.naturalHeight
      canvas.getContext('2d')
        .drawImage(this, 0, 0)
      resolve(canvas.toDataURL('image/png'))
    }
    img.src = url
  })
}

I think it is tainted because it's cross origin from what the window renderer is.

@bbondy
Copy link
Member

bbondy commented Feb 12, 2018

I think it should be dispatching an action to the app store and using the web-contents copyImageAt API instead.

@bbondy bbondy modified the milestones: Triage Backlog, 0.21.x (Beta Channel) Feb 12, 2018
@darkdh darkdh self-assigned this Feb 12, 2018
darkdh added a commit that referenced this issue Feb 12, 2018
fix #7388

Auditors: @bbondy, @bsclifton

Test Plan:
1. Go to https://www.brave.com/about/images/brave_icon_512x.png
2. Click "Copy Image" from context menu
3. The image should be copied to your clipboard instead of url
4. Paste it to somewhere else like slack channel to verify
@bsclifton bsclifton modified the milestones: 0.21.x (Beta Channel), 0.20.x Release 2 (Referral Promotion) Feb 12, 2018
@kjozwiak kjozwiak added release-notes/include and removed needs-info Another team member needs information from the PR/issue opener. labels Feb 13, 2018
@srirambv
Copy link
Collaborator

Copy paste works on new email using thunderbird for Windows.

@LaurenWags
Copy link
Member

Copy/Paste of images from several sources to gmail, facebook, etc worked on MacOS

@btlechowski
Copy link
Contributor

Verified

Brave: 0.20.42 
V8: 6.4.388.41 
rev: 096c7cb3c75ebb518f72fc7d24bc2bbaedd50aed 
Muon: 4.8.2 
OS Release: 4.13.0-21-generic 
Update Channel: Release 
OS Architecture: x64 
OS Platform: Linux 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.