NoTranslate auto enable

Remove the "notranslate" class from all elements and add "notranslate" to elements with class containing "code"

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
LorisYounger
今日安裝
0
安裝總數
19
評價
0 0 0
版本
1.0
建立日期
2024-05-04
更新日期
2024-05-04
尺寸
2.7 KB
授權條款
Apache-2.0 license
腳本執行於
所有網站

https://github.com/LorisYounger/auto-notranslate

Auto-notranslate

Auto disable or enable notranslate class to allow Translator such as GoogleTranslator to allow webpage translation

Logic

Remove all notranslate classes Add notranslate for the class containing 'code'

  • For example: amber-display-codeblock amber-code

Advantages

  • Support dynamic loading, and new content will also be judged
  • Loading only processes elements whose class names have actually changed, avoiding performance waste

自动化允许翻译

自动禁用或启用 notranslate 类以允许网页翻译器(如谷歌翻译)允许网页翻译

逻辑

去除所有 notranslate 类 为包含 'code' 类 添加 notranslate

  • 例如: amber-display-codeblock amber-code

优点

  • 支持动态加载, 新增内容也会进行判断
  • 加载只处理那些类名实际发生变化的元素, 避免性能浪费