Skip to content

Instantly share code, notes, and snippets.

@moroishi
Last active April 2, 2019 22:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moroishi/2802669 to your computer and use it in GitHub Desktop.
Save moroishi/2802669 to your computer and use it in GitHub Desktop.
選択されたテキストを英辞郎で検索するブックマークレット
javascript:var s = ''; if (window.navigator.appName == 'Microsoft Internet Explorer') {s = document.selection.createRange().text;} else {s = window.getSelection();} if (!s || s == '') {s = prompt('単語を入力してください。', '');} if (s) { window.open("http://eow.alc.co.jp/" + s); } void(0);
// 以下は整形したソース
var s = '';
if (window.navigator.appName == 'Microsoft Internet Explorer') {
s = document.selection.createRange().text;
} else {
s = window.getSelection();
}
if (!s || s == '') {
s = prompt('単語を入力してください。', '');
}
if (s) {
window.open("http://eow.alc.co.jp/" + s);
}
void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment