Skip to content

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

Merged
devrelm merged 4 commits intomasterfrom
devrelm/observe-iframe-target
Nov 15, 2021
Merged

allow observing elements within iframes (fixes #98)#99
devrelm merged 4 commits intomasterfrom
devrelm/observe-iframe-target

Conversation

@devrelm
Copy link
Owner

@devrelm devrelm commented Nov 15, 2021

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.

@devrelm devrelm force-pushed the devrelm/observe-iframe-target branch from a304990 to caeeac5 Compare November 15, 2021 17:41
@devrelm devrelm force-pushed the devrelm/observe-iframe-target branch from caeeac5 to 8ff5345 Compare November 15, 2021 17:42
@devrelm devrelm merged commit 0df1231 into master Nov 15, 2021
@devrelm devrelm deleted the devrelm/observe-iframe-target branch November 15, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant