Comment Separator Fix

Fixes new SE comment separator to fit the existing style

  1. // ==UserScript==
  2. // @name Comment Separator Fix
  3. // @author Cameron Bernhardt (AstroCB)
  4. // @version 3.1.0
  5. // @namespace https://github.com/AstroCB
  6. // @description Fixes new SE comment separator to fit the existing style
  7. // @include http://*.stackexchange.com/*
  8. // @include http://stackoverflow.com/*
  9. // @include http://meta.stackoverflow.com/*
  10. // @include http://serverfault.com/*
  11. // @include http://meta.serverfault.com/*
  12. // @include http://superuser.com/*
  13. // @include http://meta.superuser.com/*
  14. // @include http://askubuntu.com/*
  15. // @include http://meta.askubuntu.com/*
  16. // @include http://stackapps.com/*
  17. // ==/UserScript==
  18.  
  19. function fix() {
  20. var separators = document.getElementsByClassName("js-link-separator");
  21. for (var i = 0; i < separators.length; i++) {
  22. if (separators[i].className === "js-link-separator dno") {
  23. separators[i].style.visibility = "hidden";
  24. } else {
  25. separators[i].style.visiblity = "visible";
  26. }
  27. separators[i].className += "lsep ";
  28. separators[i].innerHTML = "|";
  29. }
  30. }
  31.  
  32. fix();
  33.  
  34. var observer = new MutationObserver(fix);
  35. observer.observe(document.getElementsByTagName("body")[0], {
  36. attributes: true,
  37. childList: true,
  38. characterData: true
  39. });