I would like to get the audio feed of a firefox tab by calling getDisplayMedia()
from an extension's popup.js but even when directly called from an html button's click event it returns:
DOMException: The request is not allowed by the user agent or the platform in the current context.
and if I catch it:
NotAllowedError: The request is not allowed by the user agent or the platform in the current context.
Here is a minimal example where it should work: Keep running the screen recording even after the web extension is not visible on the screen but I get the same error when I try to run the code.
I have tried calling getDisplayMedia()
from a content script by sending a message with sendMessage()
from the popup to the script but the call has to be made directly from a user interaction so it doesn't work. From my understanding the other condition that prompts this error is that the context of the call is not https but I don't know how this affects popup.html or popup.js. Thanks for helping