Skip to content

Instantly share code, notes, and snippets.

@dada-amater
Forked from milo/fid-remove.js
Created April 20, 2017 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dada-amater/2c2efabfb19f3a4a0b48f5b4de34062d to your computer and use it in GitHub Desktop.
Save dada-amater/2c2efabfb19f3a4a0b48f5b4de34062d 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