You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During TPAC 2023 WebApps session it was briefly mentioned that it could be nice to have some webdriver command for this, and I'd like to go deeper and get an actual achievement in this area.
@beidson, since you proposed #360, has Apple prepared a plan for this?
@saschanaz, we (WebKit) don't have any plans, but it would be nice to figure something out... maybe we could do something with Web Driver, but I've not checked if that's even possible for this case?
I guess at a minimum, we could add the error checking tests... and if we allow the permission through Web Driver, then it might be possible to somehow send synthetic push messages.
I think this is something we can do in parallel to #360, but it shouldn't be a precondition to the inclusion of #360... but, #360 should include definitely include whatever tests are possible with the WPT infra we have today.
I'd like to take the TPAC action to "propose and implement cross-browser push-message injection" (minutes), which has no owner yet.
Two things since then. @eerii opened web-platform-tests/wpt#65094, which adds test_driver.deliver_push_message(scope, data) on top of new Chromium-only CDP commands, and Ms2ger noted it needs an RFC because no WebDriver endpoint backs it. And on wpt.fyi, subscribe() itself fails in every browser (Chrome "permission denied", Firefox "Error retrieving push subscription", Safari's permission stays at "prompt"), so push-event.https.any.js never gets to the push step.
A spec-defined command would give that work a standard target. A sketch, following @saschanaz's suggestion at TPAC to inject a payload into a normally created subscription:
Deliver push message, a WebDriver extension command in a new Automation section (like Generic Sensor or Compute Pressure):
Parameters: scope (URL), body (base64, optional), contentEncoding (default "aes128gcm").
Run Get Registration for the current top-level browsing context's storage key and scope. If it returns null, or the registration has no push subscription, return invalid argument.
Otherwise run the Receiving a Push Message steps for that subscription with this message, so decryption and the declarative push message parser are exercised. A body that fails to decrypt fires no event, which invalid-payload tests can check. Acknowledgement is a no-op.
Tests can build the encrypted body with encrypt() in push-api/resources/helpers.js. Leo Tenenbaum's pushMessage() helper from October already wraps it, so pointing tests at the command would be a small change.
How should subscribe() succeed under automation? I'd suggest a UA-local subscription whose endpoint is never contacted.
Should pushsubscriptionchange (also in wpt#65094) go in the same PR?
I'm happy to do the spec PR, the testdriver and wptrunner wiring (with @eerii, building on #65094), and the test ports. @marcoscaceres, could this get Agenda+ for Monday's call?
Activity
marcoscaceres commentedon Dec 8, 2023
@saschanaz, we (WebKit) don't have any plans, but it would be nice to figure something out... maybe we could do something with Web Driver, but I've not checked if that's even possible for this case?
I guess at a minimum, we could add the error checking tests... and if we allow the permission through Web Driver, then it might be possible to somehow send synthetic push messages.
I think this is something we can do in parallel to #360, but it shouldn't be a precondition to the inclusion of #360... but, #360 should include definitely include whatever tests are possible with the WPT infra we have today.
ikram1201 commentedon Nov 22, 2026
I'd like to take the TPAC action to "propose and implement cross-browser push-message injection" (minutes), which has no owner yet.
Two things since then. @eerii opened web-platform-tests/wpt#65094, which adds
test_driver.deliver_push_message(scope, data)on top of new Chromium-only CDP commands, and Ms2ger noted it needs an RFC because no WebDriver endpoint backs it. And on wpt.fyi,subscribe()itself fails in every browser (Chrome "permission denied", Firefox "Error retrieving push subscription", Safari's permission stays at "prompt"), sopush-event.https.any.jsnever gets to the push step.A spec-defined command would give that work a standard target. A sketch, following @saschanaz's suggestion at TPAC to inject a payload into a normally created subscription:
Deliver push message, a WebDriver extension command in a new Automation section (like Generic Sensor or Compute Pressure):
scope(URL),body(base64, optional),contentEncoding(default"aes128gcm").scope. If it returns null, or the registration has no push subscription, return invalid argument.Tests can build the encrypted body with
encrypt()inpush-api/resources/helpers.js. Leo Tenenbaum'spushMessage()helper from October already wraps it, so pointing tests at the command would be a small change.Questions before I write spec text:
notificationsmodule to observe and interact with web notifications webdriver-bidi#1199.)subscribe()succeed under automation? I'd suggest a UA-local subscription whose endpoint is never contacted.pushsubscriptionchange(also in wpt#65094) go in the same PR?I'm happy to do the spec PR, the testdriver and wptrunner wiring (with @eerii, building on #65094), and the test ports. @marcoscaceres, could this get Agenda+ for Monday's call?