Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Camera and microphone do not work in iframes #8235

Open
Sunvas opened this issue Nov 14, 2024 · 3 comments
Open

[bug] Camera and microphone do not work in iframes #8235

Sunvas opened this issue Nov 14, 2024 · 3 comments
Labels

Comments

@Sunvas
Copy link

Sunvas commented Nov 14, 2024

Current/Missing Behavior

Neither camera nor microphone work in iframe.

Expected/Proposed Behavior

They should work

Additional Info

  • Operating System: any
  • NW.js Version: 0.93 (the latest)
  • Code snippet: see below

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>
	<script>
chrome.contentSettings.camera.set({
	primaryPattern:"https://webcamtests.com/*",
	scope: "regular",
	setting: "allow"
});
	</script>
</head>
<body style="width:100vw;height:100vh">
	<h2>Camera doesn't work in webviews and iframes:</h2>
	<iframe style="width:100%;height:100%" src="https://webcamtests.com" allow="camera https://webcamtests.com; microphone https://webcamtests.com"></iframe>
</body>
</html>

Demo opens Webcam Test which perfectly shows that neither camera nor microphone can be even detected.

@Sunvas Sunvas changed the title [bug] Camera and microphone do not work in iframe [bug] Camera and microphone do not work in iframes Nov 14, 2024
@ayushmanchhabra
Copy link
Contributor

https://blog.addpipe.com/camera-and-microphone-access-in-cross-oirigin-iframes-with-feature-policy/
A quick internet search brought me to this. Please go through this and see if it helps

@Sunvas
Copy link
Author

Sunvas commented Nov 16, 2024

@ayushmanchhabra No, that doesn't help. Everyhing is correct with my iframe definition: it works in a regular environment.

@Sunvas
Copy link
Author

Sunvas commented Nov 17, 2024

Clipboard also doesn't work in iframe. Have mentioned this in #8170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants