Every line of 'window location hash' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
12 function getWindowHash() { 13 let hash = window.location.hash.replace(/^#\/?|\/$/g, ''); 14 15 //Do not include state 16 hash = hash.split(URL_STATE_DELIM)[0]; 17 18 //console.log('hash:', hash); 19 return hash; 20 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
67 function _getWindowHash(){ 68 //parsed full URL instead of getting location.hash because Firefox decode hash value (and all the other browsers don't) 69 //also because of IE8 bug with hash query in local file [issue #6] 70 var result = _hashValRegexp.exec( hasher.getURL() ); 71 return (result && result[1])? decodeURIComponent(result[1]) : ''; 72 }
89 get hash(): string { 90 if (this._location === null) { 91 return null; 92 } 93 94 return this._location.hash; 95 }
37 get hash(): string { 38 return this.appLocation.hash; 39 }
34 get hash() { return this._location.hash; }