Full Reddit Comments

Refresh to dedicated comment page

  1. // ==UserScript==
  2. // @name Full Reddit Comments
  3. // @version 0.3
  4. // @description Refresh to dedicated comment page
  5. // @author Drazen Bjelovuk
  6. // @match *://www.reddit.com/*
  7. // @grant none
  8. // @run-at document-start
  9. // @namespace https://greasyfork.org/users/11679
  10. // @contributionURL https://goo.gl/dYIygm
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. document.onclick = (e) => {
  17. if (e.metaKey) return;
  18. var parent = e.target.parentElement
  19. var clickId = parent.dataset.clickId;
  20. if (clickId && clickId === 'comments') {
  21. e.preventDefault();
  22. window.location = parent.getAttribute('href');
  23. }
  24. };
  25. })();