twitcasting_collapse_comment

ツイキャスのコメント欄を非表示にする。

当前为 2018-01-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name twitcasting_collapse_comment
  3. // @namespace http://catherine.v0cyc1pp.com/twitcasting_collapse_comment.user.js
  4. // @include http://twitcasting.tv/*
  5. // @include https://twitcasting.tv/*
  6. // @exclude https://twitcasting.tv/
  7. // @exclude https://twitcasting.tv/?*
  8. // @version 1.3
  9. // @require http://code.jquery.com/jquery-2.1.4.min.js
  10. // @grant none
  11. // @run-at document-end
  12. // @description ツイキャスのコメント欄を非表示にする。
  13. // ==/UserScript==
  14.  
  15. this.$ = this.jQuery = jQuery.noConflict(true);
  16.  
  17.  
  18. //console.log("twitcasting_collapse_comment start");
  19.  
  20. this.$ = this.jQuery = jQuery.noConflict(true);
  21.  
  22.  
  23. function main() {
  24. var attr = $("div#navibox").attr("abcde");
  25. if( typeof attr !== 'undefined' && attr !== false ){
  26. } else {
  27. $("div#navibox").attr("abcde","twitcasting_collapse_comment");
  28. $("div#navibox").before('<div margin-top: 0px; margin-bottom: 0px;" width="320" frameborder="0" height="420" onclick="obj=document.getElementById(\'navibox\').style; obj.display=(obj.display==\'none\')?\'block\':\'none\';"><center><a style="cursor:pointer;">コメントエリア (クリックで展開)</a></center></div>');
  29. $("div#navibox").attr("style","display:none;clear:both;");
  30. }
  31. }
  32.  
  33.  
  34. var observer = new MutationObserver(function(mutations) {
  35. observer.disconnect();
  36. main();
  37. observer.observe( document, config);
  38. });
  39. var config = { attributes: false, childList: true, characterData: false, subtree:true };
  40. observer.observe( document, config);