CSDN Reformater

remove everything except author information and main content.

当前为 2018-07-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CSDN Reformater
  3. // @namespace http://www.csdn.net/
  4. // @version 0.1.1
  5. // @description remove everything except author information and main content.
  6. // @author Mianjune Hong
  7. // @license GPL version 3
  8. // @match *://blog.csdn.net/*/article/details/*
  9. // @grant none
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13.  
  14. (function () {
  15. 'use strict';
  16.  
  17. $('#btn-readmore').click();
  18. var content = $('div.blog-content-box');
  19.  
  20. var info = $('<aside style="z-index: 9999;float: right;"><div class="aside-box"><h3 class="aside-title">个人资料</h3></div></aside>');
  21. $('#asideProfile > .aside-title').remove();
  22. info.append($('#asideProfile'));
  23. info.mouseenter(function(){$('#asideProfile').css('display','');}).mouseleave(function(){$('#asideProfile').css('display','none');});
  24.  
  25. $('body').remove();
  26. $('html').append($('<body></body>').append($('<div style="margin: 2em auto;max-width: 66em;"></div>').append(info).append($('<main style="float:none;"></main>').append(content))).append('<style type="text/css">body iframe{display:none;}</style>'));
  27.  
  28. info.mouseleave();
  29. })();