Skip to content

Exclude push event from ngsw-worker.js #26413

@shabbir-dhangot

Description

@shabbir-dhangot

EDIT(@gkalpak): Related to issue #24387.

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

I have my own service worker that listening push event. While building ngsw-worker.js auto generated and having push event available. Due to this website is showing notification two times. One from my service worker and another from ngsw-worker.js file.

Currently I have to comment that code each time I am building dist folder. Is there any option available that will automatically not include this push event listener?

this.scope.addEventListener('push', (event) => this.onPush(event));

Expected behavior

There should be option to not include this event.

Minimal reproduction of the problem with instructions

Problem required no plunkr. Its happening with PWA service worker js file.

Environment


Angular version: latest


Browser:
- [x] Chrome (desktop) version all
- [x] Chrome (Android) version all
- [x] Chrome (iOS) version all
- [x] Firefox version all
- [x] Safari (desktop) version all
- [x] Safari (iOS) version all
- [x] IE version all
- [x] Edge version all

Metadata

Metadata

Assignees

Labels

area: service-workerIssues related to the @angular/service-worker packageeffort2: daysfeatureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsfeature: votes requiredFeature request which is currently still in the voting phase

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions