Home » Questions » Computers [ Ask a new question ]

Firefox - Any way to prevent onload focus of form fields?

Firefox - Any way to prevent onload focus of form fields?

Is there any Firefox extension or built in configuration that will allow disabling onload focusing in text fields?

Asked by: Guest | Views: 243
Total answers/comments: 1
Guest [Entry]

"I do not know of anything specific, but as greasemonkey scripts run as soon as the DOM is populated but before the onload event handlers are called (as stated in http://greasemonkey.mozdevdotorg/authoring.html) you could write a script that disabled, or changed, the onload event for the sites you want the behaviour removed from.

You would have to do this on a per-site basis though, as some sites will do more than just refocus during the onload event and you probably want the other behaviour to run.

This also won't work for sites that do the refocus directly while the page is rendering (by calling the focus method directly in a <SCRIPT> block instead of in code called by the onload event.

It might be worth searching http://userscriptsdotorg/ to see if there are any existing scripts there for the sites you want to change the behaviour of."