🏠 返回首頁 

Greasy Fork is available in English.

Reddit - Add reveddit links

Adds a reveddit.com link to every comment and post on old Reddit, the site displays removed and deleted comments/posts.

  1. // ==UserScript==
  2. // @name Reddit - Add reveddit links
  3. // @icon https://www.google.com/s2/favicons?domain=www.reddit.com
  4. // @description Adds a reveddit.com link to every comment and post on old Reddit, the site displays removed and deleted comments/posts.
  5. // @author Arudarin
  6. // @version 1.0.2
  7. // @namespace Violentmonkey Scripts
  8. // @match *://*.reddit.com/r/*/comments/*
  9. // @grant GM_addStyle
  10. // @run-at document-start
  11. // @require https://unpkg.com/jquery@3/dist/jquery.min.js
  12. // @require https://greasyfork.org/scripts/7602-mutation-observer/code/mutation-observer.js
  13. // ==/UserScript==
  14. ; ($ => {
  15. 'use strict'
  16. // --------------------------------------------------------------------------
  17. const url = new URL(location.href)
  18. url.host = 'www.reveddit.com'
  19. const observer = new MutationSummary({
  20. callback(summaries) {
  21. $(summaries[0].added)
  22. .append(`
  23. <li>
  24. <a class="reveddit" href="${url}">
  25. reveddit
  26. </a>
  27. </li>
  28. `)
  29. },
  30. rootNode: document.body,
  31. queries: [
  32. { element: '.flat-list' }
  33. ]
  34. })
  35. })(jQuery);
  36. jQuery.noConflict(true);
  37. /* The old script, for future use
  38. (function() {
  39. 'use strict';
  40. url = new URL(location.href);
  41. url.host = 'www.reveddit.com';
  42. $("ul.flat-list.buttons").append(`
  43. <li>
  44. <a class="reveddit" href="${url}">
  45. reveddit
  46. </a>
  47. </li>
  48. `);
  49. }());
  50. */