Trying to create a chrome extension (manifest v.3) that can record screen. The flow is:
Here is the code (https://stackblitz.com/edit/web-platform-mxfsyx?file=index.html):
But its throwing error: NotAllowedError: Invalid state
It works fine If I replace tabs[0] with sender.tab in background.js. But then it shows the desktop/window chooser on the background page which I don't want. I want to record the current active tab. I am handling it in background page so even the page is refresh/closed the video recording continues.