Open Bug 1951521 Opened 8 months ago

Add support for CustomTabsCallback.onPostMessage

Categories

(Firefox for Android :: Browser Engine, enhancement)

All
Android
enhancement

Tracking

()

People

(Reporter: jonalmeida, Unassigned)

References

Details

This API allows third party developers that launch a custom tab to communicate back to the sender.

From jansel:

The page hosted in the Custom Tab emits events that are processed in batches on the JS side. When the Custom Tab closes—either manually or via deep linking. Any pending batches are lost. Being able to post those events to the native app would help prevent the loss.

Generally, postMessage would be useful in Custom Tabs for any use case where a JavaScriptInterface is typically used in a WebView <-> App setup.

It's not clear to me if definitely need support for JavaScriptInterface as well to make this useful or if our - and we are unlikely to support it today until we can build a good use case for it.

While we do have WebExtension.Port.postMessage it looks like we would need to support Window.postMessage.

You need to log in before you can comment on or make changes to this bug.