Bug 1638333 - BrowserTestUtilsChild.jsm: handleEvent - don't assume the load event target is from a document. r=Yoric

In the case of a <body> location won't be set.

Differential Revision: https://phabricator.services.mozilla.com/D76137
This commit is contained in:
Magnus Melin 2020-05-27 11:06:12 +00:00
parent 1432104c95
commit 4e45f2ae87

View File

@ -264,7 +264,9 @@ class BrowserTestUtilsChild extends JSWindowActorChild {
case "load": {
this.sendAsyncMessage(aEvent.type, {
internalURL: aEvent.target.documentURI,
visibleURL: aEvent.target.location.href,
visibleURL: aEvent.target.location
? aEvent.target.location.href
: null,
});
break;
}