Greasy Fork 还支持 简体中文。

google-translate

add a Google Translate plug-in to the page

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!)

Penulis
pansong291
Pemasangan harian
0
Total pemasangan
96
Nilai
0 0 0
Versi
0.3.2
Dibuat
25 April 2024
Diperbarui
11 November 2025
ukuran
5,56 KB
Lisensi
Apache-2.0
Berlaku untuk
Semua situs

注意

在网页左下角嵌入一个 Google 翻译小部件。

默认情况需要在鼠标右键菜单中执行此脚本。

部分网页由于 CSP 限制无法正常加载翻译部件

一些网站会设置 CSP 限制,导致不能在页面上加载其他来源的 script 脚本,比如 Github

这时网页左下角会有加载失败提示,同时控制台会出现如下的报错:Refused to load the script 'https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit' because it violates the following Content Security Policy directive: ...

解决办法

  1. 安装 Header Editor 这个浏览器插件,根据你使用的浏览器选择不同的版本:
  2. 在 Header Editor 插件中新增一条规则。名称移除 CSP 响应头规则类型修改响应头匹配类型全部执行类型常规头名称content-security-policy头内容_header_editor_remove_,最后点击 保存
  3. 最后记得启用 Header Editor,然后刷新页面即可。