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 89d45807fd71b712f24ccd795934aaa75970dbb7..e707151e9f77aab3a9fb2ec3028688b3e1abf7e3 100644 |
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc |
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc |
@@ -583,6 +583,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( |