您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
按‘/’反斜杠快速定位到搜索框并全选(Press the '/' backslash to quickly navigate to the search box and select all)
// ==UserScript== // @name bing快速定位搜索框(Quick location search box) // @namespace none // @license MIT // @version 0.1 // @description 按‘/’反斜杠快速定位到搜索框并全选(Press the '/' backslash to quickly navigate to the search box and select all) // @author Alex // @match https://cn.bing.com/* // @match https://www.bing.com/* // @icon https://ts3.cn.mm.bing.net/th?id=ODLS.87518fab-8fc1-4893-a7f1-c7d88283a35a // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... var search = document.getElementById('sb_form_q'); document.addEventListener('keyup', function(e) { // console.log(e.keyCode); if (e.keyCode === 191) { if(search || "sb_form_q" == document.activeElement.id){ if("sb_form_q" != document.activeElement.id){ search.focus(); search.select(); } }else{ document.getElementById('schWrapper').click(); } } }); })();