Skip to content

Instantly share code, notes, and snippets.

@milo
Created April 20, 2017 12:46
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save milo/2b14b9e7855f1956dd8c6d311d9b2a3c to your computer and use it in GitHub Desktop.
Save milo/2b14b9e7855f1956dd8c6d311d9b2a3c to your computer and use it in GitHub Desktop.
Flash message _fid parameter remove.
(function (w, timeout) {
setTimeout(function () {
var url = w.location.toString();
if (w.history && w.history.replaceState && url.indexOf('_fid=') !== -1) {
w.history.replaceState({}, null, /[?&]_fid=[^&]+$/.test(url)
? url.replace(/[?&]_fid=[^&]+/, '')
: url.replace(/([?&])_fid=[^&]+&/, '$1')
);
}
}, timeout || 2000);
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment