PDA

View Full Version : Controlling refresh in Netscape browsers


Vizier
05-21-2003, 03:46 PM
How can I prevent refreshing in Netscape 4 and 6 series by controlling the Ctrl + R and the F5 keys? It is a little urgent liorean, alien51, and brothercake pls help me out!!!!

Thanks in advance!
Vizier :confused:

liorean
05-21-2003, 03:50 PM
For nn4, I don't think there is anything you can do. You could always go have a look at the usual place, <http://www.din.or.jp/~hagi3/JavaScript/JSTips/Mozilla/Samples/KeyEvent.htm>, and experiment from there, but I don't think there's anything you can do about it.

As for Mozilla and derivates such as Netscape>5 however, you can only override it if you change the key bindings. (They are contained in some XUL, RDF or XBL file somewhere, I would guess under the chrome directory)

In other words, you can't do it in a webpage. (There is a possibility that you can if you enable universal browser read, but I doubt it. That's a security override, not a privacy override)


[:edit:

I didn't really read the question at first. Sorry about that.]

Vizier
05-21-2003, 04:11 PM
liorean,

Kindly think it over again and give me an optimistic answers please.

Vizier:(

liorean
05-21-2003, 04:54 PM
Oh, you can capture the document key event, but not the user interface event by JavaScript. Thus, if you cancel the event, you only cancel it's effect in the documnt, not it's effect on the user interface. I'm sorry, but there is nothing you can do.

Vizier
05-22-2003, 08:54 AM
liorean, alien51, and brothercake,

Is there anyway I could prevent the refreshing of the page by the F 5 key in Netscape 6???

:(
Vizier

liorean
05-22-2003, 11:24 AM
... there is no way.

brothercake
05-22-2003, 02:17 PM
As liorean said - no, there is no way.

Vizier
05-23-2003, 01:56 PM
Can I not use the CancelBubble() method or the preventDefault() method of Netscape 6 to achieve this. Pls comment liorean, brothercake, and Alien51???
:confused:

Thanks in advance......
Vizier

liorean
05-23-2003, 04:02 PM
As I said, you can stop document events, but not interface events. The reloading of the page is an interface event.

<rant>
Please, we have given you an answer already. Pressing us will not get you another answer. If you don't believe us, go experiment if you can do it somehow even though we say you cannot. If you're not going to trust us when we tell you it can't be done, why ask at all? Go ask in #mozillazine or on irc.mozilla.org if you don't trust the answers we give you. If you find our answer is incorrect, tell us about it.

Understand, neither Brothercake nor I are complete oracles, and you can't demand an answer out of any of us. We are just persons that know this better than most, and we're helping people here on our own time. We are not here as a service to you people, we are here because we feel we get something out of it, too. We read through pretty much every message that comes across these forums, and we try to answer those those we are interested in and that we feel like we can help with, or those discussions we believe we have something to add to.
</rant>