Block sites

Block sites (such as Baidu, etc.) You can edit the block list in the script.

当前为 2016-12-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Block sites
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Block sites (such as Baidu, etc.) You can edit the block list in the script.
  6. // @author Laphy
  7. // @match http*://www.baidu.com/
  8. // @match http*://weibo.com/*
  9. // @match http*://feedly.com/*
  10. // @match http*://feedly.com/*
  11. // @match http://www.newsmth.net/*
  12. // @grant GM_addStyle
  13. // @run-at document-body
  14. // @require http://code.jquery.com/jquery-2.2.4.js
  15. // ==/UserScript==
  16.  
  17. (function() {
  18.  
  19. $("body").css("visibility","hidden");
  20. $(document).ready(function() {
  21. var oldBody = $('body').html();
  22. $('body').html('<div id="NewContent">Connected. <a href="javascript:void(0)">Restore</a></div>');
  23. $("body").css("visibility","visible");
  24. GM_addStyle(`#NewContent {
  25. height: 300px;
  26. margin: 50px;
  27. padding: 50px;
  28. font-size:20pt;
  29. text-align:center;
  30. }`);
  31.  
  32. $("body a").click(function() {
  33. $('body').html(oldBody);
  34. });
  35. });
  36.  
  37. })();