Is there any way to exclude element to be inspected?
See original GitHub issueHey, thanks for this lib, you did a great job!
Use Case:
I’m creating a lib which creates a kind of online inspector for the current website when my script is injected on the browser. In order words, when a user adds my script to its website, it injects a kind of toolbar allowing him to perform some actions such as activating or deactivating the dom-inspector.
Since I can’t know in advance the website structure, I set by default the dom inspector root target as body
. This work well except that when the inspector is activated it also inspect my injected toolbar which is a behavior I would like to avoid.
Question:
Is there any way to give ‘non-inspectable elements selectors’ during the initialization of the inspector? Something like:
const inspector = new DomInspector({
root: 'body',
except: ['#do-not-inspect-this', '.nor-this'],
});
I’m almost sure it’s not possible right now, but do you have any hint about how to implement it, and are you open to an eventual pull request?
Thanks in advance for considering my request 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
In theory, the
except
option will not inspect itself and all children.Well, if use
recursive
option to avoid this case, will make api so complex.So if want to inspect children on
except
parent node, I think we cannew
another inspector on children.Just like:
close it.