diff --git a/service-worker.js b/service-worker.js index 4b49c7e..1bc55fb 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1012,7 +1012,23 @@ let initFromRequest = (req) => { //mode: req.mode, TODO: commented out because mode: navigate is haram in service worker, it seems //credentials: req.credentials, TODO: commented out because credentials: "include" is haram if the Access-Control-Allow-Origin header is '*' cache: req.cache, - redirect: req.redirect, + + // `req.redirect` is usually "manual": + // + // + // It is not useful for fetch() requests + // as on redirect it returns a response with "opaqueredirect" type + // 0 response code and no way to get actual location: + // . + // + // This approach has a drawback of not changing the URL + // in a browser when following the redirect for the page + // (in contrast to some resource like an image where it does not matter), + // but there is no better option until browsers provide some way + // to access redirect responses such as the one + // proposed in . + redirect: "follow", + referrer: req.referrer, integrity: req.integrity }