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
{{ message }}
Repository navigation
Commit 3830908
Browse filesBrowse the repository at this point in the historyBrowse files
feat(service-worker): support sendRequest as a notificationclick action (#46912)
Implement a new `notificationclick` action, `sendRequest`, which sends a
GET request to the specified URL, without opening a new window. This can
be useful for hitting an API endpoint.
PR Close#46912
Copy file name to clipboardExpand all lines: aio/content/guide/service-worker-notifications.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,12 @@ The Angular service worker supports the following operations:
61
61
|`openWindow`| Opens a new tab at the specified URL, which is resolved relative to the service worker scope. |
62
62
|`focusLastFocusedOrOpen`| Focuses the last focused client. If there is no client open, then it opens a new tab at the specified URL, which is resolved relative to the service worker scope. |
63
63
|`navigateLastFocusedOrOpen`| Focuses the last focused client and navigates it to the specified URL, which is resolved relative to the service worker scope. If there is no client open, then it opens a new tab at the specified URL. |
64
+
|`sendRequest`| Send a simple GET request to the specified URL. |
64
65
65
66
<divclass="alert is-important">
66
67
67
68
If an `onActionClick` item does not define a `url`, then the service worker's registration scope is used.
68
-
69
+
69
70
</div>
70
71
71
72
### Actions
@@ -86,14 +87,16 @@ In addition, using the `onActionClick` property on the `data` object, you can ti
0 commit comments