Try it by clicking the following link:
Enable HTML SightYou can install the functionality as a "bookmarklet" by adding that link to your bookmarks, which lets you enable HTML sight on any webpage just by clicking the bookmark.
There's also the option to turn it back off.
Learn more about bookmarklets here.
The code is below, but these are the general steps involved:
const tags=Array.from(new Set(Array.from(document.body.querySelectorAll('*'), e => e.nodeName.toLowerCase())));
const style=document.querySelector('.html-sight') || document.createElement('style');
style.classList.add('html-sight');
style.innerHTML = tags.map(tag => `
${tag}:before{
content: '<${tag}>';
}
${tag}:after {
content: '${tag}>';
}
`).join('\n');
document.head.appendChild(style);