mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
No issue - Replacing location might throw NS_ERROR_UNEXPECTED while the developer tools window is being destroyed
This commit is contained in:
parent
6e1c585539
commit
58525f05f2
1 changed files with 9 additions and 7 deletions
|
|
@ -2182,14 +2182,16 @@ Toolbox.prototype = {
|
|||
.then(() => {
|
||||
this._removeHostListeners();
|
||||
|
||||
// `location` may already be null if the toolbox document is already
|
||||
// in process of destruction. Otherwise if it is still around, ensure
|
||||
// releasing toolbox document and triggering cleanup thanks to unload
|
||||
// event. We do that precisely here, before nullifying the target as
|
||||
// various cleanup code depends on the target attribute to be still
|
||||
// defined.
|
||||
if (win.location) {
|
||||
// `location` may already be invalid if the toolbox document is
|
||||
// already in process of destruction. Otherwise if it is still
|
||||
// around, ensure releasing toolbox document and triggering cleanup
|
||||
// thanks to unload event. We do that precisely here, before
|
||||
// nullifying the target as various cleanup code depends on the
|
||||
// target attribute to be still defined.
|
||||
try {
|
||||
win.location.replace("about:blank");
|
||||
} catch (e) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
// Targets need to be notified that the toolbox is being torn down.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue