IT blog Helper

对部分论坛网站实现 自动展开隐藏内容 / 免登陆复制 / 去除遮掩内容 Lite,持续更新中

目前为 2022-09-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name IT blog Helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 对部分论坛网站实现 自动展开隐藏内容 / 免登陆复制 / 去除遮掩内容 Lite,持续更新中
  6. // @author You
  7. // @match *.it1352.com/*
  8. // @match *.qianduanheidong.com/*
  9. // @match https://blog.csdn.net/*
  10. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  11. // @grant none
  12. // @require https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js
  13. // @license MIT
  14.  
  15. // ==/UserScript==
  16.  
  17. // console.log("===============>>>>>>>>>>自动展开隐藏内容 / 去除遮掩内容 脚本触发");
  18.  
  19. // console.log($.cookie)
  20.  
  21. var map = {}
  22. map['^https?:\/\/.*?\.it1352.com.*?'] = ()=>{
  23. var cookies = document.cookie.split('; ');
  24. //if(!cookies.some(cookie => cookie==='olduser=1')){ // compatible backup
  25. if(!cookies.includes('olduser=1')){
  26. document.cookie = 'olduser=1';
  27. window.location.reload();
  28. }
  29. }
  30. // const regx = /^https?:\/\/.*?\.qianduanheidong\.com.*?/g
  31. map['^https?:\/\/.*?\.qianduanheidong\.com.*?'] = ()=>{
  32. $("#layui-layer1").css('display','none');
  33. $("#layui-layer-shade1").css('display','none');
  34. $("body").append("<script> if(user_login) {user_login = true} else {var user_login = true;}</script>");
  35. $("html").removeAttr("style");
  36. }
  37.  
  38. // https://blog.csdn.net/chengqiuming/article/details/109958407
  39. map['^https?:\/\/blog\.csdn\.net.*?'] = ()=>{
  40.  
  41. // 免登录复制
  42. var cookies = document.cookie.split('; ');
  43. //if(!cookies.some(cookie => cookie==='olduser=1')){ // compatible backup
  44. if(!cookies.includes('hide_login=1')){
  45. document.cookie = 'hide_login=1;path=/';
  46. window.location.reload();
  47. }
  48.  
  49. $('#content_views pre').attr("style","-webkit-touch-callout: inherit; -webkit-user-select: inherit; -khtml-user-select: inherit; -moz-user-select: inherit; -ms-user-select: inherit; user-select: inherit;");
  50. $('#content_views pre code').attr("style","-webkit-touch-callout: inherit; -webkit-user-select: inherit; -khtml-user-select: inherit; -moz-user-select: inherit; -ms-user-select: inherit; user-select: inherit;");
  51.  
  52.  
  53. // 非登录展开所有内容
  54. $('#article_content').removeAttr('style')
  55. $('div.hide-article-box').attr("style","display: none;")
  56.  
  57. }
  58.  
  59.  
  60.  
  61. const url = window.location.href
  62. Object.keys(map).forEach( regxStr => {
  63.  
  64. const regx = new RegExp(regxStr);
  65. if(regx.test(url)){
  66. map[regxStr]()
  67. }
  68. });
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.