Make Chrome not Translate Code

For Google Translate, you can customize and specify tags and keywords without translating

目前為 2025-01-25 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Make Chrome not Translate Code
  3. // @name:zh-CN 让谷歌浏览器不翻译代码和公式
  4. // @name:en Make Chrome not Translate Code
  5. // @description For Google Translate, you can customize and specify tags and keywords without translating
  6. // @author @amormaid
  7. // @run-at document-end
  8. // @namespace http://tampermonkey.net/
  9. // @version 1.3
  10. // @description:zh-cn 针对谷歌翻译,可以自定义指定标签、关键词不翻译
  11. // @description:en For Google Translate, you can customize and specify tags and keywords without translating
  12. // @match *://*/*
  13. // @license GPL
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17.  
  18.  
  19.  
  20. (function () {
  21. 'use strict'
  22.  
  23. console.log('not translate ready!');
  24. (() => {
  25. const list = document.getElementsByTagName("math")
  26. list && list.length && Array.from(list).forEach(e => e.classList.add('notranslate'));
  27. list && list.length && Array.from(list).forEach(e => e.setAttribute('translate', 'no'));
  28. })();
  29. (() => {
  30. const list = document.getElementsByTagName("svg")
  31. list && list.length && Array.from(list).forEach(e => e.classList.add('notranslate'));
  32. list && list.length && Array.from(list).forEach(e => e.setAttribute('translate', 'no'));
  33. })();
  34. })();