0

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

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Nov 08 '22 at 01:29
  • Could you set up a minimal example that should work but doesn't? That would help us try to figure out if the issue is in the code or somewhere else. – Hamatti Nov 08 '22 at 12:21
  • @Hamatti I fixed the formatting to the link I mentionned which contains such an example – itsyaboiclayton Nov 08 '22 at 14:47

0 Answers0