Question

I'm trying to write a bookmarklet that will call encodeURI on the selected text in the address bar of Firefox.

I know about document.location but it doesn't quite cut it because I want the user to be able to select the text from the URL they wish to use not just all of the text, the domain name, the path, the port, or the anchor.

Was it helpful?

Solution

The cursor position in the URL bar is not scriptable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top