“Corrupted Content Error” on Firefox with Polymer/

2019-04-16 00:54发布

问题:

I have a Polymer app with service workers hosted with Firebase. The app works fine on every browser except Firefox. When you try to refresh the browser in Firefox after initial load (which works), it throws the following error:

A ServiceWorker passed a redirected Response to FetchEvent.respondWith() while RedirectMode is not ‘follow’

The service-worker.js is auto-generated by the polymer-cli (v0.16.0).

回答1:

To address this known issue, set the redirect option to follow in your service worker's fetch() requests:

fetch(..., { redirect: 'follow' })