Bug 1142768 - Return the original document URI from ServiceWorkerClient.url; r=bkelly

This commit is contained in:
Ehsan Akhgari 2016-01-07 15:48:56 -05:00
Родитель ce49978208
Коммит ec2c39ef0c
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -46,7 +46,12 @@ ServiceWorkerClientInfo::ServiceWorkerClientInfo(nsIDocument* aDoc)
mWindowId = innerWindow->WindowID();
}
aDoc->GetURL(mUrl);
nsCOMPtr<nsIURI> originalURI = aDoc->GetOriginalURI();
if (originalURI) {
nsAutoCString spec;
originalURI->GetSpec(spec);
CopyUTF8toUTF16(spec, mUrl);
}
mVisibilityState = aDoc->VisibilityState();
ErrorResult result;

Просмотреть файл

@ -1,2 +1,8 @@
<!DOCTYPE html>
<title>Empty doc</title>
<!--
Change the page URL using the History API to ensure that ServiceWorkerClient
uses the creation URL.
-->
<body onload="history.pushState({}, 'title', 'new-url.html')">
</body>