Greasy Fork is available in English.

Instagram web RTL

a script to fix rtl on web version of instagram

< Feedback on Instagram web RTL

Review: OK - script works, but has bugs

§
Posted: 04. 08. 2021

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,
});

Post reply

Sign in to post a reply.