Open Bug 1868407 Opened 1 year ago Updated 5 months ago

Provide API to know if Fenix is the default pdf reader

Categories

(GeckoView :: PDF Viewer, enhancement, P4)

Firefox 122
All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: calixte, Unassigned)

References

Details

If Fenix is the default reader then we can remove the button Open in app from the toolbar but we need to get this information.

Priority: -- → P3
Severity: -- → N/A

Does desktop already have an API for detecting default reader so we can expose that to Fenix?

Flags: needinfo?(cdenizet)

I don't know, maybe Nick would know.

Flags: needinfo?(cdenizet) → needinfo?(nalexander)

(In reply to Calixte Denizet (:calixte) from comment #2)

I don't know, maybe Nick would know.

Desktop certainly knows if Firefox is the default PDF handler, at least on Windows (see https://searchfox.org/mozilla-central/rev/7f8450b7a32bfbafa060c184d3a3ac9c197e814f/browser/components/BrowserGlue.sys.mjs#2782-2794 for example). But anything we do here would be very Android-specific, and not likely done in the same way.

A combination of https://stackoverflow.com/a/2790374 and https://stackoverflow.com/a/77753192 might do the trick. In any case, I'd defer to the Fenix experts, who definitely know how to do this for browsers:https://searchfox.org/mozilla-central/source/mobile/android/android-components/components/support/utils/src/main/java/mozilla/components/support/utils/Browsers.kt#207.

Flags: needinfo?(nalexander)
Blocks: 1897840

This is no longer needed for bug 1832519, as we decided to remove the "Open in app" button whether Firefox is the default reader or not.

No longer blocks: 1832519

Is there another use for knowing if Firefox is the default reader?

I can't think of any, unless we want to add some kind of UI in the settings to enable/disable Firefox being the default, but that's probably more of a OS-level setting.

Priority: P3 → P4
You need to log in before you can comment on or make changes to this bug.