Skip to content

Instantly share code, notes, and snippets.

@dada-amater
dada-amater / fid-remove.js
Created April 20, 2017 20:00 — forked from milo/fid-remove.js
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);