Extensions Blog Press Contribute Support FAQ Videos Changelog About Contact English Dark mode
Chrome extensions you can't live without!
Extensions Blog Press Contribute Support FAQ Videos About Contact

I can't paste the image from Clipboard

Hi. I right click the image and select "Copy Image", but when I paste in a Word document (for example) nothing appears. I think is something related to the URL file because it's a local file when I copy an image in a normal site the paste works.

Good job anyway.

Comments

  • Now I saw the other discussion on the same topic.

    You can improve this functionality adding a real copy button to the clipboard. I am also extension developer, I didn't research how it could be done but I see that the tinyMCE editor can copy an image to the clipboard, you can search its code. It would need the clipBoard permissions of course.




  • I try every few months, but it seems the extension API is unable to perform the task, if you manage please let me know.
  • There are no clipboard methods in the extensions API but I found some native code:

    https://css-tricks.com/native-browser-copy-clipboard/

    I change the codepen example to:

    https://codepen.io/OscarDeDios/pen/mpLEGV

    I think it can work in a chrome extension if you add the clipboard permissions in the manifest.



  • Yeah i've been down the same code many times, for some reason, even with the permissions the Chrome extension is not allowing. I encourage you try to a sample extension and play with it, it would definitely be a big plus if we could get it working.
  • I tried to move the code to an extension. And it works with an external image (http://...), but a local image (chrome-extension://..) not.

    If you want to play:
    https://github.com/OscarDeDios/copyToClipboardChromeExtension

    I'll think about it...


  • Maybe it's a weird idea but due that it works with images in servers I'm thinking in the possibility that once the user clicks in the copy button you can upload the image to your server and change the image in the DOM with the new https://... image, then copy to the clipboard. It would take some seconds but with some ajax animation it could be usable. (at the end you can delete the image)

    You would have to request for permissions to this external host (could be optional only ask in the first copy).

    I know it's not clean, but the copy feature is important (for me very important to use your extension).


  • So the current right click to copy feature does actually work in many scenarios, including Paint, Google Docs and Gmail of which I use most often.
    But I am following this experimental api and waiting for it to go to stable https://developer.chrome.com/apps/clipboard
  • Yes, I see, it works in gmail that it's important. Not working in Microsoft outlook and Word important for me.
  • Following, to see if there is any viable solution. It's a pain in the rear having to paste into Paint, to then be able to copy/paste into any Office app (Word, Outlook, etc)
  • @RichardMoticska I just tested and it works in Word Online, perhaps an alternative solution. https://onedrive.live.com
  • Yes, it might work online, but I don't use that as I have the full Office365 Suite installed on my laptop and many times need to paste screenshots into Word or Outlook.
This website uses cookies to ensure you get the best experience on our website. More info
Got it!