🏠 Home 

discuz阅读模式

可自动识别DISCUZ论坛,去除多余元素,更适合上班摸鱼。


安装此脚本?
  1. // ==UserScript==
  2. // @name discuz阅读模式
  3. // @namespace discuz阅读模式
  4. // @include *
  5. // @version 1
  6. // @grant none
  7. // @description 可自动识别DISCUZ论坛,去除多余元素,更适合上班摸鱼。
  8. // ==/UserScript==
  9. function addGlobalStyle(css) {
  10. var head,
  11. style;
  12. head = document.getElementsByTagName('head')[0];
  13. if (!head) {
  14. return;
  15. }
  16. style = document.createElement('style');
  17. style.type = 'text/css';
  18. style.innerHTML = css;
  19. head.appendChild(style);
  20. }
  21. var nodes = document.querySelectorAll("meta[name='generator'][content^='Discuz! X']");
  22. if (nodes.length == 0) {
  23. return;
  24. }
  25. addGlobalStyle('html,body,div,td.pls,.scbar_icon_td,.scbar_txt_td,#scbar_txt,.scbar_type_td,.plc,#fastpostmessage,#frameoBWdsx,.pg *,#visitedforums *,#visitedforumstmp *,#forumnewshow,#forumnewshow *,.ts *,#typeid_fast_ctrl,#subject,.common,.icn,.num,.by,.common *,.icn *,.num *,.by *,.new,.new *,.lock,.lock *,.th,.th *,.pct *,#frameoBWdsx_left *,#framehg7W8p,p *,#thread_types *,.ml *,.fl_g a{background:none#f2f6fc!important;color:#606266!important}#toptb,#pgt,#hd,#ft,#newspecialtmp,#post_replytmp,.pls,.pbn,.pi{display:none}.pgb a,.pg a{color:#dcdfe6;border-color:#f2f6fc}..pgb a:hover,pg a:hover{border-color:#e4e7ed}');