Tabun Self Color Comments

Подкрашивание комментов

目前为 2020-04-28 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Tabun Self Color Comments
  3. // @version 2020.04.28
  4. // @description Подкрашивание комментов
  5. // @include http*://tabun.everypony.ru/*
  6. // @author Rainbow-Spike
  7. // @namespace https://greasyfork.org/users/7568
  8. // @homepage https://greasyfork.org/ru/users/7568-dr-yukon
  9. // @icon https://www.google.com/s2/favicons?domain=tabun.everypony.ru
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. function gap ( ) {
  14. var auth = document.querySelectorAll ( '.comment-wrapper' ), // комменты
  15. name = document.querySelector ( '#dropdown-user .username:last-of-type' ).innerHTML, // своё имя
  16. name2,
  17. color = "background-color: #FFFFEE;";
  18.  
  19. for ( var i in auth ) {
  20. name2 = auth [ i ].querySelector ( '.comment-author a:nth-of-type(2)' ).innerHTML; // имя комментатора
  21. if ( name == name2 ) {
  22. auth [ i ].querySelector ( '.comment-content' ).style = auth [ i ].querySelector ( '.comment-info' ).style = color;
  23. }
  24. }
  25. }
  26.  
  27. setTimeout ( gap, 0 );