Try this:
tell application "Firefox"
activate
set pb to the clipboard
tell application "System Events"
keystroke "l" using command down
keystroke "c" using command down
end tell
set page_url to the clipboard
set the clipboard to pb
end tell
It’s kind of hacked together and I haven’t tested it with rigor but until now it did its job. If you use it, please let me know if you could enhance it or whether it breaks for certain pasteboard contents.
[0]: http://www.zx2c4.com/projects/password-store/