views:

77

answers:

4

To execute bookmarklet code the bookmarklet needs to be actioned by the user. Is there any way to have a bookmarklet or indeed any javascript run automatically on page load?

Or is an Add-on the way to go?

Thanks

A: 

Well, any javascript runs automatically using onload event, if thats what you need?

Sejanus
I think he means running JS on an arbitrary website by setting up something in the browser, such as a bookmarklet. I'm also pretty sure that there are a few add-ins that can do this for you, but am not going to "answer" the question as I can't provide any links offhand.
Graza
Ouch, I didnt even think about that. As Nils and you yourself already pointed out, its kinda obvious (potential) security hole.
Sejanus
+1  A: 

GreaseMonkey

acidzombie24
+2  A: 

I don't think that it is possible to autorun a bookmarklet on pageload. This could be used very maliciously.

I think a plugin is the best way to go here. If only for personal use, you should check out greasemonkey for Firefox.

Nils Riedemann
I would hope that people already know that it could be used maliciously, but this was *well worth* pointing out :-)
Graza
A: 

I think Opera allows you to auto inject js into a library of sites you specificy 'onload' regardless of ownership.

Eligmatic