I have reproduced the problem on my machine, but I think this is a Windows behavior, and we can't set using selenium.
From this article, we can see that:
How to allow a website to use your camera or microphone while browsing in Microsoft Edge
You can use your camera and microphone for websites in Microsoft Edge. However, even when your camera and microphone are enabled for Microsoft Edge, you will still need to give individual websites permission before they can use your camera and microphone. Here’s how:
- Go to a website that wants to use your microphone and/or camera.
- If a dialog box appears asking if you want to give the website permission to use your camera or microphone, select Allow once or Always allow, or close the dialog box to block access.
After allowed the permission, we can find this permission under the Manage permissions (Edge browser setting => Advanced => Manage permissions), screenshot as below:
From your description, when Edge browser exit, you will clear sessions, cookie and cache, if you don't want to allow, the permission every time, you could uncheck the Website Permissions option (screenshot as below), the permission prompts will only show when we first visit the page.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…