Created
March 5, 2013 21:49
-
-
Save thefuxia/5094625 to your computer and use it in GitHub Desktop.
Userscript: Remove tabindex attributes Tested in Opera only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove tabindex attributes | |
// @namespace remove-tabindex-toscho | |
// @description Removes all tabindex attributes | |
// @author Thomas Scholz | |
// ==/UserScript== | |
if ( tabFucked = document.querySelectorAll( "[tabindex]" ) ) { | |
for ( var i = 0, max = tabFucked.length; i < max; i++ ) { | |
if ( 0 != tabFucked[i].getAttribute( "tabindex" ) ) | |
tabFucked[i].removeAttribute( "tabindex" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as i originally suggested, though, i'd only remove tabindex > 0. otherwise, this kills cases like tabindex=0 (making not-normally-focusable elements focusable) and tabindex=-1 (allowing for JS focus to be set but not keyboard focusable)