Page 1 of 1

Allow to clipboard reading

Posted: Sat Jul 18, 2020 6:14 pm
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

Re: Allow to clipboard reading

Posted: Sun Jul 19, 2020 9:06 am
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