Provide API to know if Fenix is the default pdf reader
Categories
(GeckoView :: PDF Viewer, enhancement, P4)
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.
Updated•9 months ago
|
Updated•8 months ago
|
Comment 1•6 months ago
|
||
Does desktop already have an API for detecting default reader so we can expose that to Fenix?
Reporter | ||
Comment 2•6 months ago
|
||
I don't know, maybe Nick would know.
Comment 3•6 months ago
|
||
(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.
Comment 4•5 months ago
|
||
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.
Comment 5•5 months ago
|
||
Is there another use for knowing if Firefox is the default reader?
Comment 6•5 months ago
|
||
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.
Updated•5 months ago
|
Description
•