V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Get Google Chrome
Vimium · 在 Chrome 里使用 vim 快捷键
rock_cloud
V2EX  ›  Chrome

写了两个 Tampermonkey 的脚本,定位网页上输入框和 Google Translate 快捷键

  •  
  •   rock_cloud · 2014-08-05 14:58:54 +08:00 · 5421 次点击
    这是一个创建于 3553 天前的主题,其中的信息可能已经有所发展或是发生改变。
    很简单的一个脚本,按Ctrl+a自动将光标定位于网页上面积最大的 input[type='text'] ,方便使用 Google 和其他一些需要搜索的网站的使用。
    不过貌似在京东和淘宝上会出一些问题。
    脚本地址
    https://github.com/richard-liang/TampermonkeyCode/blob/master/InputFocusor.js

    另外还有一个 Google Translate 的快捷键脚本
    https://github.com/richard-liang/TampermonkeyCode/blob/master/Translate%20Hotkey.tamper.js
    这个功能稍微复杂些:
    Ctrl+a 选择输入框所有内容
    Ctrl+e 交换翻译语言
    Ctrl+r 应用 Google 提供的纠错内容
    Ctrl+s 加星
    Ctrl+f 将光标至于翻译结果上,可修改翻译结果
    Ctrl+j/k 左右移动输入框中的光标
    Enter 读出原文内容
    Shift+Enter 读出翻译内容

    js学的不好,大家多提提意见
    2 条回复    2014-08-22 20:08:33 +08:00
    KillAd
        1
    KillAd  
       2014-08-22 17:14:53 +08:00
    rock_cloud
        2
    rock_cloud  
    OP
       2014-08-22 20:08:33 +08:00
    @KillAd 这个链接咋是404呢?应该是啥?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1421 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:19 · PVG 01:19 · LAX 10:19 · JFK 13:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.