Temu去除翻译限制

Temu购物平台限制了网页翻译,通过此脚本可去除限制

  1. // ==UserScript==
  2. // @name Remove Translate Attribute For Temu
  3. // @name:zh-CN Temu去除翻译限制
  4. // @namespace https://github.com/KPI0/tampermonkey
  5. // @version 0.4
  6. // @description Remove translate attribute from HTML tag
  7. // @description:zh-cn Temu购物平台限制了网页翻译,通过此脚本可去除限制
  8. // @author KPI0
  9. // @match https://www.temu.com/*
  10. // @icon https://www.temu.com/favicon.ico
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. // 获取 HTML 标签
  19. var htmlTag = document.querySelector('html');
  20.  
  21. // 检查是否存在 translate 属性并且值为 "no"
  22. if (htmlTag && htmlTag.hasAttribute('translate') && htmlTag.getAttribute('translate') === 'no') {
  23. // 移除 translate 属性
  24. htmlTag.removeAttribute('translate');
  25. }
  26. })();