Enable Web Push support in GeckoView
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(firefox-esr60 wontfix, firefox66 wontfix, firefox67 wontfix, firefox68 wontfix, firefox69 wontfix, firefox70 wontfix, firefox71 fixed)
People
(Reporter: snorp, Assigned: snorp)
References
Details
(Whiteboard: [geckoview:m1909])
Attachments
(4 files, 2 obsolete files)
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 3•6 years ago
|
||
P3 because Barbara says Web Push is not needed for Fenix MVP.
Updated•6 years ago
|
Comment 4•6 years ago
|
||
AC issue to add an Engine component API for Web Push:
https://github.com/mozilla-mobile/android-components/issues/1919
Comment 5•6 years ago
|
||
Adding [geckoview:fenix:m7] whiteboard tag because we should figure out our Web Push plans in Q2.
Comment 6•6 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #4)
AC issue to add an Engine component API for Web Push:
https://github.com/mozilla-mobile/android-components/issues/1919
I've closed the A-C ticket above as it was more for investigation on how a-c could support WebPush subscriptions. Now that we have some initial support, there are still some a-s dependencies that we can use to make this work.
This is a more appropriate a-c ticket to reference: https://github.com/mozilla-mobile/android-components/issues/3418
Comment 7•6 years ago
|
||
Snorp, Jonathan, JR, and I chatted about this in Whistler. We decided on adding a delegate to handle creating, fetching, and removing push subscriptions. Consumers like Fenix could wire up this delegate to the a-s Rust Push component, or any other backend they like. We can also use the delegate to mock the push server.
Here's a sketch of the delegate, and the DOM APIs it would support:
interface PushDelegate {
/** Creates a push subscription for the given service worker scope. A scope
* uniquely identifies a service worker. `appServerKey` optionally
* creates a restricted subscription
* (http://w3c.github.io/push-api/#dom-pushmanager-subscribe,
* http://w3c.github.io/push-api/#dom-pushsubscriptionoptionsinit-applicationserverkey) */
GeckoResult<PushSubscription> onSubscribe(@NonNull String scope,
@Nullable byte[] appServerKey);
/** Retrieves a subscription for the given service worker scope.
* (http://w3c.github.io/push-api/#dom-pushmanager-getsubscription) */
GeckoResult<PushSubscription> onGetSubscription(@NonNull String scope);
/** Removes a push subscription. Resolves with `true` if the subscription
* was successfully removed, `false` otherwise. This is passed through to
* the DOM API
* (http://w3c.github.io/push-api/#dom-pushsubscription-unsubscribe). */
GeckoResult<Boolean> onUnsubscribe(@NonNull String scope);
}
/** Push subscription info to forward to the DOM API. */
interface PushSubscription {
// http://w3c.github.io/push-api/#dom-pushsubscription-endpoint
@NonNull String getEndpoint();
// http://w3c.github.io/push-api/#dom-pushsubscription-getkey, "p256dh"
@NonNull byte[] getEncryptionKey();
// http://w3c.github.io/push-api/#dom-pushsubscription-getkey, "auth"
@NonNull byte[] getAuthKey();
// http://w3c.github.io/push-api/#dom-pushsubscriptionoptions, returns the same
// value as the optional `appServerKey` argument.
@Nullable byte[] getAppServerKey();
}
// On ServiceWorkerManager...
class ServiceWorkerManager {
// ...
/** Delivers a decrypted push message to the service worker for the given scope. */
void onPushMessageReceived(String scope, byte[] message);
/** Fires a `pushsubscriptionchange` event for a service worker, indicating the
worker's subscription has been lost and the worker must resubscribe. */
void onPushSubscriptionChange(String scope);
}
Assignee | ||
Comment 8•6 years ago
|
||
It looks to me like we may want to register a new thing here[0], but it seems like those bits really want you to look like a WebSocket or H2 type of push impl. It may be easier and/or more appropriate to implement nsIPushService
[1] directly, which pretty much matches the public API we'd like to expose. It may, however, be a baby/bathwater situation.
[0] https://searchfox.org/mozilla-central/rev/c0ca77697c6868482f30af873ec8069f2c080a34/dom/push/PushService.jsm#15
[1] https://searchfox.org/mozilla-central/source/dom/interfaces/push/nsIPushService.idl
Comment 9•6 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #8)
It may be easier and/or more appropriate to implement
nsIPushService
[1] directly, which pretty much matches the public API we'd like to expose. It may, however, be a baby/bathwater situation.
That might be the best option. We can also add the GeckoView implementation as a different backend here—keeping PushComponents
mostly as it is now, but avoiding all the funky PushService.jsm
machinery.
Comment 10•6 years ago
|
||
Though nsIPushService
is pretty small, and, if we can use Messaging.jsm
directly from the content process—or if we need to use it from content, anyway, to get the right event dispatcher—we wouldn't need PushServiceContent
at all.
Assignee | ||
Updated•6 years ago
|
Comment 11•6 years ago
|
||
[geckoview:fenix:m7]
bugs should be priority P1.
I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:
e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9
Comment 12•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 17•6 years ago
|
||
Comment 18•6 years ago
•
|
||
Backed out 3 changesets (Bug 1343678) for breaking Android web platform tests CLOSED TREE
Failure log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257332&repo=autoland&lineNumber=1281
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257330&repo=autoland&lineNumber=1263
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257340&repo=autoland&lineNumber=1248
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257314&repo=autoland&lineNumber=1312
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257320&repo=autoland&lineNumber=1295
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263257315&repo=autoland&lineNumber=1737
Backout: https://hg.mozilla.org/integration/autoland/rev/d0859d17e38bd70a5427d590c080098a691208d1
Assignee | ||
Updated•6 years ago
|
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Backed out 3 changesets (bug 1343678) for WPT failures on Android. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=263920274&repo=autoland&lineNumber=7812
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=619e7838ebfd94672b993d34914f3852610b2905
Backout:
https://hg.mozilla.org/integration/autoland/rev/13c98841413b119c56fafe2bbeaaa631825fdd53
Assignee | ||
Comment 21•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Backed out 5 changesets (Bug 1343678) for causing multiple web-platform failures CLOSED TREE
Failure logs: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=264118841&repo=autoland&lineNumber=1530
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=264121604&repo=autoland&lineNumber=5603
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=264121633&repo=autoland&lineNumber=2952
Backout: https://hg.mozilla.org/integration/autoland/rev/6390dc77aaf0a3cb47f40227e8e0da858facdcff
Comment 25•6 years ago
|
||
Adding this bug to GV's September sprint.
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b2ae7f641b2d
https://hg.mozilla.org/mozilla-central/rev/2c7b6826afe9
https://hg.mozilla.org/mozilla-central/rev/b70bcfe2473f
https://hg.mozilla.org/mozilla-central/rev/3dc75350ad97
https://hg.mozilla.org/mozilla-central/rev/c0810f35c8d5
Assignee | ||
Updated•6 years ago
|
Comment 29•6 years ago
|
||
firefox70=wontfix because I assume Fenix doesn't need us to uplift Web Push to GV 70 Beta. GV 71 Nightly will ride to Beta on October 21.
Description
•