CSDNclear

去广告,居中

目前为 2019-01-10 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name CSDNclear
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description 去广告,居中
  6. // @author gorgias
  7. // @match *://blog.csdn.net/*/article/details/*
  8. // @match *://bbs.csdn.net/topics/*
  9. // @match *://*.iteye.com/blog/*
  10. // @grant none
  11. // @icon https://csdnimg.cn/public/favicon.ico
  12. // @run-at document-end
  13. // ==/UserScript==
  14. (function() {
  15. 'use strict';
  16. //展开全文
  17. document.getElementById("btn-readmore").click();
  18. //去侧边栏 居中
  19. function addGlobalStyle(css) {
  20. var head, style;
  21. head = document.getElementsByTagName('head')[0];
  22. if (!head) { return; }
  23. style = document.createElement('style');
  24. style.type = 'text/css';
  25. style.innerHTML = css;
  26. head.appendChild(style);
  27. }
  28. addGlobalStyle(`
  29. #mainBox > aside:nth-child(3){
  30. display:none;
  31. visibility: hidden;
  32. }
  33. #mainBox{
  34. position:relative;
  35. right:130px;
  36. }
  37. `);
  38. // Your code here...
  39. })();