Created
December 7, 2010 18:17
-
-
Save oxoofo/732173 to your computer and use it in GitHub Desktop.
[.keysnail.js] 選択中のテキストを、タイトルとURLと罫線付きでコピー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [.keysnail.js] 選択中のテキストを、タイトルとURLと罫線付きでコピー | |
key.setViewKey( | |
'W', | |
function(){ | |
var w = window.content, d = w.document; | |
var txt = '┌────────────────────────────────────┐\r\n' + | |
'│' + d.title + '\r\n' + | |
'│' + d.location.href + '\r\n' + | |
'│──────────────────────────────────\r\n' + | |
w.getSelection() + '\r\n' + | |
'└────────────────────────────────────┘\r\n' ; | |
const CLIPBOARD = Components.classes["@mozilla.org/widget/clipboardhelper;1"]. | |
getService(Components.interfaces.nsIClipboardHelper); | |
CLIPBOARD.copyString(txt); | |
}, | |
'選択中のテキストを、タイトルとURLと罫線付きでコピー' | |
); | |
// 参考: | |
// keysnailで、タイトルとURLをコピー → http://sheephead.homelinux.org/2009/09/27/1604/ | |
// 選択中のテキストを取得 → http://wannabe.sweet-smile.org/ent/eid105.htm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment