Reviews for Find Duplicate IDs
Find Duplicate IDs by 55G
1 review
- Rated 1 out of 5by Lydia, 3 months agoRegrettably, I can't see any sign of this actually working. Perhaps the complete lack of documentation has caused me not to look in the right place for whatever results it's expected to show, but I can't see anything.
Finding duplicate IDs is trivial, of course, e.g.
{ dict = {}; for(const elt of document.querySelectorAll('[id]')) { id = elt.getAttribute('id'); if(dict[id]) { console.log("Duplicate ID: " + id); break;} else dict[id] = true;} }
Having a plugin for it should presumably take you a step beyond having to run a line of script in the debugger console, though.
As a developer you'd kinda like to be alerted to this sort of problem without actively having to think about it as a source of your bugs.
For me, I'd like to see a flashing light somewhere that tells me there are duplicate IDs on the page, and (say) clicking on it would tell me what the ID is.
I wouldn't particularly care if it were ugly or clunky, since, at least for me, duplicate IDs are a rare problem, so I don't generally think about them as a source of problems, and I want to stomp on them right away.
I'd prefer not to have to be in the debugger to have to discover the existence of duplicate IDs, which is what's necessary with the Chrome "dupid" plugin. I tried that one, and the results are hard enough to find that I'd never actually discover the existence of the duplicates, even though it seems to work OK.
Having a config option to let me restrict the pages scanned to (say) a domain regexp would be a nice feature too.
Anyway, I wish this had worked, but sadly it didn't, at least for me.