Last active
May 18, 2017 05:53
-
-
Save ronekko/27cf9a0076a007cabf13a04098768b1c to your computer and use it in GitHub Desktop.
スペースアルクで検索後にテキストボックスを空にする
This file contains hidden or 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
| // ==UserScript== | |
| // @name ALC - Auto-clear Textbox | |
| // @namespace http://profile.livedoor.com/ronekko/ | |
| // @description スペースアルクで検索後にテキストボックスを空にする | |
| // @include http://eow.alc.co.jp/* | |
| // @include https://eow.alc.co.jp/* | |
| // @version 20170518 | |
| // ==/UserScript== | |
| var textbox = document.getElementById('q'); | |
| var value = textbox.value; | |
| textbox.value = ''; | |
| document.getElementById('searchWord').addEventListener('click', function(event){ | |
| textbox.value = value; | |
| textbox.focus(); | |
| }, true); | |
| document.addEventListener('keydown', function(e){ | |
| textbox.focus(); | |
| }, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment