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

Idea: Attach VisBug to ShadowRoot #645

Open
jogibear9988 opened this issue Aug 27, 2024 · 5 comments
Open

Idea: Attach VisBug to ShadowRoot #645

jogibear9988 opened this issue Aug 27, 2024 · 5 comments

Comments

@jogibear9988
Copy link

Idea:

As adding visbug to a page could lead to side effects, wouldn't it be preferable to add it to it's own shadowroot?

Like:

      let sr = document.body.attachShadow({mode: 'open'});
      sr.innerHTML = "<slot></slot>"

And after this the VisBug overlays could be added to the ShadowRoot, without affecting the real Dom?

@jogibear9988 jogibear9988 changed the title Attach VisBug to ShadowRoot Idea: Attach VisBug to ShadowRoot Aug 27, 2024
@argyleink
Copy link
Member

i'm willing to try out a PR and test it 👍🏻
but visbug does apply attributes to nodes and does some other things that are still "side effects", but reducing them is indeed generally nice

@jogibear9988
Copy link
Author

I'll look to create a demo

@jogibear9988
Copy link
Author

i'm willing to try out a PR and test it 👍🏻 but visbug does apply attributes to nodes and does some other things that are still "side effects", but reducing them is indeed generally nice

I saw that it add's attributes for selection. Is there a reason for this? Why is the selection not stored in some varaibles?

@argyleink
Copy link
Member

i'm willing to try out a PR and test it 👍🏻 but visbug does apply attributes to nodes and does some other things that are still "side effects", but reducing them is indeed generally nice

I saw that it add's attributes for selection. Is there a reason for this? Why is the selection not stored in some varaibles?

it's never been an issue, and was using DOM state as the source of truth

@jogibear9988
Copy link
Author

Yeah, maybe it's my thinking cause I'm working on a designer, wich exports the html and so my output should not contain own added attributes.

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

No branches or pull requests

2 participants