Skip to content

Instantly share code, notes, and snippets.

@nanaya
Created July 25, 2019 15:24
Show Gist options
  • Save nanaya/d62bffff14eebcac9523c62ed091d3fd to your computer and use it in GitHub Desktop.
Save nanaya/d62bffff14eebcac9523c62ed091d3fd to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Jisho.org no focus unless empty
// @namespace https://myconan.net
// @version 0.0.1
// @description Don't focus input box unless empty
// @author nanaya
// @match https://jisho.org/*
// @grant none
// ==/UserScript==
;(function () {
'use strict'
var inputBox = document.getElementById('keyword')
var restore = function () {
inputBox.disabled = false
if (inputBox.value === '') {
inputBox.focus()
}
}
if (inputBox != null) {
inputBox.disabled = true
setTimeout(restore, 1)
}
}).call()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment