B
Björn Langhof
Hello.
I'd like to overwrite a native function. It's the reload()-function of
the document.location-object. My idea:
document.location.reload = function(){alert('foo')};
So if the function document.location.reload() is called the alert should
appear. But it doesn't. The page is still reloaded.
Any suggestions how to solve this?
Background: I write a Firefox-Extension and want to change the behavior
of a web page.
A possible workaround is to trigger the onUnload-event of the
document-element. But this is also called when the page is left without
a reload.
Thanks for your help.
Björn
I'd like to overwrite a native function. It's the reload()-function of
the document.location-object. My idea:
document.location.reload = function(){alert('foo')};
So if the function document.location.reload() is called the alert should
appear. But it doesn't. The page is still reloaded.
Any suggestions how to solve this?
Background: I write a Firefox-Extension and want to change the behavior
of a web page.
A possible workaround is to trigger the onUnload-event of the
document-element. But this is also called when the page is left without
a reload.
Thanks for your help.
Björn