Greasy Fork is available in English.
google translate、mobile.ant.mobile、掘金、npmjs、bilibibli、bootstra###DN、splunk、google API 快捷搜索,更多快捷搜索
temperMonkey脚本
快捷搜索该脚本旨在使用一些常用网页时快捷定位到搜索框
windows: ctrl + g聚焦到谷歌翻译源文件textarea
mac:cmd + f
windows: ctrl + f切换谷歌翻译
windows: ctrl + g
mac:cmd + g
windows: ctrl + g
如果想要提供贡#,请依据最新的方式提供配置
/*** config是一个基础对象* key 为 要匹配的url* value 为 针对已匹配的url所触发的键盘监听事件等一系列配置* value {string | object | array[string|array|object]}* 为string时* 默认赋值给searchSelectorStr,其他options使用默认值* 例如:'www.baidu.com':'input'等同于'www.baidu.com':{searchSelectorStr:'input'}* 为object时* keyCode {number} 监听键盘的keycode* metaKey {boolean} 是否按下command或windows按键* searchSelectorStr {string|array} 搜索框的css选择器,最终选择效果由document.querySelector(searchSelectorStr)来决定* 为string时,在触发指定键盘按键事件之后自动调用该选择器所选择元素的focus事件,也就是自动聚焦* 为array时,允许设置多个选择器字符串,这些字符串之间的关系是`||`,位于数组更前方的选择器优先级更大* isESCblur {boolean} 是否在键入`ESC`按键之后取消聚焦状态* cb {function} 触发指定键盘事件之后的回调函数* escCb {function} 触发`ESC`之后的回调函数* 为array时* 允许配置多个键盘监听事件* array item为string时,参考value为string的情况* array item为array时,参考searchSelectorStr为array的情况* array item为object时,参考value为object的情况*** value的默认值为** const defaultOpts = {metaKey: true,isESCblur: true,keyCode: 71,isPreventDefault: true,searchSelectorStr: '',cb: () => { },escCb: () => { }}* 常用keyCode71 g70 f13 回车27 esc*/// 例如const config = {'csdn.net': 'input', // csdn 搜索'www.runoob.com': '#s', // 菜鸟搜索'cn.vuejs.org': '#search-query-nav', // vue官方文档 搜索'react': '#algolia-doc-search', // react 官网搜索'www.npmjs.com': {keyCode: 71,metaKey: true,searchSelectorStr: 'input[type=\'search\']',isESCblur: true,cb: () => {}}}
脚本将基于该config
生成指定监听事件