Skip to content

Instantly share code, notes, and snippets.

@rajeshp
Forked from asabaylus/gist:4334372
Created May 15, 2014 08:16
Show Gist options
  • Save rajeshp/66cefcf139c96bd237e2 to your computer and use it in GitHub Desktop.
Save rajeshp/66cefcf139c96bd237e2 to your computer and use it in GitHub Desktop.
// paste the following into a new bookmark called CQ5 Preview
javascript:(function(){
function updateQueryStringParameter(uri, key, value) {
var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i");
separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
}
else {
return uri + separator + key + "=" + value;
}
}
var url = updateQueryStringParameter(document.location.href, "wcmmode", "disabled");
document.location.href = url.replace(/cf#\//, "");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment