Can I record browser screen without user permission? - webrtc

I have requirement to record browser or tab with audio. Currently I can able to record browser and audio using chrome extension. But the problem is, I need to ask user to click on chrome extension every time.
So is there any way to record tab/browser with audio without asking user approval?
Please assist.

No. Chrome values the user desire to control their own computer higher than your desire to record their actions.
See also https://w3c.github.io/mediacapture-screen-share/#active-user-consent for the privacy considerations around this.

Related

How to handle Micro Popup in Webdriver.io browser

When starting a website, I find it difficult to click Block button on Microphone popup because I can't query this popup (and also with block btn)
How can I handle this problem with Webdriver.io in browser?
enter image description here
One option is to use chrome command line switches. You can find the list here.
The one you are looking for is use-fake-device-for-media-stream. You can set this in your config file so that every time the chrome is launched, it won't show this popup since it is already set to a fake device.

Can Selenium handle Browser Notifications in the OS?

In the screenshot below, I make a VoIP call from an incognito window to an account logged in in a normal Chrome window that is minimised. Therefore I receive the Chrome notification in the bottom right corner.
I am tasked with creating a front-end test to validate the text in the notification window, that would work for Windows, Linux, and MacOS situations.
Now this may or may not be a silly question, but is there a way that selenium can handle tasks related with this notification, for example validating the text that appears in it? I can't find anything online and I understand it is not a DOM element, so I wonder if it is even possible. Could someone provide a basic start point for finding this non DOM notification element if it is possible / how to go about testing it in the front end if selenium is not the answer? TIA.
Notification example

chrome command line flag for auto sharing system sound

I am developing web automation of Zoom meeting (all the way from creation till joining and leaving thereon).
I have been able to complete the creation, joining and screen sharing automation.
I am using --auto-select-desktop-capture-source=MyTab flag to automatically share the desired tab. Up until here, its all working fine.
Where I am stuck is that the chrome tab gets shared without system sound.
I want to automatically share the screen/tab along with system sound / tab audio.
What is the appropriate chrome flag for sharing audio along with screen?

application is not able to record sound while the selenium script runs in headless mode

I have a web app that records sound when the user presses a button. I created a selenium script that clicks on the element to record the sound. It works perfectly except in headless mode. The script log shows that the element was pressed but the result is an empty sound file.
Is there a chromedriver option that would allow for it to record sound while in headless mode? I am thinking that the mic is not picking up sound or gets muted(?). This is probably a very limited use case. I searched quite a bit but could not find anybody with similar issues.
Thanks for your help

Chrome API - detect tab with user input

I've noticed instinctively that with too many tabs open, Chrome tends to prioritze suspending those WITHOUT user inputted data -- like form fields, composing a message, writing a comment, etc., to save on RAM.
Is this true?
And is there a way to detect which tabs have user inputted data via the Chrome Extension API?
Thanks :)