// ==UserScript== // @name auto focus on first // @name:zh 自动聚焦第一个输入框 // @namespace @Vinsea // @version 0.2.1 // @description auto foucs on first input box // @description:zh 默认聚焦到第一个搜索框中 // @author Vinsea // @match * // @match http*://*/* // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; var firstInput = document.querySelector('input:not([type=hidden])'); if(firstInput){ var val = firstInput.value; firstInput.value = ''; firstInput.focus(); firstInput.value = val; } })();