Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c53ee10740bf00f166a5b0e0b5daab3933bcd7e4
https://github.com/WebKit/WebKit/commit/c53ee10740bf00f166a5b0e0b5daab3933bcd7e4
Author: Youenn Fablet <[email protected]>
Date: 2025-07-03 (Thu, 03 Jul 2025)
Changed paths:
A LayoutTests/http/wpt/service-workers/register-then-reload-expected.txt
A LayoutTests/http/wpt/service-workers/register-then-reload.html
A LayoutTests/http/wpt/service-workers/resources/lengthy-worker.py
A
LayoutTests/http/wpt/service-workers/resources/register-then-reload-iframe.html
M Source/WebCore/page/Location.cpp
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/Quirks.h
M Source/WebCore/page/QuirksData.h
M Source/WebCore/workers/service/ServiceWorkerContainer.cpp
M Source/WebCore/workers/service/ServiceWorkerContainer.h
M Source/WebCore/workers/service/ServiceWorkerJob.cpp
M Source/WebCore/workers/service/ServiceWorkerJob.h
Log Message:
-----------
WebKit is failing to register a service worker if script fetch is not fetched
when document is being reloaded
rdar://152398237
https://bugs.webkit.org/show_bug.cgi?id=294391
Reviewed by Chris Dumez.
Some websites will test whether a page is controlled by a service worker or not.
If not, they will start registering a service worker and will reload until the
page is controlled.
Reloading is expected to stop all loads, including the load to get the service
worker script.
If the load is not finished by the time the reload cancels all loads, the
service worker registration will fail.
This can make the website enter in a reload loop.
To prevent this, we add a quirk that delays reloading to happen until the
service worker registration job has finished, if any.
* LayoutTests/http/wpt/service-workers/register-then-reload-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/register-then-reload.html: Added.
* LayoutTests/http/wpt/service-workers/resources/lengthy-worker.py: Added.
(main):
*
LayoutTests/http/wpt/service-workers/resources/register-then-reload-iframe.html:
Added.
* Source/WebCore/page/Location.cpp:
(WebCore::Location::reload):
* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldDelayReloadWhenRegisteringServiceWorker const):
(WebCore::handleCapitalGroupQuirks):
(WebCore::Quirks::determineRelevantQuirks):
* Source/WebCore/page/Quirks.h:
* Source/WebCore/page/QuirksData.h:
* Source/WebCore/workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
(WebCore::ServiceWorkerContainer::hasServiceWorkerScriptFetch const):
(WebCore::ServiceWorkerContainer::whenScriptFetchJobFinished):
* Source/WebCore/workers/service/ServiceWorkerContainer.h:
* Source/WebCore/workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
(WebCore::ServiceWorkerJob::mayLoadScript const):
* Source/WebCore/workers/service/ServiceWorkerJob.h:
Canonical link: https://commits.webkit.org/296970@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes