angular-cn/tools/public_api_guard
Alex Rickabaugh b9a91a5e74 fix(service-worker): don't crash if SW not supported
Currently a bug exists where attempting to inject SwPush crashes the
application if Service Workers are unsupported. This happens because
SwPush doesn't properly detect that navigator.serviceWorker isn't
set.

This change ensures that all passive observation of SwPush and
SwUpdate doesn't cause crashes, and that calling methods to perform
actions on them results in rejected Promises. It's up to applications
to detect when those services are not available, and refrain from
attempting to use them.

To that end, this change also adds an `isSupported` getter to both
services, so users don't have to rely on feature detection directly
with browser APIs. Currently this simply detects whether the SW API
is present, but in the future it will be expanded to detect whether
a particular browser supports specific APIs (such as push
notifications, for example).
2017-12-01 14:18:16 -08:00
..
animations build: update public api file names (#19190) 2017-09-19 16:59:18 -07:00
common feat(common): add locale id parameter to `registerLocaleData` (#20623) 2017-11-27 17:00:06 -06:00
compiler build: update public api file names (#19190) 2017-09-19 16:59:18 -07:00
core refactor(core): misc changes and integrate review feedback on #19996 2017-11-06 14:13:02 -08:00
forms Revert "refactor(core): Change `abstract get` to `readonly` (#19226)" 2017-09-28 13:36:56 -07:00
http build: update public api file names (#19190) 2017-09-19 16:59:18 -07:00
platform-browser feat(platform-server): add an API to transfer state from server (#19134) 2017-09-21 13:56:13 -07:00
platform-browser-dynamic feat(platform-browser-dynamic): export `JitCompilerFactory` (#20478) 2017-11-22 08:56:11 -06:00
platform-server feat(platform-server): add an API to transfer state from server (#19134) 2017-09-21 13:56:13 -07:00
platform-webworker fix: Update test code to type-check under TS 2.5 (#20175) 2017-11-15 18:12:16 -06:00
platform-webworker-dynamic build: update public api file names (#19190) 2017-09-19 16:59:18 -07:00
router feat(router): add "onSameUrlNavigation" router configuration option (#19463) 2017-10-23 20:56:53 -04:00
service-worker fix(service-worker): don't crash if SW not supported 2017-12-01 14:18:16 -08:00
upgrade build: update public api file names (#19190) 2017-09-19 16:59:18 -07:00