views:

21

answers:

2

I would like some of my bookmarklets to adjust their behavior based on their current name.

For example, I'd like to edit a bookmarklet I use, so that it would increment the last integer in the current URL by 24 if it was named "+24", or decrement it by 10 if it was named "-10".

A: 

Using window.location object you can get information about current URL and redirect to a new one.

Crozin
I don't need the URL. What I want is the name the user has given to the bookmarklet.
gw
+1  A: 

No, not possible. At least in decent browsers.

Fabien Ménager