Bug 936271 - Ignore dynamic session history entries r=yoric

This commit is contained in:
Tim Taubert 2014-01-24 22:26:47 +01:00
parent 107799a35a
commit d9a213f4df

View File

@ -105,6 +105,21 @@ let SessionHistoryInternal = {
return data;
},
/**
* Determines whether a given session history entry has been added dynamically.
*
* @param shEntry
* The session history entry.
* @return bool
*/
isDynamic: function (shEntry) {
// shEntry.isDynamicallyAdded() is true for dynamically added
// <iframe> and <frameset>, but also for <html> (the root of the
// document) so we use shEntry.parent to ensure that we're not looking
// at the root of the document
return shEntry.parent && shEntry.isDynamicallyAdded();
},
/**
* Get an object that is a serialized representation of a History entry.
*
@ -183,7 +198,7 @@ let SessionHistoryInternal = {
for (let i = 0; i < shEntry.childCount; i++) {
let child = shEntry.GetChildAt(i);
if (child) {
if (child && !this.isDynamic(child)) {
// Don't try to restore framesets containing wyciwyg URLs.
// (cf. bug 424689 and bug 450595)
if (child.URI.schemeIs("wyciwyg")) {