Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Allow to clipboard reading

Post Reply
yesilcimenahmet
Posts: 10
Joined: Wed Jul 08, 2020 1:25 pm

Allow to clipboard reading

Post by yesilcimenahmet »

Hi,

How can I allow "See text and images you copy to the clipboard" message in CEF ?

I need to allow it because my JS library is reading text and images to paste to canvas.

I looked at the events but I couldn't see any event about the permissions.

I am using navigator!

like this;

Code: Select all

navigator.permissions.query({ name: "clipboard-read" }).then(result => {
        if (result.state == "granted" || result.state == "prompt") {
		navigator.clipboard.read().then(data => {
			.......
		});
	}
});
Thanks.

Image
User avatar
salvadordf
Posts: 4575
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Allow to clipboard reading

Post by salvadordf »

That feature is not implemented yet but the CEF project has a feature request about it :
https://bitbucket.org/chromiumembedded/ ... pboard-api

This proposal also references that feature request :
https://bitbucket.org/chromiumembedded/ ... -callbacks

I would suggest you search for alternative ways to do what you need. :(

IF this is part of the "Content Security Policy" then perhaps you can remove the HTTP header.
(Notice that I used a big IF because I'm not a JavaScript expert.)

These pages have some more information about the Content Security Policy and the clipboard access :
viewtopic.php?t=388
https://www.magpcss.org/ceforum/viewtop ... =6&t=16749
https://magpcss.org/ceforum/viewtopic.php?f=6&t=17596
https://stackoverflow.com/questions/379 ... f-cefsharp
Post Reply