搜狐瘦身

删除搜狐所有广告,重建主题内容

目前为 2019-06-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 搜狐瘦身
  3. // @author 絕版大叔丶
  4. // @namespace https://github.com/Sdator/MyCode/tree/master/Js/%E6%9A%B4%E5%8A%9B%E7%8C%B4
  5. // @icon https://avatars3.githubusercontent.com/u/17621623?s=40&v=4
  6. // @version 1.0
  7. // @match *://www.sohu.com/a/*
  8. // @description 删除搜狐所有广告,重建主题内容
  9. // @run-at document-end
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @grant GM_addStyle
  13. // ==/UserScript==
  14.  
  15. let css = `
  16. body {
  17. display: flex;
  18. background-color: bisque;
  19. justify-content: center;
  20. align-items: center;
  21. }
  22.  
  23. #diy {
  24. margin: 50px;
  25. width: 1024px;
  26. }
  27. `
  28.  
  29. //css样式
  30. GM_addStyle(css)
  31.  
  32.  
  33. $(() => {
  34. // 重建主题
  35. $('.text').appendTo($("body")).wrap($("<div id='diy'></div>"));
  36. // 删除多余标签
  37. $("body *").not('#diy').not($('#diy').find("*")).remove()
  38. })

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址