Bug 1344857 - SessionStore does not return titles for tabs which have a url that is identical to the title, r=mikedeboer

MozReview-Commit-ID: H7dHJo6rOuz

--HG--
extra : rebase_source : 6f4c483db21d659e84878f29bb1bb4e7ab6e3781
This commit is contained in:
Bob Silverberg 2017-04-11 13:50:24 -04:00
Родитель efd838dbde
Коммит b945ec9ade
2 изменённых файлов: 4 добавлений и 6 удалений

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

@ -155,6 +155,9 @@ add_task(function* test_about_page_navigate() {
is(entries.length, 1, "there is one shistory entry");
is(entries[0].url, "about:blank", "url is correct");
// Verify that the title is also recorded.
is(entries[0].title, "about:blank", "title is correct");
browser.loadURI("about:robots");
yield promiseBrowserLoaded(browser);

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

@ -146,13 +146,8 @@ var SessionHistoryInternal = {
* @return object
*/
serializeEntry(shEntry) {
let entry = { url: shEntry.URI.spec };
let entry = { url: shEntry.URI.spec, title: shEntry.title };
// Save some bytes and don't include the title property
// if that's identical to the current entry's URL.
if (shEntry.title && shEntry.title != entry.url) {
entry.title = shEntry.title;
}
if (shEntry.isSubFrame) {
entry.subframe = true;
}