Report whether Firefox is the default `mailto` protocol handler
Categories
(Firefox :: Installer, enhancement, P3)
Tracking
()
People
(Reporter: nalexander, Unassigned)
References
Details
(Whiteboard: [fidedi-pdf])
In Bug 1743914, we made it easy to collect whether Firefox is the default PDF handler. This ticket tracks doing the same for the mailto
protocol.
While here, perhaps we can also include whether Firefox itself has a registered mailto
protocol handler, so that launching Firefox to handle mailto
actually does something helpful.
If we can include a single extra bit, it would be helpful to also include if the default handler is a non-Firefox known-browser, i.e., Edge, Chrome, Brave, etc.
Updated•1 year ago
|
Reporter | ||
Comment 1•1 year ago
|
||
While here, perhaps we can also include whether Firefox itself has a registered
mailto
protocol handler, so that launching Firefox to handlemailto
actually does something helpful.
gijs: is this already instrumented? I see nothing immediate in probes.telemetry.mozilla.org but this is absolutely not my domain.
Comment 2•1 year ago
|
||
(In reply to Nick Alexander :nalexander [he/him] from comment #1)
While here, perhaps we can also include whether Firefox itself has a registered
mailto
protocol handler, so that launching Firefox to handlemailto
actually does something helpful.gijs: is this already instrumented? I see nothing immediate in probes.telemetry.mozilla.org but this is absolutely not my domain.
I don't believe so. There's no generic telemetry about what apps are used for what filetypes / protocols because doing so in a way that is privacy-preserving would take work (executable paths and handler URLs can contain PII, and I suppose potentially even file extensions or protocols could be used in identifying ways in some circumstances). It should be fine to do it specifically for mailto and for whether it is set to a specific handler or not, but I don't think we have that today, from looking at e.g. https://searchfox.org/mozilla-central/source/uriloader/exthandler/ExtHandlerService.sys.mjs which would be the natural place to add some of that telemetry.
Reporter | ||
Comment 3•1 year ago
|
||
(In reply to :Gijs (he/him) from comment #2)
(In reply to Nick Alexander :nalexander [he/him] from comment #1)
While here, perhaps we can also include whether Firefox itself has a registered
mailto
protocol handler, so that launching Firefox to handlemailto
actually does something helpful.gijs: is this already instrumented? I see nothing immediate in probes.telemetry.mozilla.org but this is absolutely not my domain.
I don't believe so. There's no generic telemetry about what apps are used for what filetypes / protocols because doing so in a way that is privacy-preserving would take work (executable paths and handler URLs can contain PII, and I suppose potentially even file extensions or protocols could be used in identifying ways in some circumstances). It should be fine to do it specifically for mailto and for whether it is set to a specific handler or not, but I don't think we have that today, from looking at e.g. https://searchfox.org/mozilla-central/source/uriloader/exthandler/ExtHandlerService.sys.mjs which would be the natural place to add some of that telemetry.
I understand that the details are sensitive, but the existence of a registered handler is not. Sounds like we don't collect that; this ticket will track doing so.
Updated•1 year ago
|
Reporter | ||
Comment 4•1 year ago
|
||
I think what we want to know is determined here: https://searchfox.org/mozilla-central/rev/55d8d8e0e00ab140088122be39f05e4cd867616a/browser/base/content/nsContextMenu.js#330-338. I'd lift that into nsIHandlerInfo
and include it in telemetry around https://searchfox.org/mozilla-central/rev/132ffbfd6842e5ecd3813673c24da849d3c9acf8/browser/components/BrowserGlue.sys.mjs#2663.
It's not 100% clear to me how to answer my second question, about whether the default handler is a non-Firefox browser. It appears that mailto:
is a protocol like any other (i.e., https
) and is protected by UserChoice
, so maybe our existing .pdf
telemetry collection, just works out of the box? That would be pleasant.
Comment 5•1 year ago
|
||
(In reply to Nick Alexander :nalexander [he/him] (PTO until Montreallhands August 21, 2023) from comment #4)
I think what we want to know is determined here: https://searchfox.org/mozilla-central/rev/55d8d8e0e00ab140088122be39f05e4cd867616a/browser/base/content/nsContextMenu.js#330-338. I'd lift that into
nsIHandlerInfo
and include it in telemetry around https://searchfox.org/mozilla-central/rev/132ffbfd6842e5ecd3813673c24da849d3c9acf8/browser/components/BrowserGlue.sys.mjs#2663.
So to be clear, that checks whether Firefox itself would handle mailto links it encounters on webpages using a web app (like gmail or similar).
It's orthogonal to whether the OS thinks that Firefox is the default handler for mailto apps outside of Firefox. You would need different code for that. Specifically, you can use something like this:
It should also be possible to call this from JS. The implementation already has the full path (but doesn't expose this), and you could probably use that to identify Chrome/Edge as needed.
It's not 100% clear to me how to answer my second question, about whether the default handler is a non-Firefox browser. It appears that
mailto:
is a protocol like any other (i.e.,https
) and is protected byUserChoice
, so maybe our existing
Last I checked the way Windows deals with protocols vs. files was subtly different, so I'm not sure this would be the same, but see my previous response.
Description
•