Index: content/browser/service_worker/service_worker_dispatcher_host.cc |
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc |
index aa954ee1dd0f34a158417c8675def8e9efc585cb..89edad276fb1ae7d78e544d0d8b74092982fa0a1 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc |
@@ -561,6 +561,10 @@ void ServiceWorkerDispatcherHost::OnSetHostedVersionId( |
GetContext()->GetLiveRegistration(version->registration_id()); |
DCHECK(registration); |
+ // Set the document URL to the script url in order to allow |
+ // register/unregister/getRegistration on ServiceWorkerGlobalScope. |
+ provider_host->SetDocumentUrl(version->script_url()); |
+ |
ServiceWorkerRegistrationObjectInfo info; |
ServiceWorkerVersionAttributes attrs; |
GetRegistrationObjectInfoAndVersionAttributes( |