Improve Chinese text on Firefox

Change lang="zh" attribute to lang="zh-cn" so Firefox can style it correctly

目前為 2024-10-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Improve Chinese text on Firefox
// @namespace    http://tampermonkey.net/
// @version      2024-10-26
// @description  Change lang="zh" attribute to lang="zh-cn" so Firefox can style it correctly
// @author       bellisk
// @match        http://*/*
// @match        https://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @require      https://cdn.jsdelivr.net/gh/CoeJoder/[email protected]/waitForKeyElements.js#sha256=2e9380e2b626d13e144e72cfca41bd204c16f24ac6f10132d487ca27068bb27b
// @license      MIT
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';

    waitForKeyElements("*:lang(zh)", (element) => {
        console.log(element);
        element.lang = "zh-cn";
    })
})();