This repository was archived by the owner on Sep 4, 2020. It is now read-only.
Open
Conversation
… cloned" error in Chrome
…onEventResponse for web push scenarios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make WebPush easier and more standardized for the
browserplatform, using same/similarregistrationsemantics as iOS and Android. Eliminates hard-wired manifest and service worker injection as well as the hard-wiredpushServiceURLlogic, which made the old code unusable for real-world applications.These changes will break apps that depend on the plugin's hard-wired manifest, service worker and pushServiceURL logic (a fix, IMHO). If this is a concern for 2.x it would be nice to see a 3.0.alpha soon.
Description
www/browser/push.js:
manifest.jsoninto htmlheadelement -manifest.jsonshould be provided by appregistrationTypeof valueWEB_PUSHtoregistrationevent to align with iOS/Android push.jssubscriptionelement to registration data to pass full browser push subscription dictplugin.xml:
ServiceWorker.jsandmanifest.jsonassets andafter_preparehook - should be provided by appAPI.MD, EXAMPLES.md, PAYLOAD.md
Related Issue
#2626, #1399
Motivation and Context
Makes it easier to use WebPush; eliminates obsolete boilerplate and places responsibility for sub/unsub logic in client code (as is already the case for iOS and Android).
How Has This Been Tested?
Runs in Chrome, Firefox, Edge.
Screenshots (if appropriate):
Types of changes
It only breaks existing functionality if anyone is using the current pushServiceURL mechanism.
Checklist: