No. You can try
(function(window){window.alert(window.location.href)})(this);
which ensures that you are not using any custom alert function from the global namespace. But you cannot prevent rewriting window.alert so that window.alert = function () { console.log('Haha!'); }; window.alert = function () { console.log('Haha!'); }; .
The location object must be fault tolerant, since the method of the browser’s internal configuration method prohibits any fraud there (which means that the window location attribute is effectively write-protected, like the window.location href attribute)
Edit:
Booklets don't seem to work in Firefox 6+ because of “social engineering bookmarking attacks,” and you can't do anything about it.
fooobar.com/questions/245273 / ...
https://bugzilla.mozilla.org/show_bug.cgi?id=527530
source share