about summary refs log blame commit diff stats
path: root/js/bookmarklets/a11y.js
blob: b05ae71e7af849c99f6d0d9f21532ac1ce06d2be (plain) (tree)
1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
javascript:(function(){if(window.focusHighlighter){console.log('Focus highlighter already active.');return;}window.focusHighlighter=true;const style=document.createElement('style');style.id='focus-highlighter-style';style.textContent='.focus-highlight{outline:2px solid red !important;outline-offset:2px !important;}';document.head.appendChild(style);function handleFocus(event){document.querySelectorAll('.focus-highlight').forEach(el=>el.classList.remove('focus-highlight'));if(event.target){event.target.classList.add('focus-highlight');console.log('Focused Element:',event.target);console.log('Tag Name:',event.target.tagName);console.log('Attributes:',Array.from(event.target.attributes).map(attr=>`${attr.name}="${attr.value}"`).join(', '));console.log('Accessible Name:',event.target.getAttribute('aria-label')||event.target.textContent.trim());}}window.addEventListener('focusin',handleFocus);console.log('Focus highlighter activated. Click the bookmarklet again to deactivate.');})();