Closed Bug 2040729 Opened 2 months ago Closed 2 months ago

Web Share API (navigator.share()) invokes legacy custom share sheet instead of native Android share sheet

Categories

(Firefox for Android :: Share, defect)

All
Android
defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: tech4pwd, Assigned: gl)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

There is an ongoing effort to migrate Firefox for Android from the custom Fenix share sheet to the native Android share sheet. However, when a website triggers a share action via the Web Share API (navigator.share()), Firefox still intercepts this and opens the legacy custom share sheet instead of passing the intent to the native Android OS share sheet.

Steps to reproduce

  1. Open Firefox Nightly.
  2. Navigate to the W3C Web Share API demo: https://w3c.github.io/web-share/demos/share.html
  3. Leave the default text in the fields and tap the Share button.
  4. Observe the share sheet UI that appears at the bottom of the screen.

Expected behavior

The browser should invoke the native Android share sheet, aligning with the recent design migrations across the rest of the Fenix UI.

Actual behavior

The browser brings up the legacy, custom share sheet.

Device information

  • Firefox version: Trunk
  • Android device model: Pixel 10 Pro XL
  • Android OS version: 16

Any additional information?

Sharing a page directly from the Firefox three-dot menu or address bar correctly invokes the native Android share sheet. The regression/oversight appears specifically tied to how the Web Share API is handled under the hood.

Blocks: webshare
Assignee: nobody → gl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Just to be clear, are we going to keep the customization to be able to send to other devices, but just with more modern API?

Flags: needinfo?(gl)

(I see send to device in (In reply to Paul [pwd] from comment #0)

Sharing a page directly from the Firefox three-dot menu or address bar correctly invokes the native Android share sheet. The regression/oversight appears specifically tied to how the Web Share API is handled under the hood.

I see it's already implemented there, canceling NI. Thanks for the effort here.

Flags: needinfo?(gl)

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #1)

Just to be clear, are we going to keep the customization to be able to send to other devices, but just with more modern API?

Yes, functionalities such Send to Devices are already handled. The change revolves about using the native Android surface as the share sheet (more modern API when the device can support) and we fallback to the custom share sheet when the API isn't supported on an older device.

Pushed by gluong@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/140bdf822450 https://hg.mozilla.org/integration/autoland/rev/211a4f00c8e2 Handle showing the native share sheet from web navigator.share r=android-reviewers,petru
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: