Skip to content

Commit

Permalink
[embedlite-components] Ensure restored history entries have a trigger…
Browse files Browse the repository at this point in the history
…ingPrincipal. Fixes JB#51572

When the history entries are restored when the browser starts up, or on
a tab change, the triggeringPrincipal must be set on them, otherwise
DocShell won't allow them to be used with the GoBack()/GoForwards()
methods.

This change adds a NullPrincipal(), which is considered a valid value
(i.e. not a null pointer).
  • Loading branch information
llewelld authored and rainemak committed Oct 29, 2020
1 parent 698504e commit 6fb652e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jsscripts/embedhelper.js
Expand Up @@ -331,6 +331,7 @@ EmbedHelper.prototype = {
}
let historyEntry = Cc["@mozilla.org/browser/session-history-entry;1"].createInstance(Ci.nsISHEntry);
historyEntry.setURI(uri);
historyEntry.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
shist.addEntry(historyEntry, true);
});
if (index < 0) {
Expand Down

0 comments on commit 6fb652e

Please sign in to comment.