Closed Bug 1842290 Opened 1 year ago Closed 4 months ago

Report whether Firefox is the default `mailto` protocol handler

Categories

(Firefox :: Installer, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: nalexander, Assigned: mpohle)

References

Details

(Whiteboard: [fidedi-pdf])

Attachments

(1 file)

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.

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.

gijs: is this already instrumented? I see nothing immediate in probes.telemetry.mozilla.org but this is absolutely not my domain.

Flags: needinfo?(gijskruitbosch+bugs)

(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 handle mailto 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.

Flags: needinfo?(gijskruitbosch+bugs)

(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 handle mailto 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.

Priority: -- → P3

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.

(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:

https://searchfox.org/mozilla-central/rev/8f09f6a6ff0d8b6ea75a1e1279a06ba02479578c/uriloader/exthandler/nsMIMEInfoImpl.cpp#367-378

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 by UserChoice, so maybe our existing .pdf telemetry collection, just works out of the box? That would be pleasant.

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.

(In reply to :Gijs (away until Sept 18th; he/him) from comment #5)

(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:

https://searchfox.org/mozilla-central/rev/8f09f6a6ff0d8b6ea75a1e1279a06ba02479578c/uriloader/exthandler/nsMIMEInfoImpl.cpp#367-378

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.

Yes, I'm aware of the difference, but I wasn't clear about this distinction. I'm not particularly fussed about mailto defaults right now because it is almost certainly rare that Firefox is the default handler. I am concerned about what making Firefox the mailto default will actually do, i.e., is it worth trying to be the mailto default. Between our two approaches I think we can answer that latter question.

gijs: would you recommend one over the other? Or should I collect both?

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.

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.

These are subtly different, yes, but we should handle both cases "out of the box".

Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Nick Alexander :nalexander [he/him] from comment #6)

(In reply to :Gijs (away until Sept 18th; he/him) from comment #5)

(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:

https://searchfox.org/mozilla-central/rev/8f09f6a6ff0d8b6ea75a1e1279a06ba02479578c/uriloader/exthandler/nsMIMEInfoImpl.cpp#367-378

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.

Yes, I'm aware of the difference, but I wasn't clear about this distinction. I'm not particularly fussed about mailto defaults right now because it is almost certainly rare that Firefox is the default handler.

Is it? I thought we made it the default on install these days, per bug 675428. Maybe I misunderstood what that bug did and it just made it an option but didn't change the default?

I am concerned about what making Firefox the mailto default will actually do, i.e., is it worth trying to be the mailto default. Between our two approaches I think we can answer that latter question.

Is it worth doing that or should we "just" change the default action for mailto proactively? That's what was proposed in bug 1680250. That would certainly be easier. Adding a migration for existing users so we swap from "use the OS default" to "use always ask" if the OS default is Windows Mail or Mail.app would be a little more work, but not much.

gijs: would you recommend one over the other? Or should I collect both?

As may be obvious from my questions, I'm not sure I understand - or even if I'm being helpful (I hope so! But I'm worried I'm derailing your well-formed plans that I'm just not familiar with). But collecting either/both what app the user uses at the OS level (to see how many people have dedicated full-blown Outlook / Eudora / Lotus Notes / whatever installed and set as the OS default) and what their Firefox is configured to (how many people have figured out how to always use a web app vs still have it set to "use OS default") would be interesting to note, and would also allow us to confirm whether any changes we make have the desired effect. The combination would effectively give you "addressable market" for people who have it set to the OS default but (we assume) don't actually use that application (that's a big A assumption; it feels potentially evil to try to work out (and collect) if people do use that application.

Flags: needinfo?(gijskruitbosch+bugs)
Assignee: nobody → mpohle
See Also: → 1894024

This change only does what the title of the bug says and will not help
to understand which other programs are used.

Pushed by mpohle@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7d6e73b70b2 Report whether Firefox is the default `mailto` protocol handler, r=nalexander,firefox-desktop-core-reviewers
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: