Open Bug 1188675 Opened 6 years ago Updated 7 months ago
Add some devtools for push notifications
For full push notifications support in devtools we need: 1) Ability to debug service workers, which depends on being able to debug workers. See https://bugzilla.mozilla.org/show_bug.cgi?id=943220 2) Ability to discover service workers and launch a debugging session from them, which depends on about:debugging page, see https://bugzilla.mozilla.org/show_bug.cgi?id=1209369 3) Ability to do simple push tests, see https://bugzilla.mozilla.org/show_bug.cgi?id=1209699
If a developer wants to debug push messages, triggering them from the server side may be problematic since they may run out of their push message quota. It seems like at the minimum, our devtools needs to make it possible to simulate receipt of push notifications.
Sounds like a good idea; though I'll note that as long as you are visiting the site, you don't need to worry about the quota.
Cc'ing / needinfo'ing Axel so he's got this on his radar.
It's going be be nearly impossible to artificially simulate a push notification: as per the W3C standard, "The push API enables delivery of arbitrary application data to webapps, and makes no assumptions about the over-the-air/wire protocol used by push services. As such, the details of what types of data flow through a push services for a particular webapp are specific to the push service and webapp. As needed, clarification about what data flows over-the-air/wire should be sought from push service operators or webapp developers." I propose we breakdown the features into three buckets: 1) Push notification worker discovery: as a developer I would like to get a list of the the registered workers. - service worker, domain, and expected data format, token and channel ID. 2) Navigate from registered worker to code: as a developer I'd like to be able to easily be able to find the code associated with a given registered worker and set a break point so I can debug on receipt of the notification. 3) Simulation of push notification: Provide an easy syntax for accessing a registered worker via the console as opposed to having to message to it via the server. Will follow up to see if there's already a way to do this from within the browser.
It should be relatively trivial to induce the creation of a "push message". We might need to build some hooks into the push module to support that, but I think that it would be valuable. The input you want to take for this is a BufferSource (ArrayBuffer, etc...). Alternatively, if you had a generic capability to synthesize events for service workers, then making a synthetic push message is trivial.
Severity: normal → enhancement
Component: Developer Tools → Developer Tools: about:debugging
Component: about:debugging → Application Panel
You need to log in before you can comment on or make changes to this bug.