devrelm / resize-observer

Other
98 stars 12 forks source link

allow observing elements within iframes (fixes #98) #99

Closed devrelm closed 3 years ago

devrelm commented 3 years ago

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.