Inject Google Translate Widget

Userscript version of "Google Translate This" from https://github.com/andreicristianpetcu/google_translate_this for Tampermonkey or Violentmonkey. v0.5 2019-11-06

作者
Jefferson Scher
今日安裝
0
安裝總數
1,935
評價
7 0 0
版本
0.5
建立日期
2019-11-03
更新日期
2019-11-07
尺寸
3.2 KB
授權條款
GPL-3.0
腳本執行於
所有網站

Because extensions cannot inject remotely hosted scripts like Google's Translate widget script.

Operation

Use the Violentmonkey or Tampermonkey menu to inject the widget (screenshots below). You can inject just this time, or set the script to inject automatically on the site in the future. (If there is a way to do it in Greasemonkey, let me know.)

CSP Limitation

If you don't get the Google Translate bar, one possible reason would be Content Security Policy (CSP). This is a rule sites can set to control which script sources are allowed for a page. (For example, Github blocks the script.) The developer tools Console (F12) may report this issue when it occurs.

You use Greasemonkey?

Here is an alternative script you could try that doesn't use the "monkey menu" (I haven't tested it myself): https://gf.qytechs.cn/en/scripts/369624-google-translation-bar

Privacy

When you inject code from Google, well, it's Google. Otherwise, nothing to see here.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址