Per #98, instanceof will return false if the object was constructed in the context of a different window.
Since the instance we're checking should be an Element, we can use target.ownerDocument to get the correct Document context and document.defaultView to get the correct window context for the given target element.
Per #98,
instanceof
will returnfalse
if the object was constructed in the context of a differentwindow
.Since the instance we're checking should be an
Element
, we can usetarget.ownerDocument
to get the correctDocument
context anddocument.defaultView
to get the correctwindow
context for the giventarget
element.