-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
improve DOM inspector #3254
improve DOM inspector #3254
Conversation
- Fix race between userCSS injection and element highlight resulting in none or not all elements highlighted. - Fix page being scanned twice resulting in unneeded slowdown.
Thanks, I will look into this a bit later today. Sorry for the delay, I must have turned off notifications somewhere a while ago, I need to find out how to re-enable again now that the repo is more quiet (there was too much of them when I first published the stable webext version). |
filterMap.set(node, entry.raw); | ||
} | ||
// Upgrade declarative selector to procedural one | ||
filterMap.set(node, entry.raw); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need to address this in the future, there used to be a time were I was reporting all filters matching a node. I can't remember why I removed this ability, I probably felt the code was growing complicated and needed to simplify until I got all under control. Anyway, what is the thinking for overriding plain CSS selector with a procedural one when there is collision? (I don't have a set opinion, just curious).
@@ -363,6 +363,7 @@ var domLayout = (function() { | |||
|
|||
var journalFromMutations = function() { | |||
var nodelist, node, domNode, nid; | |||
mutationTimer = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. Good catch.
@@ -800,8 +800,7 @@ var start = function() { | |||
document.removeEventListener(ev.type, onReady); | |||
} | |||
vAPI.messaging.sendTo(loggerConnectionId, domLayout.get()); | |||
vAPI.domFilterer.toggle(false); | |||
highlightElements(); | |||
vAPI.domFilterer.toggle(false, highlightElements); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I see what was happening: the highlighter was called before the user stylesheets were removed (from extension process), hence causing the highlighter to see only empty boxes. I was puzzle as to why there was this glitch with Firefox but deferred investigation. Nice catch.
Looks all good to me. |
Thanks. |
Hi there,
I've found that the page is scanned twice. First in
bootstrap()
and later inonReady()
both resulted incosmeticFilterMapper.reset();
causing massive slowdowns. Initial open of the dom inspector can take a long time ~3s or so, so it is quite important to not do the work twice by accident.Also I've fixed visual annoyance where elements are highlighted after first scroll because of race condition between dom filtering disable and highlight code.
Update:
Thanks.
Kacper