Last active
April 6, 2016 22:01
-
-
Save AsianChris/2a58c5b093976eb014874fc936b95443 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
javascript: (function() { | |
var url = window.location.href; | |
var key = '_escaped_fragment_'; | |
var value = ''; | |
url = updateQueryStringParameter(url, key, value); | |
window.location.href = url; | |
// http://stackoverflow.com/a/6021027 | |
function updateQueryStringParameter(uri, key, value) { | |
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); | |
var separator = uri.indexOf('?') !== -1 ? "&" : "?"; | |
if (uri.match(re)) { | |
return uri.replace(re, '$1' + key + "=" + value + '$2'); | |
} else { | |
return uri + separator + key + "=" + value; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment