-1
I have a input within a Iframe on a page .html in https with the event onclick calling a function:
<input type="text" value="" id="TXT_PROTOCOLO" placeholder="Clique para colar o protocolo" onclick="pasteClipboard(this)" />
Being the function pasteClipboard:
function pasteClipboard(e)
{
navigator.clipboard.readText().then(text =>
{
console.log('Clipboard text: ', text);
e.value = text;
})
.catch(err =>
{
console.error(err);
});
}
The above code works normally on Chrome, but not on Cefsharp.
I tried to modify/add some properties of the type variable BrowserSettings in the creation of the type variable ChromiumWebBrowser, i and..:
chromeBrowser = new ChromiumWebBrowser(ConfigurationManager.AppSettings.Get("startupUrl"))
{
// Adicionando outras configurações ao browser
BrowserSettings = new BrowserSettings
{
JavascriptAccessClipboard = CefState.Enabled,
JavascriptDomPaste = CefState.Enabled
}
};
I thought enabling JavascriptAccessClipboard and JavascriptDomPaste for the browser to solve the problem (it seems self-explanatory), but is always expelled in the console one DOMException:
I’ve had problems enabling access to the microphone, even using the flag enable-media-stream and I was only able to solve it when I put the executable in the list of trusted applications of Kaspersky Endpoint Security for Windows. So I believe it has nothing to do with the antivirus or maybe I should use another way to paste the text from clipboard in the input.

have any information on Exception ? already tested on other computer without Kaspersky ?
– Rovann Linhalis
@Rovannlinhalis I could only find out that the antivirus was blocking the microphone when I tested it on a test machine. The behavior persisted even on this machine without Kaspersky. Already the expelled Exception is always without details (I will edit the post with an image)
– ivansnpmaster