How about a dialog from which you can copy the current URL?
javascript:void(prompt("URL:", location.href))
Part voiddoes not allow the browser to move when you click "OK" or "Cancel".
Putting a URL into the clipboard requires more work and differs from different browsers. If you really want to put data on the clipboard, specify the browsers that you need to support.
source
share