I am trying to override the window.location in Firefox, through the following code and keep getting an error (actually want to prevent the default behavior, but I think that's not relevant) :
Code :
window.__defineGetter__('location', function() {});
Error
redeclaration of var location
I started with the suggestions at Programatically disable window.location.reload?, but didn't work.
Thanks in advance, Sunil
The
location
property of Window is non-configurable for security reasons, because some broken things out in the wild base security checks on the value ofwindow.location.toString()
, so you can't do this.