1/** 2 * Image Gallery - Hash Guard 3 * Prevents SyntaxErrors in third-party scripts that attempt to use 4 * PhotoSwipe's malformed URL hashes (#&gid=...) as CSS selectors. 5 */ 6(function() { 7 function clearMalformedHash() { 8 var hash = window.location.hash; 9 // If hash starts with #&, it's a PhotoSwipe hash that crashes querySelector 10 if (hash && hash.indexOf('&gid=') !== -1) { 11 if (window.history.replaceState) { 12 // Remove the hash without reloading the page 13 window.history.replaceState(null, null, window.location.pathname + window.location.search); 14 } else { 15 window.location.hash = ''; 16 } 17 console.log('IGP: Malformed hash cleared to prevent theme script conflicts.'); 18 } 19 } 20 21 // Run immediately 22 clearMalformedHash(); 23 24 // Also listen for hash changes in case another script adds it back 25 window.addEventListener('hashchange', clearMalformedHash); 26})();
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.