This test shows how GreaseMonkey incorrectly fires a script twice when a replaceState() call is made before the window is loaded.

Code in this document:

window.addEventListener('DOMContentLoaded',function(){
	window.history.replaceState(document.url, null);
},false);

Test with this GM script:

// ==UserScript==
// @name        Greasemonkey pushState test
// @namespace   http://userscripts.org/users/86416
// @include     http://socialfixer.com/temp/*
// @run-at		document-start
// ==/UserScript==
alert("Greasemonkey test running: "+document.getElementsByTagName('BODY').length);

The problem does NOT happen when I monitor the window's "load" event rather than DOMContentLoaded.