Skip to content

Instantly share code, notes, and snippets.

@jaikt
Last active September 14, 2021 06:29
Show Gist options
  • Save jaikt/c3b1de40ffb610c07cd61705d7de60b6 to your computer and use it in GitHub Desktop.
Save jaikt/c3b1de40ffb610c07cd61705d7de60b6 to your computer and use it in GitHub Desktop.
How To Remove ?M=1 From URL Blogger
<script type='text/javascript'>
//<![CDATA[
var uri = window.location.toString();
if (uri.indexOf("%3D","%3D") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("%3D"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("%3D%3D","%3D%3D") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("%3D%3D"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("&m=1","&m=1") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("&m=1"));
window.history.replaceState({}, document.title, clean_uri);
}
var uri = window.location.toString();
if (uri.indexOf("?m=1","?m=1") > 0) {
var clean_uri = uri.substring(0, uri.indexOf("?m=1"));
window.history.replaceState({}, document.title, clean_uri);
}
//]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment