Instagram web RTL

a script to fix rtl on web version of instagram

  1. // ==UserScript==
  2. // @name Instagram web RTL
  3. // @namespace http://tampermonkey.net/
  4. // @description a script to fix rtl on web version of instagram
  5. // @version 0.1
  6. // @author techtube
  7. // @match https://www.instagram.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=instagram.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. var observer = new MutationObserver(function (mutations) {
  15. mutations.forEach(function (mutation) {
  16. mutation.addedNodes.forEach(function (node) {
  17. var text = document.querySelector("div.C4VMK > span");
  18. if (text !== null) {
  19. console.log('found');
  20. text.setAttribute("dir", "auto");
  21. text.setAttribute("style", "display: inline-block; text-align: start;");
  22. } else {
  23. console.log('not found');
  24. };
  25.  
  26. });
  27. });
  28. });
  29. observer.observe(document, {
  30. childList : true,
  31. subtree : true,
  32. attributes : true,
  33. characterData : false,
  34. });
  35. })();