1/** 2 * skip-link-focus-fix.js 3 */ 4( function() { 5 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1; 6 var is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1; 7 var is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 8 9 if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { 10 window.addEventListener( 'hashchange', function() { 11 var id = location.hash.substring( 1 ); 12 var element; 13 14 if ( !( /^[A-z0-9_-]+$/.test( id ) ) ) { 15 return; 16 } 17 18 element = document.getElementById( id ); 19 20 if ( element ) { 21 if ( !( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 22 element.tabIndex = -1; 23 } 24 25 element.focus(); 26 } 27 }, false ); 28 } 29} )();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.