To prevent reload() you can do something like this:
var canReload = true; var realReload = window.reload; window.reload = function() { if (canReload) { realReload(); } }
Basically override the reload function with your own. I am not sure that the same thing can be done with the property assignment (where window.location set). You can look at the custom functions getter / setter ( __defineSetter__ ) for Firefox and create a setter for the location window property.
source share