Switch Page Direction

Switch Page Direction from LTR to RTL and vice versa, using the Greasemonkey menu.

  1. // ==UserScript==
  2. // @name Switch Page Direction
  3. // @description Switch Page Direction from LTR to RTL and vice versa, using the Greasemonkey menu.
  4. // @author Schimon Jehudah, Adv.
  5. // @namespace i2p.schimon.direction-command
  6. // @homepageURL https://gf.qytechs.cn/en/scripts/490275-switch-page-direction-command
  7. // @supportURL https://gf.qytechs.cn/en/scripts/490275-switch-page-direction-command/feedback
  8. // @copyright 2024, Schimon Jehudah (http://schimon.i2p)
  9. // @license Public Domain
  10. // @grant GM.registerMenuCommand
  11. // @exclude devtools://*
  12. // @match file:///*
  13. // @match *://*/*
  14. // @version 24.03
  15. // @run-at document-end
  16. // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7ihpTvuI88L3RleHQ+PC9zdmc+Cg==
  17. // ==/UserScript==
  18.  
  19. function switchPageDirection() {
  20. if (document.dir == 'ltr' || !document.dir) {
  21. document.dir = 'rtl';
  22. } else {
  23. document.dir = 'ltr';
  24. }
  25. }
  26.  
  27. (async function registerMenuCommand(){
  28. await GM.registerMenuCommand(`Switch Page Direction`, () => switchPageDirection());
  29. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址