mediaDevices.getUserMedia() support from add-on

Hi, I have a problem, mediaDevices.getUserMedia() never resolves from firefox
OS X, firefox 54

I think you can’t do it in the background page. In Chrome that rejects, in Firefox it probably should too.

Just do it from an extension view (which will most likely need to stay open):
background.js:

(await browser.tabs.open({ url: 'sone html in your extension telling the user not to close the tab', }))
const view = browser.runtime.getViews().find(view => view !== window);
const media = (await  view.navigator.mediaDevices.getUserMedia({ audio: true, }));

Thanks for fast answer. In chrome it resolves, not rejects. My task is to port the chrome extension to firefox, and getUserMedia() doesn’t work at all.

Curios. For me it definitely rejects.

I’m using getUserMedia() for this to get the mediastream, but the method never resolves

Yeah, I got that. I don’t thik it will ever resolve. The bug here is that it doesn’t reject.

But if you use the navigator object of a tab or popup, it will work the same way as it does for websites, hence the code I suggested.