Greasy Fork is available in English.

Disboard Bypass Redirect

Bypasses Disboard's join button redirect, by fetching the Discord invite directly from their API. Only works on the server page, not home page.

  1. // ==UserScript==
  2. // @name Disboard Bypass Redirect
  3. // @namespace https://spin.rip/
  4. // @version 2025-03-04
  5. // @description Bypasses Disboard's join button redirect, by fetching the Discord invite directly from their API. Only works on the server page, not home page.
  6. // @author Spinfal
  7. // @match https://disboard.org/server/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=disboard.org
  9. // @grant none
  10. // @license AGPL-3.0 License
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. window.msTimeout = 0;
  17. window.onload = () => {
  18. setTimeout(() => {
  19. const csrfToken = document.querySelector('[name="csrf-token"]')?.content;
  20. const disboardServerId = location.pathname.split("/").pop();
  21.  
  22. if (!csrfToken) {
  23. window.msTimeout = 2000; // apply a timeout to ensure everything fully loads
  24. return alert("No CSRF Token was found. Try reloading the page.");
  25. } else {
  26. console.log(`CSRF Token found: ${csrfToken}`);
  27. console.log("Fetching invite now!");
  28. fetch(`https://disboard.org/site/get-invite/${disboardServerId}`, {
  29. "headers": {
  30. "accept": "*/*",
  31. "accept-language": "en-US,en;q=0.6",
  32. "priority": "u=1, i",
  33. "x-csrf-token": csrfToken
  34. },
  35. "referrer": `https://disboard.org/server/join/${disboardServerId}`,
  36. "referrerPolicy": "strict-origin-when-cross-origin",
  37. "body": null,
  38. "method": "POST",
  39. "mode": "cors",
  40. "credentials": "include"
  41. }).then(response => response.json()).then(response => {
  42. const joinBtn = document.querySelector(`[data-id="${disboardServerId}"]`);
  43. joinBtn.href = response;
  44. joinBtn.removeAttribute("onclick");
  45. joinBtn.innerText = "SKIP THE BULLSHIT";
  46. }).catch(error => new Error(error));
  47. }
  48. }, window.msTimeout);
  49. }
  50. })();