Closed Bug 1856305 Opened 8 months ago Closed 15 days ago

Firefox on macOS casually indicates active screen sharing (MacOS 14)

Categories

(Core :: WebRTC, defect)

Firefox 118
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: emanueleant03, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

Just normally using Firefox without any tab or page trying to share my screen.

Actual results:

The macOS native purple icon of screen sharing appears on the top bar and says that firefox is sharing the screen. I don't know if any website has access to this automatically started sharing.

Expected results:

No screen sharing should have been started by Firefox.

macOS version 14.0

Does this happen regularly or did it just happen once?

Group: firefox-core-security → dom-core-security
Component: Untriaged → Widget: Cocoa
Flags: needinfo?(emanueleant03)
Product: Firefox → Core

(In reply to Andrew McCreight [:mccr8] from comment #2)

Does this happen regularly or did it just happen once?

It happens regularly, like once or twice a day

Flags: needinfo?(emanueleant03)

The next time this happens, right-click on the screen sharing icon. This displays a dialog with the name of the controlling machine (and giving you an option to disconnect it). Do you recognize the name? It may just be an ip address.

With the right-click dialog displayed, capture an image of it and its immediate surroundings (Cmd-Shift-5), then attach that image here (Attach New File above).

As far as I know, Firefox never uses the system screen sharing icon. If I'm right, this bug probably has nothing to do with Firefox.

Edit: But maybe you have a Firefox extension that supports screen sharing.

Attached image IMG_3306.HEIC

I managed to reproduce it by closing firefox (without quitting the app), but the dialog doesn't give any more info.

Thanks for the screenshots. They go beyond my knowledge of Firefox's current capabilities. So I probably won't be much help here.

One more thing you can do, though: Visit about:addons and then choose Extensions. What extensions do you see there? Don't include those listed under Recommended Extensions.

I attached a screenshot of the addons, hope it helps you

(In reply to Emanuele Antonio Faraone from comment #11)

I attached a screenshot of the addons, hope it helps you

Thanks for the screenshot, but I'm afraid it doesn't help me. I don't see anything there related to screen sharing or screen capture.

I've done as much as I can here. Someone else will need to step in who knows about Firefox screen sharing or screen capturing.

I think the only place we use screen sharing is for WebRTC, so maybe I should have put this there instead. jib, any ideas for figuring out what is going on? Thanks.

Group: dom-core-security → media-core-security
Component: Widget: Cocoa → WebRTC
Flags: needinfo?(jib)

One more set of questions for Emanuele:

What version of macOS are you currently using? Is it macOS 14? If so, I assume you upgraded recently, and that you were using Firefox (and your current configuration of it) before the upgrade. If all my assumptions are true, did you see this bug before the upgrade to macOS 14? If not, this may turn out to be an Apple bug.

For what it's worth, I found a website that demos WebRTC screen sharing:

https://www.webrtc-experiment.com/screen-sharing

Interestingly, it's only on macOS 14 that the system screen sharing icon appears when you choose to share your entire screen (in this demo). It doesn't appear on macOS 13.

Not sure what this means, but it's worth mentioning.

Also notable: The screen sharing icon (on macOS 14) takes about 15 seconds to disappear when you stop sharing your screen (in the demo), when you close the tab containing the demo, or when you quit Firefox. Sounds like a bug. I don't know if it's Mozilla's or Apple's. I also don't know if it's related to this bug.

Another interesting tidbit:

If you share your entire screen in the WebRTC screen sharing demo from comment #15, you see two screensharing icons on macOS 14 -- the system one and (to its left) what's presumably a Mozilla-generated one. I don't know why Emanuele sees only one.

Just closing Firefox's (single) window doesn't trigger Emanuele's bug for me. (FF 118, macOS 14)

(In reply to Steven Michaud [:smichaud] (Retired) from comment #16)

Created attachment 9356241 [details]
WebRTC Screensharing icons on macOS 14

Another interesting tidbit:

If you share your entire screen in the WebRTC screen sharing demo from comment #15, you see two screensharing icons on macOS 14 -- the system one and (to its left) what's presumably a Mozilla-generated one. I don't know why Emanuele sees only one.

I just tried the sharing demo and I have two screen sharing icons too, when the bug happens I only have the system one. Also, closing firefox's window doesn't always trigger the bug, but it happened twice in this situation for me. Happy to help if you need anything else.

I searched on screen shar at https://searchfox.org/. Most of the hits were clearly related to WebRTC. But others seemed to involve a "video engine" under dom/media/systemservices. I've no idea whether or not that has something to do with WebRTC, or even whether the code is currently active.

Another question occurs to me, Emanuele:

Do you have Firefox Sync (about:preferences#sync) turned on, and are you running Firefox on more than one computer on your local network (possibly including a cell phone)? Even if you don't have it on, do you have a Firefox Sync account?

I don't have it turned on, and don't use it. But I do have an account, and do run Firefox on multiple machines on my local network. On macOS 13 and (I think) 12, I have sometimes seen "extra" Firefox icons on my Dock, which I think were spawned by Firefox Sync. I very seldom run macOS 14. But I'm going to start running Firefox on it more often. I'm hoping it's only a matter of time before I also see your bug. I'm hoping that, on macOS 14, the "extra" Dock icon will morph into the system screen sharing icon (on the system menubar).

And yet another, rather obvious question: Do you have screen sharing turned on in System Settings ? :-)

I just found out that turning screen sharing off (in System Settings) doesn't stop the WebRTC screen sharing demo from working (on macOS 14, in FF 118). I still see both icons -- the Mozilla one and the system one.

(Following up comment #20)

I'm now seeing the "extra" Firefox icons, in the Dock, on two different machines. One is using macOS 13 and the other macOS 14. Firefox is running on both of them. I also needed to log in with my Apple ID on both machines (where I have local accounts that share the same name and password). So I was wrong on two counts: 1) Those "extra" Dock icons have nothing to do with Firefox Sync. 2) They don't morph into the system screen sharing icon on macOS 14.

I'm not yet on macOS 14 so I cannot check myself, but a few thoughts:

Does this reproduce if you set the pref media.getusermedia.screensharing.enabled=false on about:config ? (don't forget to turn it back on if you want to do screensharing later on)

If yes, it is definitely something else than the getDisplayMedia screen/window capture backend making this icon appear.
Could it appear if we take a snapshot of our windows with CGWindowListCreateImage, for instance? I can't tell if those rust APIs are used.

(In reply to Steven Michaud [:smichaud] (Retired) from comment #15)

Also notable: The screen sharing icon (on macOS 14) takes about 15 seconds to disappear when you stop sharing your screen (in the demo), when you close the tab containing the demo, or when you quit Firefox. Sounds like a bug. I don't know if it's Mozilla's or Apple's. I also don't know if it's related to this bug.

I'd guess it's intentional by Apple so that the user knows even if the app captured just a single frame.

(In reply to Andreas Pehrson [:pehrsons] from comment #24)

(In reply to Steven Michaud [:smichaud] (Retired) from comment #15)

Also notable: The screen sharing icon (on macOS 14) takes about 15 seconds to disappear when you stop sharing your screen (in the demo), when you close the tab containing the demo, or when you quit Firefox. Sounds like a bug. I don't know if it's Mozilla's or Apple's. I also don't know if it's related to this bug.

I'd guess it's intentional by Apple so that the user knows even if the app captured just a single frame.

You're probably right about this. But other elements of Apple's standard screen capture GUI seem to be absent when Emanuele's bug happens. When I use "normal" screen capture (via macOS's own GUI), the screen sharing icon appears immediately on the "captured" machine. And (also immediately) a small window pops up from the icon telling you that "Screen is being controlled", together with an ip address (on my local network). Then when you disconnect (from the "capturer"), another small window immediately pops up (on the "captured" machine) telling you "Viewer has been disconnected" (together with its ip address). Both popup windows disappear in a couple of seconds. But the screen capture icon stays visible for about 15 seconds after disconnection.

Emanuele, do you see any of these popup windows when the bug happens?

Also please do try setting media.getusermedia.screensharing.enabled=false in about:config, as Andreas suggested. If this stops the bug from happening, Mozilla may share at least some of the blame for it (and may also be able to do something about it). If it doesn't, it's much more likely the bug is entirely Apple's fault. And it will be much more difficult to find out if Mozilla can do anything about it.

(Following up comment #25)

The popup windows also don't appear (on macOS 14) when I use the WebRTC screen sharing demo from comment #15.

Emanuele, yet another question I forgot to ask earlier: Are you using an Apple Silicon Mac? Or is it an Intel Mac?

With a bug as weird as this one, that might make a difference. So far I've only been testing (on macOS 14) on an Intel Mac.

I am using an apple silicon one ( MacBook Air M2 ), also Firefox was installed before upgrading to macOS 14.

I just discovered something interesting: I built Firefox from current trunk code on macOS 14 (Apple Silicon), and I didn't see the system screen sharing icon when I ran the WebRTC demo from comment #15 -- only the Mozilla screen sharing icon. But I saw both when I ran the demo in today's mozilla-central nightly (build id 20231004094640).

I don't know what's going on. I'll try again with tomorrow's mozilla-central nightly.

Even more interesting: I ran ./mach package to package my local build into a .dmg file. And when I extracted the Nightly app from that and ran it, this time I did see both screen sharing icons.

And yet still more interesting: When I ran today's mozilla-central nightly from Terminal (/Applications/Firefox\ Nightly.app/Contents/MacOS/firefox), I saw just the Mozilla screen-sharing icon.

This is starting to look more and more like an Apple bug.

Emanuele, we really do need to hear from you whether or not the media.getusermedia.screensharing.enabled=false setting makes your bug go away.

I see both screen-sharing icons when I use the open command to run Firefox or Firefox Nightly from Terminal (open /Applications/Firefox.app or open /Applications/Firefox\ Nightly.app), or when I run either app by double-clicking on its icon. I only see the Mozilla icon when I run the Firefox or Firefox Nightly binary from the command line (/Applications/Firefox.app/Contents/MacOS/firefox or /Applications/Firefox\ Nightly.app/Contents/MacOS/firefox).

So both screen sharing icons appear when Firefox is opened using the macOS GUI, and only the Mozilla icon appears when the Firefox binary is run from the command line.

As best I can tell, the /System/Library/CoreServices/ControlCenter.app application is what displays the buggy screen sharing icon. When it's displayed (by the WebRTC screen sharing demo from comment #15), and you right-click on it, you see the message "Firefox is capturing your screen". Use the following command to grep through your entire hard drive, and you'll see that its executable and one of its resources contain the string "is capturing your screen".

sudo find / -type f -exec grep -s -H "is capturing your screen" \{\} \;

I need my HookCase to debug this further. But I must wait until I've added support for macOS 14 (in a week or two).

This doesn't need to be a sec bug. Likely due to changes Apple has made in 14 related to screen sharing indication. Opening this up so others can find it and report on it.

Group: media-core-security
Summary: Firefox on macOS casually starts screen sharing → Firefox on macOS casually starts screen sharing (MacOS 14)
Summary: Firefox on macOS casually starts screen sharing (MacOS 14) → Firefox on macOS casually indicates active screen sharing (MacOS 14)

Can you please post your about:support text from this device? Thanks.

Flags: needinfo?(emanueleant03)
Attached file aboutSupport.txt
Flags: needinfo?(emanueleant03)

So far I haven't run into this after the upgrade last week. Lets keep an eye on it.

No additional reports and we have not seen this in testing.

Severity: -- → S3
No longer blocks: webrtc-triage

I'm on macOS 14 and cannot repro.

To clarify how screen capture works, macOS 14 introduced a new OS-level icon in the top bar next to Firefox's own indicator. I see it when sharing my screen. However, that OS indicator should never appear alone (except during screen-sharing preview, and except for the 15 seconds extra it hangs around after Firefox's indicator disappears upon capture ending).

The OS-level indicator should NOT appear otherwise, or if the "Screen Recording" OS-level permission for Firefox is off (the fact that macOS allows "limited" capture without permission for apps to self-capture or capture a dummy desktop should not confuse this).

To the OP problem, to rule out some malicious extension, I'd recommend trying with a clean Firefox profile or restart in safe mode.

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

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Given that the bug is still UNCONFIRMED, closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 15 days ago
Flags: needinfo?(emanueleant03)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: