PageSourceSearch

https://amparo.org.uk/wp-content/themes/amparo/js/skip-link-focus-fix.js?ver=1790242493

js amparo.org.uk collected 2026-09-24 10:33:13 UTC 781 bytes, 30 lines download raw bytes

1/*
2 * skip-link-focus-fix.js.
3 */
4 
5( function() {
6	var isWebkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
7	    isOpera  = navigator.userAgent.toLowerCase().indexOf( 'opera' )  > -1,
8	    isIe     = navigator.userAgent.toLowerCase().indexOf( 'msie' )   > -1;
9
10	if ( ( isWebkit || isOpera || isIe ) && document.getElementById && window.addEventListener ) {
11		window.addEventListener( 'hashchange', function() {
12			var id = location.hash.substring( 1 ),
13				element;
14
15			if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
16				return;
17			}
18
19			element = document.getElementById( id );
20
21			if ( element ) {
22				if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
23					element.tabIndex = -1;
24				}
25
26				element.focus();
27			}
28		}, false );
29	}
30})();

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.