Closed Bug 1511416 Opened 6 years ago Closed 5 years ago

Screen sharing preview pops up in Camera permission prompt (fun UI bug)!

Categories

(Firefox :: Site Permissions, defect, P2)

63 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox-esr60 --- wontfix
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 - wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: jib, Assigned: akshithashetty84, Mentored)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files)

Once open, our in-prompt screen-sharing preview pops up in unexpected places!

STRs:
 1. Open https://jsfiddle.net/jib1/6zcpgb3p/
 2. Select a window from the list in the permission prompt, to see preview.
 3. Leave the prompt open, DON'T hit "Allow" or "Don't Allow".
 4. Open https://jsfiddle.net/jib1/r60bzmrs/ in a new tab.

Expected result:
- A boring prompt asking for camera and microphone.

Actual result:
- A prompt asking for camera and microphone with a screen sharing preview
  (see attached screenshot).
[Tracking Requested - why for this release]: Edge case that looks bad; not a regression.

Additionally, in Firefox 60 when I do this and switch back and forth between the tabs, both permission prompts disappear, except for the tiny triangle part. Resizing the window smaller brings them back.

Also, a review of how much code is shared when there are two prompts open simultaneously, might be wise from a security perspective.
I don't think this is super critical to solve, so I'm not sure I agree that we need to track it.

(In reply to Jan-Ivar Bruaroey [:jib] (needinfo? me) from comment #1)
> Also, a review of how much code is shared when there are two prompts open
> simultaneously, might be wise from a security perspective.

I don't really understand the security aspect of it. It's a UI bug, but how could this kind of thing compromise user security? I guess we can check for other things like this anyway...
Fun bug, probably easy to fix.
Depends on: 1517030
Blocks: 1517030
No longer depends on: 1517030

To fix this, we need to look at this code: https://searchfox.org/mozilla-central/rev/00f3836a87b844b5e4bc82f698c559b9966e4be2/browser/modules/webrtcUI.jsm#492

This callback is called when e.g. switching between tabs and showing different permission panels. This code already does some cleanup here, but only when the doorhanger with the screensharing preview is removed.

What we want to do in that callback is hide webRTC-preview when the requestTypes does not include "Screen", so that it's hidden when switching tabs.

A test would be awesome.

Mentor: jhofmann

Also, that jsfiddle didn't work anymore for me, you can just open https://mozilla.github.io/webrtc-landing/gum_test.html in two tabs instead.

Assignee: nobody → akshithashetty84
Status: NEW → ASSIGNED

Hi, could you please guide me further by reviewing https://phabricator.services.mozilla.com/D21976.
I have tested the results and they seem to work well. Would be great to know if I am on right direction. Thanks.

I have modified it in the suggested direction. Thus, wanted to confirm.

Flags: needinfo?(jhofmann)

Reviewed, sorry for the delay, thanks :)

Flags: needinfo?(jhofmann)

Thank you for the direction. Will update the revision on the suggested lines.

Akshita, before landing this, it would be great if you could do a Try Push. Try is basically Continuous Integration for Firefox, making sure that tests are passing for your patch.

Getting access is outlined here: https://wiki.mozilla.org/ReleaseEngineering/TryServer#Getting_access_to_the_Try_Server

You will need to file a bug and need someone to vouch for you. I'd be happy to do that if you CC me on that bug.

After you've gotten access, to schedule a try run, you can use the handy ./mach try command. A possible syntax for this bug could be:

./mach try -b do -p win64,linux64,macosx64 -u mochitests -t none

(runs all mochitests on Windows, OSX and Linux)

Let me know if you need any help with that!

Sure! Thank you,
I have filled a bug here https://bugzilla.mozilla.org/show_bug.cgi?id=1536277. Will take it ahead once granted access.

Hi, so on carrying out the test the results are such - https://treeherder.mozilla.org/testview.html?repo=try&revision=165c2962444ca3bdb3e5f08b8c9533775c6e9e7e. Could you please let me know how go ahead with this ?

That seems good, you can set checkin-needed now!

Attachment #9048249 - Flags: checkin+
Keywords: checkin-needed

Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/891e21499044
Screen sharing preview pops up in Camera permission prompt . r=johannh

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
No longer blocks: 1557105
Regressions: 1782114
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: