Hide Reddit Promos (Redesign)

Hide promo links from the Reddit redesign.

  1. /**
  2. The MIT License (MIT)
  3.  
  4. Copyright (c) 2018 Michael Charles Aubrey
  5. Permission is hereby granted, free of charge, to any person obtaining a copy of
  6. this software and associated documentation files (the "Software"), to deal in
  7. the Software without restriction, including without limitation the rights to
  8. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  9. the Software, and to permit persons to whom the Software is furnished to do so,
  10. subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in all
  13. copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  17. FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  18. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  19. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. **/
  22. // ==UserScript==
  23. // @id HRP
  24. // @name Hide Reddit Promos (Redesign)
  25. // @version 0.4.4
  26. // @description Hide promo links from the Reddit redesign.
  27. // @author Michael Aubrey
  28. // @domain reddit.com
  29. // @domain www.reddit.com
  30. // @match https://www.reddit.com/*
  31. // @match https://reddit.com/*
  32. // @match http://www.reddit.com/*
  33. // @match http://reddit.com/*
  34. // @grant none
  35. // @license MIT
  36.  
  37. // @namespace https://greasyfork.org/users/43445
  38. // ==/UserScript==
  39. /* global $ */
  40.  
  41. (function() {
  42. 'use strict';
  43. var css = '.promotedlink {display:none;}';
  44. var head = document.getElementsByTagName('head')[0];
  45. var s = document.createElement('style');
  46. s.setAttribute('type', 'text/css');
  47. if (s.styleSheet) { // IE
  48. s.styleSheet.cssText = css;
  49. } else { // the world
  50. s.appendChild(document.createTextNode(css));
  51. }
  52. head.appendChild(s);
  53. })();