Rank: Newbie Groups: Member
Joined: 9/21/2021 Posts: 4
|
I'm using v21.2.47.0 and am getting a 'DOMException: Read permission denied' exception when accessing navigator.clipboard.readText(). Even though the documentation says AllowJavaScriptAccessClipboard defaults to true I've also set that explicitly via SetOptions(). Here is the example HTML I am loading
Code: HTML/ASPX
<html>
<button onclick="myFunction()">Click me</button>
<script>
async function myFunction()
{
txt = await navigator.clipboard.readText();
alert(txt);
}
</script>
</html>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This permission is controlled by WebView.RequestPermissions event. You need to handle that event and call e.Allow() in your event handler. AllowJavaScriptAccessClipboard only controls the more "traditional" way of accessing clipboard by calling document.execCommand("copy").
Thanks!
|