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

Add ability to traverse through Shadow DOM #38

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

arminbashizade
Copy link
Contributor

@arminbashizade arminbashizade commented Aug 24, 2023

  • add ally.js to observe mutation from shadow DOMs (docs)
  • add recursive method to get active element
  • update traverse to dive into children or shadowRoot's children
  • recreate AOM tree when observed mutation includes addition/deletion of shadow roots

test on this page: https://js-odeam3.stackblitz.io (source code)

@ziolko
Copy link
Owner

ziolko commented Aug 30, 2023

@arminbashizade This is great stuff. I am shocked that so little code was required to support shadow DOM. Thanks for this contribution and sorry for the late reply.

Unfortunately, the test page you've provided doesn't seem to contain any content. I will test it on https://www.webcomponents.org/ and if everything is good I will merge and release it either today or tomorrow.

@arminbashizade
Copy link
Contributor Author

@ziolko my bad I'd forgot to save the files in Stackblitz 😅 you can try again now

@ziolko
Copy link
Owner

ziolko commented Aug 30, 2023

This is obviously a great improvement. Unfortunately, due to WICG/webcomponents#204 it fails to observe shadow DOM roots created after ARIA DevTools was enabled on the page (you can see an example at https://stackblitz.com/edit/js-ukrqkc?file=index.js). Do you have an idea how this could be improved?

Anyway, I'd like to merge and release this change. I keep list of contributors at https://github.com/ziolko/aria-devtools#contributors- . Are you OK with adding you there?

@arminbashizade
Copy link
Contributor Author

arminbashizade commented Aug 30, 2023

This is obviously a great improvement. Unfortunately, due to WICG/webcomponents#204 it fails to observe shadow DOM roots created after ARIA DevTools was enabled on the page (you can see an example at https://stackblitz.com/edit/js-ukrqkc?file=index.js). Do you have an idea how this could be improved?

@ziolko I pushed some changes that would recreate the AOM tree when observed mutation includes addition/deletion of shadow roots, not sure if that's the most efficient way or if I can update just part of the tree, though. Let me know if I can improve that.

Anyway, I'd like to merge and release this change. I keep list of contributors at https://github.com/ziolko/aria-devtools#contributors- . Are you OK with adding you there?

of course, I'd be happy to be included.

@ziolko
Copy link
Owner

ziolko commented Aug 31, 2023

Looks great! I will release it tomorrow and should appear on Chrome store in the next few days.

@ziolko ziolko merged commit f26003c into ziolko:master Aug 31, 2023
@ziolko
Copy link
Owner

ziolko commented Sep 1, 2023

@arminbashizade I have released a new version and added you to the list of contributors. Thanks you for this PR and for your help!

@arminbashizade arminbashizade deleted the shadow-dom branch September 1, 2023 15:23
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.

2 participants