mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1059308 - Switch to the next available top level window when the current one is destroyed. r=jryans
This commit is contained in:
parent
612c7d631f
commit
3a67889a94
@ -1017,10 +1017,24 @@ TabActor.prototype = {
|
||||
}
|
||||
|
||||
if (webProgress.DOMWindow == this._originalWindow) {
|
||||
// If for some reason (typically during Firefox shutdown), the original
|
||||
// document is destroyed, we detach the tab actor to unregister all listeners
|
||||
// and prevent any exception.
|
||||
this.exit();
|
||||
// If the original top level document we connected to is removed,
|
||||
// we try to switch to any other top level document
|
||||
let rootDocShells = this.docShells
|
||||
.filter(d => {
|
||||
return d != this.docShell &&
|
||||
this._isRootDocShell(d);
|
||||
});
|
||||
if (rootDocShells.length > 0) {
|
||||
let newRoot = rootDocShells[0];
|
||||
this._originalWindow = newRoot.DOMWindow;
|
||||
this._changeTopLevelDocument(this._originalWindow);
|
||||
} else {
|
||||
// If for some reason (typically during Firefox shutdown), the original
|
||||
// document is destroyed, and there is no other top level docshell,
|
||||
// we detach the tab actor to unregister all listeners and prevent any
|
||||
// exception
|
||||
this.exit();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user