New Instance Button for Redlib

Adds a button to Redlib (previously Libreddit) instances to redirect to a new instance.

2024-04-13 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

  1. // ==UserScript==
  2. // @name New Instance Button for Redlib
  3. // @namespace happyviking
  4. // @version 1.47.0
  5. // @grant none
  6. // @run-at document-end
  7. // @license MIT
  8. // @description Adds a button to Redlib (previously Libreddit) instances to redirect to a new instance.
  9. // @icon https://gitlab.com/uploads/-/system/project/avatar/32545239/libreddit.png
  10. // @author HappyViking
  11.  
  12. // <<INSTANCES START HERE>>
  13. // @match https://l.opnxng.com/*
  14. // @match https://libreddit.bus-hit.me/*
  15. // @match https://libreddit.eu.org/*
  16. // @match https://libreddit.privacydev.net/*
  17. // @match https://libreddit.projectsegfau.lt/*
  18. // @match https://lr.n8pjl.ca/*
  19. // @match https://r.darrennathanael.com/*
  20. // @match https://red.artemislena.eu/*
  21. // @match https://red.ngn.tf/*
  22. // @match https://reddit.idevicehacked.com/*
  23. // @match https://reddit.invak.id/*
  24. // @match https://reddit.owo.si/*
  25. // @match https://redlib.catsarch.com/*
  26. // @match https://redlib.cow.rip/*
  27. // @match https://redlib.dnfetheus.xyz/*
  28. // @match https://redlib.ducks.party/*
  29. // @match https://redlib.freedit.eu/*
  30. // @match https://redlib.kittywi.re/*
  31. // @match https://redlib.nohost.network/*
  32. // @match https://redlib.perennialte.ch/*
  33. // @match https://redlib.privacyredirect.com/*
  34. // @match https://redlib.seasi.dev/*
  35. // @match https://redlib.tux.pizza/*
  36. // @match https://redlib.vimmer.dev/*
  37. // @match https://rl.bloat.cat/*
  38. // @match https://safereddit.com/*
  39. // @match https://redlib.r4fo.com/*
  40. // @match https://redlib.xn--hackerhhle-kcb.org/*
  41. // @match https://eu.safereddit.com/*
  42. // @match https://redlib.matthew.science/*
  43. // @match https://libreddit.freedit.eu/*
  44. // @match https://libreddit.hu/*
  45. // @match https://libreddit.kylrth.com/*
  46. // @match https://libreddit.lunar.icu/*
  47. // @match https://libreddit.mha.fi/*
  48. // @match https://libreddit.northboot.xyz/*
  49. // @match https://libreddit.oxymagnesium.com/*
  50. // @match https://libreddit.pussthecat.org/*
  51. // @match https://libreddit.spike.codes/*
  52. // @match https://libreddit.strongthany.cc/*
  53. // @match https://libreddit.tiekoetter.com/*
  54. // @match https://lr.4201337.xyz/*
  55. // @match https://lr.aeong.one/*
  56. // @match https://lr.artemislena.eu/*
  57. // @match https://lr.slipfox.xyz/*
  58. // @match https://r.walkx.fyi/*
  59. // @match https://reddit.rtrace.io/*
  60. // @match https://reddit.simo.sh/*
  61. // @match https://reddit.smnz.de/*
  62. // @match https://reddit.utsav2.dev/*
  63. // @match https://snoo.habedieeh.re/*
  64. // @match https://libreddit.kutay.dev/*
  65. // @match https://libreddit.tux.pizza/*
  66. // @match https://lr.vern.cc/*
  67. // @match https://r.darklab.sh/*
  68. // @match https://reddit.leptons.xyz/*
  69. // @match https://discuss.whatever.social/*
  70. // @match https://libreddit.kavin.rocks/*
  71. // @match https://libreddit.cachyos.org/*
  72. // @match https://libreddit.domain.glass/*
  73. // @match https://libreddit.privacy.com.de/*
  74. // @match https://reddit.baby/*
  75. // <<INSTANCES END HERE>>
  76.  
  77.  
  78. // ==/UserScript==
  79.  
  80. function main() {
  81. const navBar = document.querySelector('nav');
  82. if (!navBar) return
  83. const firstDivInNavBar = navBar.querySelector("div")
  84. const newButton = document.createElement("button")
  85. firstDivInNavBar.prepend(newButton)
  86. newButton.appendChild(document.createTextNode("New Instance"))
  87. newButton.onclick = () => {
  88. location.replace('https://farside.link/redlib/' + window.location.pathname + window.location.search);
  89. }
  90. }
  91.  
  92. main()