Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct element detection for iframe compatibility #667

Closed
wants to merge 1 commit into from
Closed

fix: correct element detection for iframe compatibility #667

wants to merge 1 commit into from

Conversation

hamedbaatour
Copy link

🚨 Issue:
getCssSelector throws errors when applied to iframe elements.

🛠️ Fix:
Replacing instanceof with Node.ELEMENT_NODE resolves this issue. Unlike instanceof, Node.ELEMENT_NODE isn't context-dependent, ensuring consistent behavior across documents.

@fczbkk fczbkk closed this in bc26e3e Jun 2, 2024
@fczbkk fczbkk self-assigned this Jun 2, 2024
@fczbkk fczbkk added the bug label Jun 2, 2024
@fczbkk
Copy link
Owner

fczbkk commented Jun 2, 2024

Hey @hamedbaatour, thanks for the pull request. I'm closing this pull request because, in the end, I did a bit more complex fix - I have added some extra checks for edge cases and added tests.

I have released v3.6.8, which contains the fix. Please update your dependency:
https://github.com/fczbkk/css-selector-generator/blob/master/CHANGELOG.md#368-2024-06-02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants