Closed Bug 1626770 Opened 5 years ago Closed 5 years ago

navigator.mediaDevices should be accessible on *.localhost and not only localhost

Categories

(Core :: DOM: Device Interfaces, defect)

74 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1220810

People

(Reporter: mcgiordalp, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36

Steps to reproduce:

Both navigator.mediaDevices and navigator.getUserMedia works on either SecureContext or localhost only. The problem is that the browser doesn't detect subdomains of localhost as a localhost context, that is a different behavior to what happens in Google Chrome.

Actual results:

Go to example.localhost, open your console and type navigator.mediaDevices, it returns undefined.

Expected results:

It should have returned a MediaDevices object.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core

Not sure if this is the right component - sorry if not.

Component: Disability Access APIs → DOM: Device Interfaces

I guess it should be moved to one of media components but I am not so sure.

Component: DOM: Device Interfaces → Audio/Video

I think it was in the correct component, DOM: Device Interfaces

Component: Audio/Video → DOM: Device Interfaces

:jib, it looks like to be related to WebRTC, can you take a look at this?

Flags: needinfo?(jib)

This looks like a feature of our [SecureContext] implementation (though we do use a custom function in this particular case).

Andrea, do you know the right component for this, or whether our current behavior is intended?

Flags: needinfo?(jib) → needinfo?(amarchesini)

If the intended behavior is similar to what chrome does, I believe the change would be here. For some reason this function is receiving a host different than localhost when the url is example.localhost.

This is a dup of bug 1220810. I wrote a patch for that (thanks to :jkt, who wrote the initial version of it), but it's blocked by a DocumentChannel regression. I hope to have it fixed in the next cycle.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(amarchesini)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.