Created
June 15, 2017 06:48
-
-
Save kmakita13714/8e5b5315c9453f5e607868c02df1edcf to your computer and use it in GitHub Desktop.
[ブックマークレット] 選択した単語や入力した単語をWeblioの英和辞典・和英辞典で検索する
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
javascript:(function(){x=document;y=window;if(x.selection){query=x.selection.createRange().text;}else if(y.getSelection){query=y.getSelection();}else if(x.getSelection){query=x.getSelection();};query=window.prompt('検索したい単語を入力してね',query);if(query!=null&&query!=""){window.open('http://ejje.weblio.jp/content/'+encodeURIComponent(query),'_blank','');}})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
単語を選択していれば、それを別ウィンドウで表示します。選択していなければ、ダイアログが表示されますので、ダイアログで入力した単語を別ウィンドウで表示します。