title: Angular PWA swPush.requestSubscription() not working, Error:Service workers are disabled or not supported by this browser
body: <p>I have an Ionic 5 PWA using Angular 8. I had done Push Notifications using swPush which was working as expected till March. But, from last month, due to some other changes, this stopped working. I am not able to isolate the issue.</p>
  
  <p><code>swPush.isEnabled()</code> is returning false, even though service worker is registered. Nothing has changed in the code with respect to swPush and its implementations. I tried <a href="https://stackoverflow.com/questions/54840470/angular-swpush-requestsubscription-promise-never-resolves">this unanswered link</a> and did not help as well</p>
  
  <p><em>When I use PUSH NOTIFICATION API (using PushManager), there are NO errors and everything is working and I am getting subscription object back. Is this a problem with swPush implementation, or my mistake?</em> </p>
  
  <p><strong>notification-service.ts</strong></p>
  
  <pre><code>this.swPush.requestSubscription({
      serverPublicKey: this.VAPIDPublicKey
    })
    .then((sub: PushSubscription) =&gt; {
      const keys: SubscriptionObjectKeys = {
        auth: sub.toJSON().keys.auth,
        p256dh: sub.toJSON().keys.p256dh
      };
      const subscriptionObject: SubscriptionObject = {
        endpoint: sub.endpoint,
        expirationTime: 0,
        keys: keys
      };
      resolve(subscriptionObject);
    })
    .catch(err =&gt; {
      console.error('Could not subscribe to notifications', err);
      reject(err);
    });
  </code></pre>
  
  <p><strong>Error in Chrome</strong></p>
  
  <pre><code>Error: Service workers are disabled or not supported by this browser
  at e.requestSubscription (service-worker.js:391)
  at notification.service.ts:123
  at new D (zone-evergreen.js:960)
  at t.&lt;anonymous&gt; (notification.service.ts:103)
  at Generator.next (&lt;anonymous&gt;)
  at tslib.es6.js:73
  at new D (zone-evergreen.js:960)
  at o (tslib.es6.js:69)
  at t.subscribeToSWPush (common-es2015.ffedc7b115b497dcd514.js:1)
  at t.&lt;anonymous&gt; (notification.service.ts:61)
  </code></pre>
  
  <p>I have checked this in macOS and Windows 10 as well, with HTTP Server and SSL. Both shows same problem. </p>
  
  <p>I created a new Ionic app and implemented the same code, which is working fine there. I am not able to isolate the issue.</p>
  
  <p>Any suggestion would be really helpful.</p>