WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
190041
Safari refuses to open pages with workbox due to “service worker redirection error”.
https://bugs.webkit.org/show_bug.cgi?id=190041
Summary
Safari refuses to open pages with workbox due to “service worker redirection ...
srikarocks
Reported
2018-09-27 09:56:31 PDT
I was using iOS 12 which is not available as an option currently. On websites which use workbox for service workers cannot be opened due to an error titled “Response served by service worker has redirections”. I first ran into this error on
https://v8.dev
which uses workbox. The v8 team, which wrote the website, confirmed on GitHub
https://github.com/v8/v8.dev/issues/4
that no redirects are used on the homepage. More details about this issue are on
https://github.com/v8/v8.dev/issues/4
Instructions to reproduce: Turn on service workers: Settings>Safari>Advanced>Experimental Features>ServiceWorker>ON. 1. Visit a workbox site (
https://v8.dev
) and bookmark the site 2. Close the tab and then close the browser 3. Reopen safari and open the bookmark. If the error doesn’t appear, repeat this step.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-09-28 16:18:42 PDT
<
rdar://problem/44878311
>
youenn fablet
Comment 2
2018-09-29 00:58:58 PDT
I reproduced the issue on iOS. It might be that we are incorrectly computing that the response is redirected, maybe we are not handling 304 correctly
youenn fablet
Comment 3
2018-09-29 02:49:44 PDT
Doing some debugging the following is happening: - A navigate load triggers a fetch event to "
https://v8.dev
" - The service worker fetches "
https://v8.dev/index.html
" - "
https://v8.dev/index.html
" is redirected to "
https://v8.dev
" which gives a response - response.redirected is set to true since there is a redirection. - Navigation load fails since it does not expect a redirected response as per spec. I guess the fix should be for the service worker to directly fetch "
https://v8.dev
".
Mathias Bynens
Comment 4
2018-09-29 05:29:17 PDT
Thanks for the info, Youenn! I’ll get the service worker fixed on our end. FWIW, this behavior does not match Chrome‘s, where the bug does not appear. Maybe there is still some kind of browser-compat bug here.
youenn fablet
Comment 5
2018-09-29 13:46:15 PDT
> FWIW, this behavior does not match Chrome‘s, where the bug does not appear. > Maybe there is still some kind of browser-compat bug here.
It seems so if the scripts are the same in iOS and elsewhere. Safari MacOS works, not iOS. On MacOS, index.html fetch event is answered by the DOM cache. On iOS, index.html is not in the DOM cache, fetch is used and it fails.
youenn fablet
Comment 6
2018-09-30 01:51:36 PDT
(In reply to youenn fablet from
comment #5
)
> > FWIW, this behavior does not match Chrome‘s, where the bug does not appear. > > Maybe there is still some kind of browser-compat bug here. > > It seems so if the scripts are the same in iOS and elsewhere. > Safari MacOS works, not iOS.
I hit this issue in MacOS as well.
> On MacOS, index.html fetch event is answered by the DOM cache. > On iOS, index.html is not in the DOM cache, fetch is used and it fails.
When hitting this issue in MacOS, the DOM cache is also empty.
youenn fablet
Comment 7
2019-01-04 10:06:03 PST
Marking as resolved for now.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug