Reddit r/all Button

Adds a button to go to r/all

  1. // ==UserScript==
  2. // @license MIT
  3. // @name Reddit r/all Button
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.1.6-Beta
  6. // @description Adds a button to go to r/all
  7. // @author Daniel Vasquez
  8. // @match https://*.reddit.com/*
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13.  
  14. // Create a new button
  15. let button = document.createElement("button");
  16. button.textContent = "Go to r/all";
  17. button.style.position = "fixed";
  18. button.style.top = "6px";
  19. button.style.right = "10px";
  20. button.style.zIndex = "999";
  21. button.style.padding = "10px";
  22. button.style.backgroundColor = "#FF4500";
  23. button.style.border = "none";
  24. button.style.color = "white";
  25. button.style.borderRadius = "5px";
  26. button.style.cursor = "pointer";
  27. button.onclick = function() {
  28. window.location.href = 'https://www.reddit.com/r/all/';
  29. };
  30.  
  31. // Append button to the body
  32. document.body.appendChild(button);
  33. })();