leeand00
leeand00

Reputation: 26382

Using Javascript to return the selected text in the address bar in Firefox?

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.

Upvotes: 0

Views: 252

Answers (1)

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114347

The cursor position in the URL bar is not scriptable.

Upvotes: 1

Related Questions