Arxiv no math translate

Mark math formula to no translate

当前为 2023-12-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Arxiv no math translate
  3. // @namespace http://tampermonkey.net/
  4. // @version 2023-12-23
  5. // @description Mark math formula to no translate
  6. // @author Guorui Quan
  7. // @match https://browse.arxiv.org/html/*
  8. // @match https://ar5iv.labs.arxiv.org/html/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=arxiv.org
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Function to wrap content inside <math> tags with <div class="notranslate">
  18. function modifyMathElements() {
  19. var mathElements = document.querySelectorAll('math');
  20.  
  21. mathElements.forEach(function(mathElement) {
  22. mathElement.setAttribute('translate', 'no');
  23. });
  24. }
  25.  
  26. // Call the wrapMathContent function
  27. modifyMathElements();
  28.  
  29. })();