Some websites have the annoying quality of auto-refreshing using some JS magic. This seems to bypass the browser’s “do not auto refresh” options.
My question – is there a simple way of telling the browser (also via JS, in an add-on) “do not listen to them! Never auto-refresh!”?
EDIT: Just to make myself clear – I want to write a browser extension that prevents the current page from giving a “refresh” signal – whether auto-refresh or “standard” refresh given automatically by the page using some timer. I think that’s a standard JS question…
Edit: Sorry, I missunderstood the question!
I think that what you need is this:
When the window will receive the events of keypress, keyup e keydown signals that the default behavior MUST be prevented. If you return false, you will stop the event chain, preventing to execute anything too. The two lines have the same effect, give a try commenting each line.
Here is a improoved example: