зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1686748 - [devtools] Fix WalkerActor exception on server side target switching. r=nchevobbe
When using JSWindowActor based target, each target actor is destroyed on each reload/navigation. This code in walker actor is registering a DOMContentLoaded listener which only fires after the target is already destroyed. This leads to exceptions. Differential Revision: https://phabricator.services.mozilla.com/D114367
This commit is contained in:
Родитель
ae9fd2e09e
Коммит
47ab6f9ade
|
@ -2472,6 +2472,10 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
},
|
||||
|
||||
onFrameLoad: function({ window, isTopLevel }) {
|
||||
// By the time we receive the DOMContentLoaded event, we might have been destroyed
|
||||
if (this._destroyed) {
|
||||
return;
|
||||
}
|
||||
const { readyState } = window.document;
|
||||
if (readyState != "interactive" && readyState != "complete") {
|
||||
// The document is not loaded, so we want to register to fire again when the
|
||||
|
|
Загрузка…
Ссылка в новой задаче