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

Execute Script does not handle HTMLCollection and NodeLists properly #104

Closed
poftadeh opened this issue Dec 17, 2019 · 0 comments · Fixed by #105
Closed

Execute Script does not handle HTMLCollection and NodeLists properly #104

poftadeh opened this issue Dec 17, 2019 · 0 comments · Fixed by #105
Assignees
Labels
Priority: High Type: Bug Something isn't working

Comments

@poftadeh
Copy link
Contributor

poftadeh commented Dec 17, 2019

What happened:
The endpoint fails to return a NodeList or HTMLCollection in the proper format. It instead returns {0={}}.

What you expected to happen:
The endpoint should return an array of elements.

How to reproduce it (as minimally and precisely as possible):
Attempt to execute return document.querySelectorAll('body'); or return document.getElementsByTagName('body').

Anything else we need to know?:
This is likely caused by NodeList and HTMLCollection not being detected as array-like objects. One possible solution may be to convert them with Array.from() before passing them on to the element handler.

@poftadeh poftadeh added Type: Bug Something isn't working Priority: High labels Dec 17, 2019
@poftadeh poftadeh self-assigned this Dec 17, 2019
poftadeh added a commit that referenced this issue Dec 18, 2019
fix: correct NodeList and HTMLCollection handling in execute script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant