Skip to content

Instantly share code, notes, and snippets.

@netroy
Forked from ebidel/highlight_custom_elements.js
Last active August 29, 2015 14:01
Show Gist options
  • Save netroy/d7cc77cf8f1f917a3345 to your computer and use it in GitHub Desktop.
Save netroy/d7cc77cf8f1f917a3345 to your computer and use it in GitHub Desktop.
highlight all custom elements in dom
[].forEach.call(document.all,function(e){-1!==e.constructor.name.indexOf("-")&&(e.style.border="3px solid red")});
javascript:(function(){[].filter.call(document.all,function(el){return el.localName.indexOf('-')!=-1||el.getAttribute('is');}).forEach(function(el,i){el.style.border='3px solid red';});})();
[].forEach.call(document.all, function(el) {
(el.localName.indexOf('-') != -1) && (el.constructor !== HTMLElement) && (el.style.border = '3px solid red');
});
// Highlights all custom elements on the page.
// To create a bookmarklet, use http://ted.mielczarek.org/code/mozilla/bookmarklet.html
[].filter.call(document.all, function(el) {
return el.localName.indexOf('-') != -1 || el.getAttribute('is');
}).forEach(function(el, i) {
el.style.border = '3px solid red';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment