Thursday, December 25, 2008

conkeror: Copy the current URL to clipboard

As I discover the most frequently used features that I miss, one of them apparently is
to copy the current URL to the clipboard, for subsequent inclusion into web 0.2 tools - like email.

This piece adds the missing functionality. Initially I thought to couple it with editing - something like "edit the current URL and open in the new window", but it seems it is a "nice to have" functionality which I'd never use anyway. So, no dead code!


interactive("copy-current-url-to-clipboard",
"Copy the current URL to clipboard",
function(I) {
var a_url = I.buffer.display_URI_string;
writeToClipboard(a_url);
I.minibuffer.message("URL " + a_url + " copied!");
});



define_key(content_buffer_normal_keymap, "C-c",
"copy-current-url-to-clipboard", $category = "Movement");

No comments: