Skip to content

Is there a way to debug code annotations? #7770

Answered by Andre601
Andre601 asked this question in Q&A
Discussion options

You must be logged in to vote

I finally got something to work here...

The issue was indeed the replacement of the HTML, which seems to remove listeners, which annotations for sure register.
One solution is to create and use a TreeWalker, as that one preserves pre-existing listeners. Issue here was, that it only accepts a single Node and not multiple (i.e. those returned from querySelectorAll) and querySelector only returns the first match.

So solution here was to use querySelectorAll and call forEach to then apply a treewalker on each element in it.
I don't know if that can be improved, but it seems to work for now.

My full JS:

document$.subscribe(async () => {
    const url = 'https://api.allorigins.win/raw?url='
    c…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@kamilkrzyskow
Comment options

@Andre601
Comment options

@Andre601
Comment options

@Andre601
Comment options

Answer selected by Andre601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants