diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:05:55 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-30 23:05:55 +0200 |
commit | 3dec348f43b3633cdcd1cfa52bc24b0fba45cb84 (patch) | |
tree | b1d1415a87d7d049d7ebbae4c0e7953045cbfe7a /browser/components/sessionstore/SessionMigration.jsm | |
parent | 2cb9f3ceb89038721eb9528dcc56dd33b66b0c85 (diff) | |
download | UXP-3dec348f43b3633cdcd1cfa52bc24b0fba45cb84.tar UXP-3dec348f43b3633cdcd1cfa52bc24b0fba45cb84.tar.gz UXP-3dec348f43b3633cdcd1cfa52bc24b0fba45cb84.tar.lz UXP-3dec348f43b3633cdcd1cfa52bc24b0fba45cb84.tar.xz UXP-3dec348f43b3633cdcd1cfa52bc24b0fba45cb84.zip |
Bug 1307736 - Store triggeringPrincipal with all history entries
Diffstat (limited to 'browser/components/sessionstore/SessionMigration.jsm')
-rw-r--r-- | browser/components/sessionstore/SessionMigration.jsm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/browser/components/sessionstore/SessionMigration.jsm b/browser/components/sessionstore/SessionMigration.jsm index ff339eba9..1aa22f1a9 100644 --- a/browser/components/sessionstore/SessionMigration.jsm +++ b/browser/components/sessionstore/SessionMigration.jsm @@ -11,6 +11,9 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/Task.jsm", this); Cu.import("resource://gre/modules/osfile.jsm", this); +XPCOMUtils.defineLazyModuleGetter(this, "Utils", + "resource://gre/modules/sessionstore/Utils.jsm"); + // An encoder to UTF-8. XPCOMUtils.defineLazyGetter(this, "gEncoder", function () { return new TextEncoder(); @@ -27,7 +30,7 @@ var SessionMigrationInternal = { * only contain: * - open windows * - with tabs - * - with history entries with only title, url + * - with history entries with only title, url, triggeringPrincipal * - with pinned state * - with tab group info (hidden + group id) * - with selected tab info @@ -45,9 +48,11 @@ var SessionMigrationInternal = { var win = {extData: {}}; win.tabs = oldWin.tabs.map(function(oldTab) { var tab = {}; - // Keep only titles and urls for history entries + // Keep only titles, urls and triggeringPrincipals for history entries tab.entries = oldTab.entries.map(function(entry) { - return {url: entry.url, title: entry.title}; + return { url: entry.url, + triggeringPrincipal_base64: entry.triggeringPrincipal_base64, + title: entry.title }; }); tab.index = oldTab.index; tab.hidden = oldTab.hidden; @@ -60,7 +65,8 @@ var SessionMigrationInternal = { }); let url = "about:welcomeback"; let formdata = {id: {sessionData: state}, url}; - return {windows: [{tabs: [{entries: [{url}], formdata}]}]}; + let entry = { url, triggeringPrincipal_base64: Utils.SERIALIZED_SYSTEMPRINCIPAL }; + return { windows: [{ tabs: [{ entries: [ entry ], formdata}]}]}; }, /** * Asynchronously read session restore state (JSON) from a path |