google-translate

add a Google Translate plug-in to the page

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

Advertisement:

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Advertisement:

Autor
pansong291
Denně instalací
1
Celkem instalací
97
Hodnocení
0 0 0
Verze
0.3.2
Vytvořeno
25. 04. 2024
Aktualizováno
11. 11. 2025
velikost
5,6 KB
Licence
Apache-2.0
Spustit na
všech stránkách

注意

在网页左下角嵌入一个 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,然后刷新页面即可。