Skip to content

Instantly share code, notes, and snippets.

@shinnya
Created July 4, 2010 05:16
Show Gist options
  • Save shinnya/463159 to your computer and use it in GitHub Desktop.
Save shinnya/463159 to your computer and use it in GitHub Desktop.
[KeySnail] Copy URL to clipboard
key.setViewKey('M-u', function (ev, arg) \
{
display.echoStatusBar("Copy URL to clipboard");
command.setClipboardText(getBrowser().contentDocument.URL);
}, 'Copy URL to clipboard');
@knoajp
Copy link

knoajp commented Aug 17, 2017

現行のFirefoxで動かなくなってるようなので、こちらで。
(下記も57で動かなくなるのかもしれないけど)

function (ev, arg) {
    command.setClipboardText(gBrowser.currentURI.spec);
    display.echoStatusBar("Copy URL to clipboard");
}

function (ev, arg) {
    command.setClipboardText(gBrowser.contentTitle + '\n' + gBrowser.currentURI.spec);
    display.echoStatusBar("Copied Title and URL");
}

@shinnya
Copy link
Author

shinnya commented Oct 16, 2017

レスポンス遅いですが、ご丁寧にどうもありがとうございます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment