Skip to content

Clipboard doesn't work in a webview #8170

Closed
@Sunvas

Description

@Sunvas

Current/Missing Behavior

navigator.clipboard.writeText doesn't work in webviews. See how to reproduce section for demo.

Expected/Proposed Behavior

It should work

Additional Info

  • Operating System: any
  • NW.js Version: 0.85
  • Code snippet: included

How to reproduce

package.json

{
	"main": "/main.html",
	"name": "demo"
}

main.html

<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Demo</title>
</head>
<body style="width:100vw;height:100vh">
	<h2>Clipboard doesn't work in webviews:</h2>
	<webview style="width:100%;height:100%" src="https://www.w3schools.com/howto/howto_js_copy_clipboard.asp"></webview>
</body>
</html>

Demo opens page with live demostraion of "Copy Text to Clipboard" which perfectly works in browser, but doesn't work in webviews.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions