Remove Translate Attribute For Temu

Remove translate attribute from HTML tag

目前為 2024-04-07 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name                Remove Translate Attribute For Temu
// @name:zh-CN          Temu去除翻译限制
// @namespace           https://github.com/KPI0/tampermonkey
// @version             0.4
// @description         Remove translate attribute from HTML tag
// @description:zh-cn   Temu购物平台限制了网页翻译,通过此脚本可去除限制
// @author              KPI0
// @match               https://www.temu.com/*
// @icon                https://www.temu.com/favicon.ico
// @grant               none
// @license             MIT
// ==/UserScript==

(function() {
    'use strict';

    // 获取 HTML 标签
    var htmlTag = document.querySelector('html');

    // 检查是否存在 translate 属性并且值为 "no"
    if (htmlTag && htmlTag.hasAttribute('translate') && htmlTag.getAttribute('translate') === 'no') {
        // 移除 translate 属性
        htmlTag.removeAttribute('translate');
    }
})();