Shift Translator Hover Toggle + Selection Tooltip (Chrome Translator API)

Hover element + modifier key to toggle translation. Select text + modifier key for tooltip translation.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Autor
link knil
Dnevne instalacije
8
Ukupnih instalacija
18
Ocjene
1 0 0
Verzija
1.2.0
Stvoreno
09.05.2026.
Ažurirano
11.05.2026.
Size
24,5 KB
Licenza
MIT
Primjenjuje se
Sve stranice

Shift Translator(基于 Chrome Translator API)

一个轻量级网页翻译 Userscript。 无需第三方翻译服务,直接使用 Chrome 内置 AI Translator API 本地翻译。

目标:

  • 极简交互
  • 本地 AI 翻译
  • 类 Immersive Translate 阅读体验
  • 不污染网页结构

功能

1. Hover 段落翻译

将鼠标移动到英文段落:

  • 当前段落会自动高亮
  • 按下 Modifier Key(默认 Shift
  • 自动翻译当前段落
  • 保留原始 HTML 与样式
  • 在原文下方插入中文翻译
  • 再次触发可隐藏翻译

支持:

  • p
  • li
  • blockquote

2. 划词翻译 Tooltip

选中文字后:

  • 按下 Modifier Key
  • 自动弹出 Translation Tooltip
  • 自动智能定位(避免超出屏幕)
  • 点击空白区域自动关闭
  • 页面失焦自动关闭

适合快速阅读英文网页。


Modifier Key 设置

默认 Modifier Key:

Shift

打开设置:

Ctrl + Shift + ,

macOS:

Command + Shift + ,

支持:

shift
control
command
shift+control
shift+command
control+command
shift+control+command

配置会自动保存到:

localStorage

特点

  • 使用 Chrome 内置 Translator API
  • 本地 AI 翻译(无需云端请求)
  • 不依赖 Google Translate
  • 不修改原网页结构
  • 保留原始 HTML 样式
  • Hover 高亮提示
  • 智能 Tooltip 定位
  • 内置 Loading Spinner
  • 错误自动 Toast 提示
  • 支持 macOS Trackpad
  • 支持动态网页
  • 极简交互

使用要求

需要:

  • Chrome 138+
  • 开启 Chrome Built-in AI
  • 开启 Translator API

参考:

chrome://flags/

确保相关 AI / Translator API 已启用。


使用方法

段落翻译

鼠标移动到段落 → 按 Modifier Key

再次执行可关闭翻译。


划词翻译

选中文字 → 按 Modifier Key

即可显示翻译 Tooltip。


修改快捷键

Ctrl + Shift + ,

或 macOS:

Command + Shift + ,

注意事项

首次使用时:

  • Chrome 可能会自动下载本地翻译模型
  • 需要等待几秒钟
  • 后续会自动缓存

如果翻译失败:

  • 页面左下角会出现错误提示
  • 5 秒后自动关闭

已测试网站

  • Hacker News
  • Reddit
  • GitHub
  • Medium
  • Arxiv
  • Wikipedia

License

MIT