Greasy Fork is available in English.

Instagram web RTL

a script to fix rtl on web version of instagram

< 脚本Instagram web RTL的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发表于:2021-08-04

Cleaned up the code

"use strict";
const observer = new MutationObserver(function (mutations) {
    mutations.forEach(function (mutation) {
        mutation.addedNodes.forEach(function (node) {
            const textElm = node.querySelector("div.C4VMK > span");
            if (textElm !== null) {
                textElm.setAttribute("dir", "auto");
                textElm.setAttribute("style", "display: inline-block; text-align: start;");
            }
        });
    });
});
observer.observe(document, {
    childList: true,
    subtree: true,
    attributes: true,
    characterData: false,
});

发表回复

登录以发表回复。