精简常见文章网站|CSDN|简书|掘金|知乎|百家号|搜狐|腾讯新闻|微信公众号|网易|更多...| 方便您的阅读📖 持续更新

优化阅读体验【文章宽度一致】【统一标题】【使用阴影】【适配半屏窗口】【无感知加载】【可选 去除顶栏】|CSDN、简书、掘金、知乎专栏、阿里云、腾讯云、华为云开发者联盟、蒲公英、百家号、脚本之家、51cto博客、爱码网、ITEYE、bbsmax论坛、第一PHP社区、代码先锋网、码农教程、术之多、搜狐、腾讯新闻、微信公众号、网易、灰信网、B站文、百度知道、百度经验、爱问知识人、CSDN问题 文章页面

  1. // ==UserScript==
  2. // @name 精简常见文章网站|CSDN|简书|掘金|知乎|百家号|搜狐|腾讯新闻|微信公众号|网易|更多...| 方便您的阅读📖 持续更新
  3. // @namespace https://github.com/CandyTek/
  4. // @license GPL-3.0
  5. // @version 1.11
  6. // @description 优化阅读体验【文章宽度一致】【统一标题】【使用阴影】【适配半屏窗口】【无感知加载】【可选 去除顶栏】|CSDN、简书、掘金、知乎专栏、阿里云、腾讯云、华为云开发者联盟、蒲公英、百家号、脚本之家、51cto博客、爱码网、ITEYE、bbsmax论坛、第一PHP社区、代码先锋网、码农教程、术之多、搜狐、腾讯新闻、微信公众号、网易、灰信网、B站文、百度知道、百度经验、爱问知识人、CSDN问题 文章页面
  7. // @author CandyTek
  8. // @homepageURL https://greasyfork.org/zh-CN/scripts/459519
  9. // @supportURL https://greasyfork.org/zh-CN/scripts/459519/feedback
  10. // @match *://*.blog.csdn.net/*
  11. // @match *://blog.csdn.net/*
  12. // @match *://huaweicloud.csdn.net/*
  13. // @match *://www.jianshu.com/p/*
  14. // @match *://events.jianshu.io/p/*
  15. // @match *://www.jb51.net/article/*
  16. // @match *://www.jb51.net/softjc/*
  17. // @match *://www.jb51.net/news/*
  18. // @match *://www.jb51.net/shouji/*
  19. // @match *://www.jb51.net/program/*
  20. // @match *://www.jb51.net/css/*
  21. // @match *://www.jb51.net/os/*
  22. // @match *://www.jb51.net/jiaoben/*
  23. // @match *://www.jb51.net/hardware/*
  24. // @match *://www.jb51.net/network/*
  25. // @match *://www.jb51.net/javascript/*
  26. // @match *://www.jb51.net/aspnet/*
  27. // @match *://www.jb51.net/database/*
  28. // @match *://www.jb51.net/server/*
  29. // @match *://www.jb51.net/web/*
  30. // @match *://www.jb51.net/html5/*
  31. // @match *://www.jb51.net/Dreamweaver/*
  32. // @match *://www.jb51.net/python/*
  33. // @match *://jingyan.baidu.com/article/*
  34. // @match *://www.jb51.net/frontpage/*
  35. // @match *://www.jb51.net/xml/*
  36. // @match *://www.jb51.net/LINUXjishu/*
  37. // @match *://www.jb51.net/diannaojichu/*
  38. // @match *://www.jb51.net/flash/*
  39. // @match *://*.dandelioncloud.cn/article/*
  40. // @match *://wenku.csdn.net/answer/*
  41. // @match *://www.bilibili.com/read/*
  42. // @match *://zhuanlan.zhihu.com/p/*
  43. // @match *://baijiahao.baidu.com/s*
  44. // @match *://iask.sina.com.cn/b/*
  45. // @match *://mbd.baidu.com/newspage/data/landingsuper*
  46. // @match *://mbd.baidu.com/newspage/data/dtlandingsuper*
  47. // @match *://www.likecs.com/*
  48. // @match *://www.iteye.com/blog/*
  49. // @match *://new.qq.com/rain/*
  50. // @match *://www.bbsmax.com/*
  51. // @match *://mp.weixin.qq.com/*
  52. // @match *://zhidao.baidu.com/*
  53. // @match *://www.360doc.com/*
  54. // @match *://sohu.com/a/*
  55. // @match *://*.sohu.com/a/*
  56. // @match *://*.sohu.com/na/*
  57. // @match *://www.shuzhiduo.com/A/*
  58. // @match *://developer.aliyun.com/article/*
  59. // @match *://cloud.tencent.cn/developer/article/*
  60. // @match *://cloud.tencent.cn/developer/information/*
  61. // @match *://cloud.tencent.cn/developer/news/*
  62. // @match *://cloud.tencent.cn/developer/ask/*
  63. // @match *://cloud.tencent.com/developer/article/*
  64. // @match *://cloud.tencent.com/developer/information/*
  65. // @match *://cloud.tencent.com/developer/news/*
  66. // @match *://cloud.tencent.com/developer/ask/*
  67. // @match *://cloud.tencent.com.cn/developer/article/*
  68. // @match *://cloud.tencent.com.cn/developer/information/*
  69. // @match *://cloud.tencent.com.cn/developer/news/*
  70. // @match *://cloud.tencent.com.cn/developer/ask/*
  71. // @match *://blog.51cto.com/*
  72. // @match *://www.163.com/*/article/*
  73. // @match *://juejin.cn/post/*
  74. // @match *://juejin.cn/s/*
  75. // @match *://article.juejin.cn/post/*
  76. // @match *://www.freesion.com/article/*
  77. // @match *://www.php1.cn/detail/*
  78. // @match *://codeleading.com/article/*
  79. // @match *://*.codeleading.com/article/*
  80. // @match *://wuyaogexing.com/*
  81. // @match *://www.manongjc.com/detail/*
  82. // @match *://www.zhihu.com/question/*
  83. // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxwYXRoIGZpbGw9IiMyYzJjMmMiIGQ9Ik02NDAgMTI4YTQzIDQzIDAgMCAxIDQzIDQzaDE3MGE4NSA4NSAwIDAgMSA4NiA4NXY1MTJhODUgODUgMCAwIDEtODYgODVIMTcxYTg1IDg1IDAgMCAxLTg2LTg1VjI1NmE4NSA4NSAwIDAgMSA4Ni04NWgxNzBhNDMgNDMgMCAwIDEgNDMtNDNoMjU2ek0yOTkgNDI3SDE3MXYzNDFoNjgyVjQyN0g3MjV2NDJINTU1di00MmgtODZ2NDJIMjk5di00MnptNTU0LTE3MUgxNzF2ODVoNjgydi04NXoiLz48L3N2Zz4=
  84. // @grant GM_addStyle
  85. // @grant GM_registerMenuCommand
  86. // @grant GM_getValue
  87. // @grant GM_setValue
  88. // @run-at document-start
  89. // ==/UserScript==
  90. // ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-start 以获得无感知脚本加载体验
  91. // ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-start 以获得无感知脚本加载体验
  92.  
  93. /** 设置工具类 */
  94. class CandyTekPreferenceUtil {
  95. /** 是否已向网页添加过设置面板了 */
  96. isAlreadyAddSettingPanel = false;
  97. /** 设置面板根元素 */
  98. rootShadow = null;
  99. /** 存放设置值的地方。获取 prefValues[key] */
  100. prefValues;
  101. /** 源 pref 配置数组 */
  102. preferenceList;
  103.  
  104. constructor(preferenceList) {
  105. this.preferenceList = preferenceList;
  106. this.refreshPrefValues();
  107. }
  108.  
  109. /** 刷新设置值 */
  110. refreshPrefValues() {
  111. this.prefValues = this.preferenceList.reduce((list, curr) => {
  112. list[curr.preference] = GM_getValue(curr.preference, curr.defaultValue);
  113. return list;
  114. }, {});
  115. }
  116.  
  117. /** 获取设置值 */
  118. get(key) {
  119. return this.prefValues.hasOwnProperty(key) ? this.prefValues[key] : GM_getValue(key, "");
  120. }
  121.  
  122. /** 写入设置值,未适配 boolean */
  123. set(key, value) {
  124. GM_setValue(key, value);
  125. this.prefValues[key] = value;
  126. }
  127.  
  128. /** 显示设置面板在网页右上角 */
  129. show() {
  130. if (this.isAlreadyAddSettingPanel) {
  131. this.rootShadow.querySelector(".setting_panel").style.display = "block";
  132. return;
  133. }
  134.  
  135. if (!document.body.createShadowRoot) {
  136. console.warn("可能不能创建 ShadowRoot");
  137. //return;
  138. }
  139. // 创建设置面板
  140. const host = document.createElement('div');
  141. host.id = "simplify_article_settings_panel";
  142. document.body.appendChild(host);
  143.  
  144. const root = host.attachShadow({ mode: 'open' });
  145. this.rootShadow = root;
  146. this.isAlreadyAddSettingPanel = true;
  147. root.innerHTML = `
  148. <style>
  149. .preference_title {
  150. width: fit-content;
  151. height: 40px;
  152. font-size: 20px;
  153. margin: 0px;
  154. line-height: 40px;
  155. padding-left: 16px;
  156. font-weight: bold;
  157. }
  158.  
  159. .preference_item {
  160. display: flex;
  161. padding: 12px 8px;
  162. }
  163.  
  164. .preference_item_title {
  165. padding: 0px 0px 0px 10px;
  166. margin: 0px;
  167. font-size: 15px;
  168. line-height: 40px;
  169. letter-spacing: 2px;
  170. height: 40px;
  171. width: fit-content;
  172. }
  173.  
  174. .preference_item_edittext {
  175. font-size: 14px;
  176. margin-left: auto;
  177. line-height: 36px;
  178. height: 36px;
  179. padding: 0px;
  180. border: 2px solid #c4c7ce;
  181. border-radius: 6px;
  182. text-align: center;
  183. width: 138px;
  184. }
  185. .preference_item_textarea {
  186. text-align: unset;
  187. line-height: 20px;
  188. }
  189.  
  190. .preference_item_edittext_color {
  191. width: 100px;
  192. border-radius: 6px 0px 0px 6px;
  193. border-right: 0;
  194. }
  195.  
  196. .hoverbutton {
  197. background: none;
  198. }
  199.  
  200. .hoverbutton:hover {
  201. background: #CCC;
  202. background-size: 80% 80%;
  203. border-radius: 4px;
  204. }
  205.  
  206. .input_select_color {
  207. width: 40px;
  208. height: 40px;
  209. margin: 0px;
  210. padding:0px 2px 0px 4px;
  211. box-sizing: border-box;
  212. background-color:#ffffff;
  213. border-width: 2px;
  214. border-radius: 0px 6px 6px 0px;
  215. border-left: 0px;
  216. border-color: #c4c7ce;
  217. }
  218.  
  219. .checkbox_input {
  220. width: 24px;
  221. height: 40px;
  222. margin: 0px 0px 0px auto;
  223. }
  224.  
  225.  
  226. .setting_panel {
  227. position: fixed;
  228. right: 20px;
  229. top: 20px;
  230. width: fit-content;
  231. height: fit-content;
  232. border-radius: 8px;
  233. background: #FFFFFF;
  234. padding: 8px;
  235. box-shadow: 0 10px 20px rgb(0 0 0 / 15%);
  236. z-index:9999;
  237. }
  238.  
  239. .container {
  240. background: #F0F0F0;
  241. border-radius: 8px;
  242. margin-top: 0px;
  243. padding-top: 8px;
  244. padding-right: 8px;
  245. }
  246. </style>
  247.  
  248. <div class="setting_panel">
  249. <div class="preference_item" style="padding-top: 0px;">
  250. <button id="close" title="关闭并保存" class="hoverbutton" type="submit"
  251. style="width: 40px;height: 40px;display: flex;align-items: center; justify-content: center; border: unset;">
  252. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#5f6368"
  253. viewBox="0 -960 960 960">
  254. <path
  255. d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
  256. </svg>
  257. </button>
  258. <p class="preference_title">设置</p>
  259. </div>
  260. <div class="container" id="container">
  261.  
  262. </div>
  263. </div>
  264. `;
  265.  
  266. const container = root.querySelector("#container");
  267. // 动态创建设置项
  268. for (const index in this.preferenceList) {
  269. const item = this.preferenceList[index];
  270. const itemDiv = document.createElement("div");
  271. itemDiv.className = "preference_item";
  272.  
  273. const itemTitle = document.createElement("p");
  274. itemTitle.className = "preference_item_title";
  275. itemTitle.innerText = item.text;
  276. itemDiv.appendChild(itemTitle);
  277.  
  278. if (item.type == "number") {
  279. const input = document.createElement("input");
  280. input.type = "number";
  281. input.className = "preference_item_edittext";
  282. input.id = item.preference;
  283. input.value = GM_getValue(item.preference, item.defaultValue);
  284. itemDiv.appendChild(input);
  285. } else if (item.type == "color") {
  286. const inputText = document.createElement("input");
  287. inputText.type = "text";
  288. inputText.className = "preference_item_edittext preference_item_edittext_color";
  289. inputText.id = item.preference;
  290. inputText.value = GM_getValue(item.preference, item.defaultValue);
  291. inputText.maxLength = 50;
  292. itemDiv.appendChild(inputText);
  293.  
  294. const inputColor = document.createElement("input");
  295. inputColor.type = "color";
  296. inputColor.className = "input_select_color";
  297. if (this.isValidHexColor(inputText.value)) {
  298. inputColor.value = inputText.value;
  299. }
  300. itemDiv.appendChild(inputColor);
  301.  
  302. inputText.addEventListener('input', () => this.inputTextAndChangeDisplayColor(inputText, inputColor));
  303. inputColor.addEventListener('input', () => this.selectColorAndChangeText(inputText, inputColor));
  304. } else if (item.type == "checkbox") {
  305. const input = document.createElement("input");
  306. input.type = "checkbox";
  307. input.id = item.preference;
  308. const checkValue = GM_getValue(item.preference, item.defaultValue);
  309. input.checked = checkValue;
  310. input.className = "checkbox_input";
  311. itemDiv.appendChild(input);
  312. } else if (item.type == "textarea") {
  313. const input = document.createElement("textarea");
  314. input.id = item.preference;
  315. input.value = GM_getValue(item.preference, item.defaultValue);
  316. input.className = "preference_item_edittext preference_item_textarea";
  317. itemDiv.appendChild(input);
  318. }
  319. container.appendChild(itemDiv);
  320. }
  321.  
  322. root.querySelector("#close").onclick = () => {
  323. root.querySelector(".setting_panel").style.display = "none";
  324. // 动态创建设置项
  325. for (const index in this.preferenceList) {
  326. const item = this.preferenceList[index];
  327.  
  328. if (item.type == "color" || item.type == "textarea") {
  329. try {
  330. GM_setValue(item.preference, root.querySelector(`#${item.preference}`).value);
  331. } catch (error) {
  332. console.error(`保存配置失败:${item.preference}`);
  333. }
  334. } else if (item.type == "number") {
  335. try {
  336. GM_setValue(item.preference, parseFloat(root.querySelector(`#${item.preference}`).value));
  337. } catch (error) {
  338. console.error(`保存配置失败:${item.preference}`);
  339. }
  340. } else if (item.type == "checkbox") {
  341. try {
  342. GM_setValue(item.preference, root.querySelector(`#${item.preference}`).checked);
  343. } catch (error) {
  344. console.error(`保存配置失败:${item.preference}`);
  345. }
  346. }
  347. }
  348. this.refreshPrefValues();
  349. };
  350. }
  351.  
  352. /** input 颜色选择器更改颜色时,同时更改文本框 */
  353. selectColorAndChangeText(inputText, inputColor) {
  354. inputText.value = inputColor.value;
  355. };
  356. /** 文本框更改值时,同时更改颜色显示 */
  357. inputTextAndChangeDisplayColor(inputText, inputColor) {
  358. const color = inputText.value;
  359. if (this.isValidHexColor(color)) {
  360. inputColor.value = color;
  361. }
  362. };
  363.  
  364. /** 用于校验 6 位的十六进制颜色值 */
  365. isValidHexColor(hex) {
  366. try {
  367. const hexPattern = /^#?([a-fA-F0-9]{6})$/;
  368. return hexPattern.test(hex);
  369. } catch (error) {
  370. return false;
  371. }
  372. }
  373.  
  374. }
  375.  
  376. /** 设置项 */
  377. const myPreferenceList = [
  378. {
  379. type: "number",
  380. tooltip: true,
  381. tooltipText: "设置为 0 时,使用默认值",
  382. text: "宽度",
  383. preference: "article_width",
  384. defaultValue: 0,
  385. },
  386. {
  387. type: "number",
  388. tooltip: false,
  389. text: "阴影大小",
  390. preference: "article_shadow_size",
  391. defaultValue: 45,
  392. },
  393. {
  394. type: "number",
  395. tooltip: false,
  396. text: "标题字体大小",
  397. preference: "article_title_fontsize",
  398. defaultValue: 28,
  399. },
  400.  
  401. {
  402. type: "checkbox",
  403. tooltip: false,
  404. text: "标题使用粗体",
  405. preference: "article_title_bold",
  406. defaultValue: true,
  407. },
  408. {
  409. type: "checkbox",
  410. tooltip: false,
  411. text: "隐藏网页顶栏",
  412. preference: "article_hide_topbar",
  413. defaultValue: false,
  414. },
  415. {
  416. type: "number",
  417. tooltip: false,
  418. text: "文章内边距大小",
  419. preference: "article_padding_size",
  420. defaultValue: 40,
  421. },
  422. {
  423. type: "color",
  424. tooltip: true,
  425. tooltipText: "设置为 0 时不生效",
  426. text: "文章背景颜色",
  427. preference: "article_bg_color",
  428. defaultValue: "0",
  429. },
  430. {
  431. type: "color",
  432. tooltip: true,
  433. tooltipText: "设置为 0 时不生效",
  434. text: "网页背景颜色",
  435. preference: "webpage_bg_color",
  436. defaultValue: "0",
  437. },
  438. {
  439. type: "textarea",
  440. tooltip: false,
  441. text: "自定义 CSS",
  442. preference: "page_custom_css",
  443. defaultValue: "",
  444. },
  445.  
  446. ];
  447.  
  448. (() => {
  449. const p = new CandyTekPreferenceUtil(myPreferenceList);
  450. // 添加设置菜单
  451. GM_registerMenuCommand("布局设置", () => {
  452. p.show();
  453. });
  454.  
  455. // 匹配域名
  456. const hostname = window.location.hostname;
  457. if (hostname.includes("huaweicloud")) {
  458. huaweicloud();
  459. } else if (hostname.includes("wenku.csdn")) {
  460. wenkucsdn();
  461. } else if (hostname.includes("iask.sina")) {
  462. iasksina();
  463. } else if (hostname.includes("jingyan.baidu")) {
  464. jingyan();
  465. } else if (hostname.includes("csdn")) {
  466. csdn();
  467. } else if (hostname.includes("jianshu")) {
  468. jianshu();
  469. } else if (hostname.includes("jb51")) {
  470. jiaoben();
  471. } else if (hostname.includes("dandelioncloud")) {
  472. pugongying();
  473. } else if (window.location.href.includes("zhihu.com/question")) {
  474. zhihuQuestion();
  475. } else if (hostname.includes("zhihu")) {
  476. zhihu();
  477. } else if (hostname.includes("baijiahao")) {
  478. baijiahao();
  479. } else if (hostname.includes("mbd")) {
  480. if (window.location.href.includes("dtlandingsuper")) {
  481. mbd();
  482. } else {
  483. baijiahao();
  484. }
  485. } else if (hostname.includes("likecs")) {
  486. likecs();
  487. } else if (hostname.includes("iteye")) {
  488. iteye();
  489. } else if (hostname.includes("bbsmax")) {
  490. bbsmax();
  491. } else if (hostname.includes("shuzhiduo")) {
  492. bbsmax();
  493. } else if (hostname.includes("wuyaogexing")) {
  494. bbsmax();
  495. } else if (hostname.includes("weixin")) {
  496. weixin();
  497. } else if (hostname.includes("sohu")) {
  498. sohu();
  499. } else if (hostname.includes("aliyun")) {
  500. aliyun();
  501. } else if (hostname.includes("51cto")) {
  502. blog51cto();
  503. } else if (hostname.includes("163")) {
  504. wangyi163();
  505. } else if (window.location.href.includes("juejin.cn/s")) {
  506. juejin2();
  507. } else if (hostname.includes("juejin")) {
  508. juejin();
  509. } else if (hostname.includes("freesion")) {
  510. freesion();
  511. } else if (hostname.includes("php1")) {
  512. php1();
  513. } else if (hostname.includes("codeleading")) {
  514. codeleading();
  515. } else if (hostname.includes("manongjc")) {
  516. manongjc();
  517. } else if (hostname.includes("bilibili")) {
  518. bilibili();
  519. } else if (hostname.includes("new.qq")) {
  520. newqq();
  521. } else if (hostname.includes("zhidao")) {
  522. zhidao();
  523. } else if (hostname.includes("360doc")) {
  524. doc360();
  525. } else if (hostname.includes("tencent")) {
  526. if (window.location.href.includes("developer/article/") || window.location.href.includes("developer/ask/")) {
  527. newtengxunyun();
  528. } else {
  529. tengxunyunInformation();
  530. }
  531. }
  532.  
  533. /** 是否移除顶栏 */
  534. function isRemoveTopbar(defaultValue) {
  535. return p.get("article_hide_topbar") ? defaultValue : "";
  536. }
  537. /** 是否移除顶栏,已弃用 */
  538. function shouldRemoveTopbar() {
  539. return p.get("article_hide_topbar");
  540. }
  541. /** */
  542. function cssShadow() {
  543. const tempSize = p.get("article_shadow_size");
  544. return tempSize == 0 ? "" : `box-shadow: 0 ${tempSize / 2}px ${tempSize}px rgb(0 0 0 / 15%) !important;`;
  545. }
  546. /** */
  547. function cssWidth(defaultValue) {
  548. const temp = p.get("article_width");
  549. return temp == 0 ? defaultValue : temp;
  550. }
  551. /** */
  552. function cssTitleBold() {
  553. return p.get("article_title_bold") ? "font-weight: 700 !important;" : "";
  554. }
  555. /** */
  556. function cssPagePadd() {
  557. return p.get("article_padding_size");
  558. }
  559. /** */
  560. function cssCustom() {
  561. return p.get("page_custom_css");
  562. }
  563. /** */
  564. function cssArticleBg() {
  565. const temp = p.get("article_bg_color");
  566. return temp == 0 ? "" : `background:${temp} !important;`;
  567. }
  568. /** */
  569. function cssPageBg() {
  570. const temp = p.get("webpage_bg_color");
  571. return temp == 0 ? "" : `background:${temp} !important;`;
  572. }
  573. /** */
  574. function cssTitleFontSize() {
  575. return `font-size:${p.get("article_title_fontsize")}px !important;`;
  576. }
  577. /** */
  578. function cssTitleFontSize2() {
  579. return `font-size:${p.get("article_title_fontsize")}px !important;line-height:${p.get("article_title_fontsize") + 12}px !important;`;
  580. }
  581.  
  582. function huaweicloud() {
  583. // https://huaweicloud.csdn.net/64e5c3da6ffa5020257601d1.html
  584. const css1 = `
  585. /* 右侧栏无关元素 */
  586. .page-home-right > div:nth-child(n+2){display:none !important;}
  587. /* 右侧栏不参与居中 */
  588. .page-home-right > div:nth-child(1){width:300px !important;}
  589. /* 右侧栏不参与居中 */
  590. .page-home-right {max-width:0px !important;}
  591. /* 右下悬浮按钮 */
  592. .siderbar-box{display:none !important;}
  593. /* 左侧栏去掉悬浮 */
  594. ul.user-action{position: absolute !important;}
  595. /* 更改文章主体宽度,阴影 */
  596. div.article-detail{
  597. ${cssArticleBg()}
  598. ${cssShadow()}
  599. padding: 16px ${cssPagePadd()}px 16px !important;
  600. max-width: unset !important;
  601. }
  602. /* 更改文章主体宽度 */
  603. div.page-home-wrapper{max-width: ${cssWidth(1000)}px !important;}
  604. /* 更改标题大小 */
  605. h1.title {${cssTitleFontSize()}${cssTitleBold()}}
  606. /* 华为云开发者任务挑战活动 */
  607. h1.none-hide {display:none !important;}
  608. #app{${cssPageBg()}}
  609. ${isRemoveTopbar(`header.org-header{display:none !important;}`)}
  610. ${cssCustom()}
  611. `;
  612. GM_addStyle(css1);
  613.  
  614. // 去掉背景
  615. const css2 = `body{background-image: none !important;}`;
  616. window.addEventListener('load', () => {
  617. GM_addStyle(css2);
  618. });
  619. }
  620.  
  621. function csdn() {
  622. // https://blog.csdn.net/code2481632/article/details/130226878
  623. const css1 = `
  624. /* 主体文章,添加阴影,增加padd */
  625. .blog-content-box{
  626. ${cssShadow()}
  627. ${cssArticleBg()}
  628. padding: 16px ${cssPagePadd()}px 16px !important;
  629. }
  630. /* 鼠标悬浮弹出分享框,二维码 */
  631. #tool-QRcode{display:none !important;}
  632. /* 主体文章,更改宽度 */
  633. #mainBox > main{width:100% !important;}
  634. /* 主体文章,更改宽度 */
  635. #mainBox{width:${cssWidth(980)}px !important;max-width:97vw;}
  636. /* 更改父布局限制宽度 */
  637. body{min-width:$fit-content !important;}
  638. /* 更改右侧栏宽度 */
  639. div#rightAside{width: 1px !important;}
  640. /* 去掉左边栏 */
  641. .blog_container_aside{display:none !important;}
  642. /* 顶栏去掉悬浮 */
  643. div#csdn-toolbar{position: relative !important;}
  644. .programmer1Box{display:none !important;}
  645. .recommendAdBox{display:none !important;}
  646. #recommendAdBox{display:none !important;}
  647. #recommendNps{display:none !important;}
  648. #asideArchive{display:none !important;}
  649. .hot-brand{display:none !important;}
  650. .top-banner{display:none !important;}
  651. .pudn-recommend{display:none !important;}
  652. #wrapper{display:none !important;}
  653. #mys-wrapper{display:none !important;}
  654. .csdn-side-toolbar{display:none !important;}
  655. .aside-box.kind_person.d-flex.flex-column{display:none !important;}
  656. .content-list{box-shadow: 0 16px 16px rgb(0 0 0 / 3%) !important;}
  657. .left-toolbox{
  658. padding-top: 0px !important;
  659. padding-bottom: 0px !important;
  660. height: 32px !important;
  661. }
  662. body{background-image: none !important;}
  663. .hide-article-box.hide-article-pos.text-center{display:none !important;}
  664. /* 去掉悬浮,去创作 */
  665. div.write-guide-buttom-box{display:none !important;}
  666. /* 文章有的时候展示不全 */
  667. div#article_content{height:auto !important;}
  668. /* 登录弹框 */
  669. div.passport-login-container{display:none !important;}
  670. /* 推广弹窗,流量 */
  671. /* 文章标题,更改字号 */
  672. .title-article{${cssTitleFontSize()}${cssTitleBold()}}
  673. body{${cssPageBg()}min-width: unset !important;}
  674. ${isRemoveTopbar(`div#toolbarBox{display:none !important;}`)}
  675. ${cssCustom()}
  676. `;
  677. GM_addStyle(css1);
  678.  
  679. // 去掉背景
  680. const css2 = `body{background-image: none !important;}`;
  681. window.addEventListener('load', () => {
  682. GM_addStyle(css2);
  683. });
  684. }
  685.  
  686. function jianshu() {
  687. // 简书需要延迟一点时间,再加载脚本
  688. document.addEventListener("DOMContentLoaded", () => { jianshu2(); });
  689. }
  690. function jianshu2() {
  691. // https://www.jianshu.com/p/80c0cd588773?login=from_csdn
  692. const css1 = `
  693. /* 嵌入式广告 */
  694. iframe{display:none !important;}
  695. /* 去掉顶栏悬浮 */
  696. header > div:nth-child(1){position:static !important;}
  697. /* 去掉顶栏的子元素,这个不知道是啥 */
  698. header > div:nth-child(1) > div:nth-child(2){display:none !important;}
  699. /* 去掉副顶栏,即页面滑动的时候顶栏会变出来的元素 */
  700. header > div:nth-child(2){display:none !important;}
  701. /* 广告 */
  702. .-umr26{display:none !important;}
  703. /* 底下文章推荐间广告 */
  704. ins{display:none !important;}
  705. /* 底下文章推荐间广告 */
  706. #mv_ad_render{display:none !important;}
  707. /* 右侧栏文章推荐 */
  708. aside > div{display:none !important;width:260px !important;}
  709. /* 使右侧栏不参与居中对齐 */
  710. aside > section{width:260px !important;}
  711. aside{width:0px !important;}
  712. /* 左边三个悬浮按钮 */
  713. ._1pUUKr{display:none}
  714. /* 主体文章,增加宽度,增加阴影 */
  715. ._gp-ck{
  716. max-width: 100vw !important;
  717. width:${cssWidth(1000)}px !important;
  718. ${cssShadow()}
  719. }
  720. section.ouvJEz{${cssArticleBg()}}
  721. /* 主体文章,更改padd */
  722. ._gp-ck > section:nth-child(1){padding: 24px ${cssPagePadd()}px !important;}
  723. /* 底边栏,点赞评论栏,更改padd */
  724. ._1Jdfvb{padding:0 0 0 0 !important;}
  725. /* 文章底部赞赏 div */
  726. ._13lIbp{display:none !important;}
  727. /* 文章适配半屏窗口,去掉父布局的宽度设置 */
  728. div._3VRLsv{width: unset !important;}
  729. /* 一些小窗 */
  730. /* body > div:nth-child(13), body > div:nth-child(11), body > div:nth-child(14),body > div:nth-child(12){display:none !important;} */
  731. div#note{display:none !important;}
  732. /* 屏蔽安装简书客户端 */
  733. div._23ISFX-mask,div._23ISFX-wrap{display:none !important;}
  734. /* 去掉标题顶部的空白 */
  735. h1._1RuRku{margin-top:unset !important;}
  736. body{overflow: unset !important;}
  737. ._3kbg6I{${cssPageBg()}}
  738. /* 文章标题,更改字号 */
  739. h1._1RuRku{${cssTitleFontSize()}${cssTitleBold()}}
  740. ${isRemoveTopbar(`header{display:none !important;}`)}
  741. ${cssCustom()}
  742. `;
  743. GM_addStyle(css1);
  744. }
  745.  
  746. function jiaoben() {
  747. // https://www.jb51.net/server/299297pcq.htm
  748. const css1 = `
  749. /* 头部 */
  750. #header{display: none !important;}
  751. /* 头部菜单 */
  752. #submenu{display: none !important;}
  753. /* 头部 标签广告 */
  754. .pt10.clearfix{display: none !important;}
  755. /* 三个mys 没用,因为广告是重新document嵌入的 */
  756. .mys-wrapper{display: none !important;}
  757. /* 三个mys 没用,因为广告是重新document嵌入的 */
  758. #mys-wrapper{display: none !important;}
  759. /* 三个mys 没用,因为广告是重新document嵌入的 */
  760. #mys-content{display: none !important;}
  761. /* 右侧栏 */
  762. .main-right{display: none !important;}
  763. /* 左边正文更改宽度 */
  764. .main-left{
  765. width: ${cssWidth(970)}px !important;
  766. max-width:96vw !important;
  767. padding-right: unset !important;
  768. }
  769. /* 正文父布局更改宽度 */
  770. #container{width: fit-content !important;}
  771. /* 左边的分享、一键回顶 悬浮栏 */
  772. #right-share{display: none !important;}
  773. /* 文章主体,顶部的嵌入广告 */
  774. .lbd.clearfix{display: none !important;}
  775. /* 文章主体,底部的嵌入广告 */
  776. .lbd_bot.clearfix{display: none !important;}
  777. /* 搜索栏 */
  778. .search{display: none !important;}
  779. /* 底部 更多文章推荐 */
  780. .xgcomm.clearfix{display: none !important;}
  781. /* 关注脚本之家 */
  782. #ewm{display: none !important;}
  783. /* 您的位置 */
  784. .breadcrumb{display: none !important;}
  785. /* 文章嵌入gg广告 */
  786. .adsbygoogle{display: none !important;}
  787. /* 文章嵌入gg广告 */
  788. #aswift_1_host{display: none !important;}
  789. /* 文章嵌入gg广告 */
  790. #aswift_1{display: none !important;}
  791. /* 文章嵌入gg广告 */
  792. #aswift_2_host{display: none !important;}
  793. /* 文章嵌入gg广告 */
  794. #aswift_2{display: none !important;}
  795. /* 文章主体框添加阴影,更改padd */
  796. #article{
  797. ${cssArticleBg()}
  798. ${cssShadow()}
  799. padding: 15px ${cssPagePadd()}px 0 !important;
  800. }
  801. #wrapper{${cssPageBg()}}
  802. /* 文章标题,更改字号 */
  803. h1.title{${cssTitleFontSize2()}${cssTitleBold()}}
  804. ${isRemoveTopbar(`#topbar{display: none !important;} #nav{display: none !important;}`)}
  805. ${cssCustom()}
  806. `
  807. GM_addStyle(css1);
  808. }
  809.  
  810. function pugongying() {
  811. // https://dandelioncloud.cn/article/details/1537400855221616642
  812. const css1 = `
  813. /* 主体文章,更改宽度 */
  814. .main.fl{width: 100% !important;padding-left: 0px !important;}
  815. /* 主体文章,更改宽度,添加阴影 */
  816. .main-content.container.clearfix{
  817. max-width: ${cssWidth(970)}px !important;
  818. ${cssShadow()}
  819. }
  820. /* 去掉广告 */
  821. .adsbygoogle{display: none !important;}
  822. /* 顶栏去掉悬浮 */
  823. .top-bar.fixed-nav.fixed-appear{position: static !important;}
  824. /* 标题栏更改字号,更改粗体 */
  825. .single-title > h1{font-size: 28px !important;font-weight: 700 !important;}
  826. /* 主体文章,更改padd,更改背景为白色 */
  827. .single.box-show{
  828. padding: 0px ${cssPagePadd()}px !important;
  829. ${cssArticleBg()}
  830. }
  831. /* 去掉原来box 的样式:阴影,圆角 */
  832. .box-show{
  833. border-radius: 0px !important;
  834. -webkit-box-shadow: none !important;
  835. box-shadow: none !important;
  836. }
  837. /* 去掉右侧栏 */
  838. #menu-aside{display: none !important;}
  839. /* 更改页面背景 */
  840. .home.home-index{
  841. background-image: none !important;
  842. ${cssPageBg()}
  843. }
  844. /* 文章标题 */
  845. header.single-title > h1{${cssTitleFontSize()}${cssTitleBold()}}
  846. ${isRemoveTopbar(`div.menu-top{display: none !important;}`)}
  847. ${cssCustom()}
  848. `;
  849. GM_addStyle(css1);
  850. }
  851.  
  852. function zhihuQuestion() {
  853. // https://www.zhihu.com/question/544176885/answer/3381371216
  854. const css1 = `
  855. /* 去掉页脚,去掉邀请下面用户 */
  856. footer,.Card.QuestionInvitation{display: none !important; }
  857. /* 文章主体添加阴影 */
  858. div.AnswersNavWrapper,div.AnswerCard ,div.MoreAnswers{
  859. ${cssShadow()}
  860. ${cssArticleBg()}
  861. }
  862. /* 使右侧栏不参与居中,右侧栏去掉悬浮 */
  863. div.Question-sideColumn > div:nth-child(3){
  864. width:290px !important;
  865. margin-left:24px !important;
  866. position: unset !important;
  867. }
  868. /* 使右侧栏不参与居中 */
  869. div.Question-sideColumn{width:0px !important;}
  870. /* 更改文章主体宽度 */
  871. div.QuestionHeader{min-width:unset !important;}
  872. div.QuestionHeader-footer-inner,div.Question-main{width:${cssWidth(910)}px !important;}
  873. div.QuestionHeader-main{width:${cssWidth(910)}px !important;}
  874. div.QuestionHeader-side{width:0px !important;}
  875. div.QuestionHeader-side > div{width:217px !important;}
  876. div.QuestionHeader-content{
  877. margin:auto !important;
  878. width:${cssWidth(910)}px !important;
  879. padding-left:unset !important;
  880. }
  881. h1.QuestionHeader-title{${cssTitleFontSize2()}${cssTitleBold()}}
  882. /* 更改文章主体宽度,适配半屏 */
  883. div.Question-mainColumn{width:100% !important;max-width:92vw !important;}
  884. div.AuthorInfo{width:100% !important;max-width:100% !important;}
  885. div.ListShortcut{width:100%;}
  886. body{${cssPageBg()}}
  887. ${isRemoveTopbar(`.Sticky.ColumnPageHeader,header.AppHeader{display: none !important;}`)}
  888. ${cssCustom()}
  889. `
  890. // 如果加上去掉顶栏悬浮的话,页面滑动会抖动一下,实力有限解决不了,就不加了
  891. GM_addStyle(css1);
  892. window.addEventListener('load', () => {
  893. // 更改顶栏logo元素高度
  894. document.querySelector("div.ColumnPageHeader-content > a > svg").setAttribute('height', 24);
  895. });
  896. }
  897. function zhihu() {
  898. // https://zhuanlan.zhihu.com/p/662421567
  899. const css1 = `
  900. /* 更改文章主体 宽度 */
  901. .Post-NormalMain > div, .Post-NormalMain > header{
  902. width:${cssWidth(860)}px !important;
  903. max-width:92vw !important;
  904. }
  905. /* 给文章主体添加阴影,与padding */
  906. .Post-RichTextContainer{
  907. ${cssArticleBg()}
  908. ${cssShadow()}
  909. padding: 20px ${cssPagePadd()}px !important;
  910. }
  911. @media screen and (max-width: ${cssWidth(860)}px){
  912. .Post-RichTextContainer{padding: 20px 4px !important;}
  913. }
  914. /* 更改评论区的宽度 */
  915. .Post-NormalSub > div{width:${cssWidth(860)}px !important;}
  916. /* 更改标题关注按钮的距离 */
  917. div.AuthorInfo{max-width: ${cssWidth(860)}px !important;}
  918. /* 去掉右边悬浮按钮,点赞分享 */
  919. .Post-SideActions{display: none !important;}
  920. /* 更改顶栏高度 */
  921. div.ColumnPageHeader-content{height:30px !important;}
  922. /* 更改顶栏高度 */
  923. .Sticky.is-fixed {height:30px !important;}
  924. /* 更改顶栏高度 */
  925. div.ColumnPageHeader{height:30px !important;}
  926. /* 更改顶栏元素高度 */
  927. div.ColumnPageHeader-content > a > svg {height:30 !important;}
  928. /* 更改顶栏元素高度 */
  929. button.ColumnPageHeader-WriteButton {line-height: 28px !important;}
  930. /* 左侧栏,左移一些 */
  931. div.css-376mun > div.css-l44lgl{left:${-1 * cssPagePadd() -300}px !important;}
  932. /* 更改标题大小 */
  933. h1.Post-Title{${cssTitleFontSize()}${cssTitleBold()}}
  934. div.Post-content{${cssPageBg()}min-width:unset !important;}
  935. ${isRemoveTopbar(`.Sticky.ColumnPageHeader{display: none !important;}`)}
  936. ${cssCustom()}
  937. `;
  938. GM_addStyle(css1);
  939. // 如果加上去掉顶栏悬浮的话,页面滑动会抖动一下,实力有限解决不了,就不加了
  940. window.addEventListener('load', () => {
  941. // 更改顶栏logo元素高度
  942. document.querySelector("div.ColumnPageHeader-content > a > svg").setAttribute('height', 24);
  943. });
  944. }
  945. function baijiahao() {
  946. // https://baijiahao.baidu.com/s?id=1706337201709858987&wfr=spider&for=pc
  947. const css1 = `
  948. /* 去掉右边栏 */
  949. #ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(2){display: none !important;}
  950. /* 标题更改字号 */
  951. #header> div:nth-child(1){
  952. ${cssTitleFontSize()}
  953. ${cssTitleBold()}
  954. }
  955. /* 文章主题更改宽度,添加阴影 */
  956. #ssr-content > div:nth-child(2) > div:nth-child(1) ,#ssr-content > div:nth-child(2){width:min-content !important;}
  957. #ssr-content > div:nth-child(2) > div:nth-child(2) {margin-left:-60px !important;}
  958. #ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(1){
  959. width:${cssWidth(890)}px !important;
  960. max-width:96vw !important;
  961. padding: 0px ${cssPagePadd()}px !important;
  962. ${cssArticleBg()}
  963. ${cssShadow()}
  964. margin-right:unset !important;
  965. }
  966. @media screen and (max-width: ${cssWidth(890)}px){
  967. #ssr-content > div:nth-child(2) > div:nth-child(1) > div:nth-child(1){padding: 0px 4px !important;}
  968. }
  969. /* 左侧栏去掉悬浮 */
  970. div._3PLyv {position: absolute !important;}
  971. body{${cssPageBg()}}
  972. ${isRemoveTopbar(`#ssr-content > div:nth-child(1){display: none !important;}#ssr-content > div:nth-child(2){padding-top: 0px !important;}`)}
  973. ${cssCustom()}
  974. `;
  975. GM_addStyle(css1);
  976. //#ssr-content > div:nth-child(1){height:36px !important;position: static !important;}
  977. //#ssr-content > div:nth-child(1) > div:nth-child(1) > div{height:36px !important;}
  978. //#ssr-content > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > form{display: none !important;}
  979. }
  980.  
  981. function likecs() {
  982. // https://www.likecs.com/show-308626808.html
  983. const css1 = `
  984. /* 右边栏 */
  985. div.rigthbox{display: none !important;}
  986. /* 主体文章,更改padd */
  987. article.tag-webview{padding: 0px 0px !important;}
  988. /* 标题去掉居中,更改padd */
  989. h1.page-title{text-align:left !important;padding-top: 10px !important;}
  990. /* 标题字体,更改为粗体,更改字体颜色 */
  991. h1.page-title > a{
  992. ${cssTitleFontSize2()}${cssTitleBold()}
  993. color: #000 !important;
  994. }
  995. /* 顶栏,更改背景颜色 */
  996. .main-nav.clearfix{padding: 8px 0 !important;background: #FFF !important;}
  997. /* 更改顶部标题的背景颜色 */
  998. div.site-wrapper > header {background: #FFF !important;}
  999. /* 文章主体右边虚拟位置 */
  1000. main.content > div.clearfix {display: none !important;}
  1001. /* footer */
  1002. div.site-wrapper > footer{display: none !important;}
  1003. /* 更改背景颜色为白色 */
  1004. body{${cssPageBg()}}
  1005. div.site-wrapper{background:unset !important;}
  1006. /* 文章主体添加阴影,并适配父布局的宽度 */
  1007. div.leftbox {
  1008. ${cssShadow()}
  1009. width: 100%;
  1010. }
  1011. section.post-content{
  1012. padding: 16px ${cssPagePadd()}px 16px !important;
  1013. ${cssArticleBg()}
  1014. }
  1015. /* 设置文章主体的宽度 */
  1016. main.content{max-width: ${cssWidth(1000)}px !important;}
  1017. /* 文章顶部的广告 */
  1018. .post-content > div.contentbef{display: none !important;}
  1019. /* 顶部弹出广告 */
  1020. .adsbygoogle{display: none !important;}
  1021. /* 顶部弹出广告 */
  1022. .adsbygoogle-noablate{display: none !important;}
  1023. ${isRemoveTopbar(`.main-nav.clearfix{display: none !important;`)}
  1024. ${cssCustom()}
  1025. `;
  1026. GM_addStyle(css1);
  1027. }
  1028.  
  1029. function iteye() {
  1030. // https://www.iteye.com/blog/ucstudio-1395721
  1031. const css1 = `
  1032. /* 主体,去掉margin */
  1033. div#page{margin: 0 !important;}
  1034. /* 标题,更改字号,更改为粗体 */
  1035. div.blog_title > h3{${cssTitleFontSize()}${cssTitleBold()}}
  1036. /* 文章正文宽度 */
  1037. div#content{width: ${cssWidth(820)}px !important;max-width:97vw !important;}
  1038. /* 文章正文去掉边框,更改padd,添加阴影,宽度匹配父布局 */
  1039. div#main{
  1040. border: none !important;
  1041. padding: 16px ${cssPagePadd()}px !important;
  1042. ${cssShadow()}
  1043. ${cssArticleBg()}
  1044. width: 100% !important;
  1045. }
  1046. div.blog_main{${cssArticleBg()}}
  1047. div.blog_main{padding:unset !important;}
  1048. /* 去掉右下角悬浮框礼盒 */
  1049. div#main > div.csdn-side-toolbar{display: none !important;}
  1050. /* 右边栏放在文章底部 */
  1051. div.blog-sidebar{width: 100% !important;}
  1052. /* 右边栏更改宽度 */
  1053. div.recommend-right{width: 100% !important;padding: 5px 24px !important;}
  1054. /* 去掉左边栏 */
  1055. div#local{display: none !important;}
  1056. /* 去掉原本底部假的文章推荐(其实它可以直接抢钱的) */
  1057. div.comments{display: none !important;}
  1058. div#page{${cssPageBg()}}
  1059. ${isRemoveTopbar(`div#header{display: none !important;}`)}
  1060. ${cssCustom()}
  1061. `;
  1062. GM_addStyle(css1);
  1063. }
  1064. function bbsmax() {
  1065. // 好像倒闭了
  1066. const css1 = `
  1067. /* 文章正文上面未知空白 */
  1068. div.post-title > div:nth-child(1){display: none !important;}
  1069. /* 文章正文上面未知空白 */
  1070. div.post-title > div.post-content > div:nth-child(1){display: none !important;}
  1071. /* 出售独享账号,广告 */
  1072. div.post-title > div.post-content > span{display: none !important;}
  1073. /* 主体文章更改宽度 */
  1074. div.container{max-width: 980px !important;}
  1075. /* 主体文章更改padd,添加阴影 */
  1076. div.post{padding: 35px 40px !important;box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;}
  1077. /* 顶栏更改高度 */
  1078. div#header{padding: 0px 0px !important;}
  1079. /* 主体文章向上面移一点 */
  1080. div#page-content{padding: 80px 0 50px 0 !important;}
  1081. /* 更改标题字体为粗体,调大字号 */
  1082. h1.title{font-weight: 700 !important;font-size: 28px !important;}
  1083. /* 把顶栏logo 调暗一些,不要这么跳脱 */
  1084. h1.logo{opacity: 0.4 !important;}
  1085. /* 文章顶部推广 */
  1086. ins.adsbygoogle{display:none !important;}
  1087. `;
  1088. const topBar = `div#header{display: none !important;} div#page-content{padding: 12px 0 !important;}`
  1089. GM_addStyle(shouldRemoveTopbar() ? css1 + topBar : css1);
  1090.  
  1091. // 移除推广
  1092. window.addEventListener('load', () => {
  1093. const adDivs = document.querySelectorAll('.adsbygoogle');
  1094. // 遍历这些 div 元素的父元素并移除它们
  1095. adDivs.forEach((adDiv) => {
  1096. const parentElement = adDiv.parentElement;
  1097. if (parentElement) {
  1098. parentElement.remove();
  1099. }
  1100. });
  1101. });
  1102. }
  1103. function weixin() {
  1104. // https://mp.weixin.qq.com/s?__biz=MzI2OTE0ODY5Mw==&mid=2247521842&idx=1&sn=39fd8d11166dea17cba369fec23b516c&chksm=eae66148dd91e85ec9a855140034f0458ff03b222132b39e3a93d3d71979995efc0b425a9662&scene=27
  1105. const css1 = `
  1106. /* 文章正文宽度,阴影,修改padd */
  1107. div.rich_media_area_primary_inner{
  1108. max-width:94vw !important;
  1109. width: ${cssWidth(780)}px !important;
  1110. ${cssShadow()}
  1111. ${cssArticleBg()}
  1112. padding: 0 ${cssPagePadd()}px !important;
  1113. }
  1114. @media screen and (max-width: ${cssWidth(780)}px){
  1115. div.rich_media_area_primary_inner{padding: 0 4px !important;}
  1116. }
  1117. /* 右边二维码移到文章底部 */
  1118. div#js_pc_qr_code{position: static !important;}
  1119. /* 更改标题字体大小 */
  1120. h1#activity-name{
  1121. ${cssTitleFontSize()}${cssTitleBold()}
  1122. padding-top:12px !important;
  1123. }
  1124. div#page-content{
  1125. ${cssPageBg()}
  1126. padding:unset !important;
  1127. }
  1128. ${cssCustom()}
  1129. `;
  1130. GM_addStyle(css1);
  1131. }
  1132. function sohu() {
  1133. // https://www.sohu.com/a/492900285_121174061
  1134. const css1 = `
  1135. /* 左侧分享按钮 */
  1136. div#article-do{display: none !important;}
  1137. /* 右侧栏 */
  1138. div#right-side-bar{display: none !important;}
  1139. /* 悬浮按钮,回顶,反馈 */
  1140. div#float-btn{display: none !important;}
  1141. /* 去掉顶栏悬浮 */
  1142. header#main-header{position: static !important;}
  1143. /* 主体文章父布局,更改宽度 */
  1144. div#article-container{width:min-content !important;}
  1145. /* 主体文章,更改宽度,添加阴影,更改padd */
  1146. .left.main{
  1147. max-width:94vw !important;
  1148. width:${cssWidth(850)}px !important;
  1149. ${cssShadow()}
  1150. ${cssArticleBg()}
  1151. padding: 24px ${cssPagePadd()}px !important;
  1152. margin-left: unset !important;
  1153. }
  1154. @media screen and (max-width: ${cssWidth(850)}px){
  1155. .left.main{padding: 24px 5px !important;}
  1156. }
  1157. /* 左侧栏移到右边,适配半屏窗口 */
  1158. .column.left{
  1159. width: 0px !important;
  1160. position: absolute !important;
  1161. right: -16px !important;
  1162. }
  1163. /* 更改去悬浮后,多出来的东西 */
  1164. div.location-without-nav{margin-top:0px !important;}
  1165. /* 左下角广告 */
  1166. div#left-bottom-god{display: none !important;}
  1167. /* 文章下面广告 */
  1168. div.pc-ad-common{display: none !important;}
  1169. /* 文章下面广告 */
  1170. div.god-bigpic{display: none !important;}
  1171. /* 文章中间时不时弹出的广告 */
  1172. div.left-bottom-float-fullScreenSleepContainer{display: none !important;}
  1173. div.text-title > h1{${cssTitleFontSize2()}${cssTitleBold()}}
  1174. body{${cssPageBg()}}
  1175. ${isRemoveTopbar(`header#main-header{display: none !important;}`)}
  1176. ${cssCustom()}
  1177. `;
  1178. GM_addStyle(css1);
  1179. }
  1180.  
  1181. function aliyun() {
  1182. // https://developer.aliyun.com/article/931210
  1183. const css1 = `
  1184. /* 去掉顶栏悬浮 */
  1185. div#global-community-nav-pc > div:nth-child(1){position: static !important;}
  1186. /* 右下角悬浮反馈 */
  1187. div.feed-back-wrapper{display:none !important;}
  1188. /* 去掉正文父布局宽度限制 */
  1189. div.article-detail{min-width:unset !important;}
  1190. /* 右侧推广电子书 */
  1191. .right-item-box.ebook-box{display: none !important;}
  1192. /* 去掉左侧按钮栏悬浮 */
  1193. div#action-btns{position: absolute !important;}
  1194. /* 多余的地址导航栏(开发者社区 > 作者 > 正文) */
  1195. div.developer-nav{display: none !important;}
  1196. /* 正文父布局宽度,适配半屏 */
  1197. div.article-wrapper{width: ${cssWidth(924)}px !important;margin: auto !important;max-width:100vw !important;}
  1198. /* 正文匹配父布局宽度 */
  1199. div.left-content{width: 100% !important;}
  1200. /* 正文更改padd,添加阴影 */
  1201. div.content-wrapper{
  1202. ${cssArticleBg()}
  1203. ${cssShadow()}
  1204. padding: 12px ${cssPagePadd()}px !important;
  1205. }
  1206. /* 使侧栏不参与居中 */
  1207. div#right-box{width: 0px !important;margin-left: 24px !important;}
  1208. /* 恢复侧栏应有宽度 */
  1209. div.right-item-box{width: 320px !important;padding-right:12px !important;}
  1210. /* 作者栏点赞栏去掉悬浮 */
  1211. div.aigc-fixed{position: static !important;width:auto !important;}
  1212. h1.article-title{${cssTitleFontSize2()}${cssTitleBold()}}
  1213. div.article-detail{${cssPageBg()}}
  1214. ${isRemoveTopbar(`header,nav.ace-developer-new-global-community-nav{display:none !important;}`)}
  1215. ${cssCustom()}
  1216. `;
  1217. GM_addStyle(css1);
  1218. }
  1219.  
  1220. function newtengxunyun() {
  1221. let css1 = `
  1222. /* 去掉左侧点赞悬浮 */
  1223. div.cdc-suspend-pill{position:absolute !important;}
  1224. /* 浏览文章一半时,去掉出现的悬浮顶栏 */
  1225. .cdc-sticky-header.mod-sticky-header{display: none !important;}
  1226. /* 右侧栏推广 */
  1227. div.cdc-commercial-swiper{display: none !important;}
  1228. /* 右侧栏,扫码 */
  1229. div.cdc-group-qr-card{display: none !important;}
  1230. /* 更改右侧栏,目录栏宽度 */
  1231. div.cdc-directory__inner{width: 335px !important;}
  1232. /* 去掉右下悬浮按钮,回到顶部、二维码 */
  1233. div.cdc-widget-global{display: none !important;}
  1234. /* 右侧栏,更改宽度,使正文居中 */
  1235. div.cdc-layout__side{width:0px !important;padding-left: 12px;}
  1236. /* 更改无关的padd,使正文居中 */
  1237. div.cdc-global__main{padding-left: unset !important;padding-right: unset !important;}
  1238. /* 文章主体,添加阴影 */
  1239. div.mod-article-content{
  1240. ${cssArticleBg()}
  1241. ${cssShadow()}
  1242. padding: 24px ${cssPagePadd()}px !important;
  1243. }
  1244. /* 更改文章宽度 */
  1245. div.cdc-global__main{max-width:${cssWidth(980)}px !important;}
  1246. /* 有奖创作,这篇文章有价值 */
  1247. div#tea-overlay-root{display:none !important;}
  1248. body{${cssPageBg()}}
  1249. ${isRemoveTopbar(`div.cdc-header{display: none !important;} div.layout-side{top: 20px !important;}`)}
  1250. ${cssCustom()}
  1251. `;
  1252.  
  1253. // ask 单独适配
  1254. // https://cloud.tencent.com/developer/information/%E5%AE%89%E5%8D%93selectableItemBackgroundBorderless-ask
  1255. if (window.location.href.includes("developer/ask")) {
  1256. css1 += `
  1257. /* 更改标题字体大小 */
  1258. h1.mod-head-title-text{${cssTitleFontSize2()}${cssTitleBold()}}
  1259. /* 文章主体,添加阴影 */
  1260. div.cdc-layout__main{
  1261. ${cssShadow()}
  1262. ${cssArticleBg()}
  1263. padding: 24px ${cssPagePadd()}px !important;
  1264. }
  1265. /* 更改父布局宽度 */
  1266. div.cdc-answer-stack-detail__main{width:${cssWidth(980)}px !important;max-width:98vw !important;}
  1267. /* 相关产品 */
  1268. div.cdc-mod-product2{display:none !important;}
  1269. /* 更改父布局宽度 */
  1270. div.cdc-answer-stack-detail{min-width:0px !important;}
  1271. /* 交流群 */
  1272. div.cdc-group-qr-card2{display:none !important;}
  1273. /* 适配半屏 */
  1274. @media screen and (max-width: ${cssWidth(980)}px){
  1275. div.cdc-layout__main {padding: 20px 5px !important;}
  1276. }
  1277. `;
  1278. }
  1279. // article 单独适配
  1280. // https://cloud.tencent.com/developer/article/1645814
  1281. if (window.location.href.includes("developer/article/")) {
  1282. css1 += `
  1283. div.cdc-article-page{${cssPageBg()}}
  1284. /* 相关产品 */
  1285. div.cdc-mod-product2{display:none !important;}
  1286. div#content-product-container{display:none !important;}
  1287. div.cdc-commercial-card{display:none !important;}
  1288. div.cdc-suspend-pill {left: calc(50% - ${cssWidth(980) / 1.7}px);}
  1289. /* 更改标题字体大小 */
  1290. .title-text{${cssTitleFontSize2()}${cssTitleBold()}}
  1291. `;
  1292. }
  1293. window.addEventListener('DOMContentLoaded', function() {
  1294. GM_addStyle(css1);
  1295. });
  1296. }
  1297.  
  1298. function tengxunyunInformation() {
  1299. // https://cloud.tencent.com/developer/news/907332
  1300. // https://cloud.tencent.com/developer/information/%E5%AE%89%E5%8D%93selectableItemBackgroundBorderless-ask
  1301. let css1 = `
  1302. /* 文章主体,添加阴影 */
  1303. div.layout-main{
  1304. padding: 24px ${cssPagePadd()}px !important;
  1305. width:100% !important;
  1306. ${cssArticleBg()}
  1307. ${cssShadow()}
  1308. }
  1309. /* 适配半屏 */
  1310. @media screen and (max-width: ${cssWidth(950)}px){
  1311. div.layout-main {padding: 20px 5px !important;}
  1312. }
  1313. /* 文章父布局,更改宽度 */
  1314. body{min-width:0px !important;}
  1315. /* 右侧栏,扫码、活动 */
  1316. div.info-side-public,section.info-side-activity{display: none !important;}
  1317. /* 右侧栏,产品、资讯、标签 */
  1318. section.info-side-product,section.info-side-news,section.info-side-tags{display: none !important;}
  1319. /* 右侧栏,不参与居中对齐 */
  1320. div.layout-side{display:block !important;margin-left: 30px;}
  1321. /* 文章父布局,更改宽度 */
  1322. div.com-body{min-width:0px !important;width:${cssWidth(950)}px !important;max-width:98vw !important;}
  1323. /* 移除右下悬浮栏 */
  1324. div.com-widget-global{display:none !important;}
  1325. /* 文章父布局,更改宽度,news的单独适配 */
  1326. div.news-body{width:min-content !important;}
  1327. /* 去掉左侧栏悬浮,news的单独适配 */
  1328. div.com-widget-operations{position: absolute !important;}
  1329. /* 有奖创作,这篇文章有价值 */
  1330. div#tea-overlay-root{display:none !important;}
  1331. /* 更改标题字体大小 */
  1332. h1.pg-info-title{${cssTitleFontSize2()}${cssTitleBold()}}
  1333. html,body{${cssPageBg()}}
  1334. ${isRemoveTopbar(`div.cdc-header{display: none !important;} div.layout-side{top: 20px !important;}`)}
  1335. ${cssCustom()}
  1336. `;
  1337. // news 单独适配
  1338. if (window.location.href.includes("developer/news/")) {
  1339. css1 += `
  1340. /* 更改标题字体大小 */
  1341. h1.col-article-title{${cssTitleFontSize2()}${cssTitleBold()}}
  1342. `;
  1343. }
  1344. GM_addStyle(css1);
  1345. }
  1346.  
  1347. function blog51cto() {
  1348. // https://blog.51cto.com/u_15127674/4283123
  1349. const css1 = `
  1350. /* 去掉顶栏悬浮 */
  1351. div.ace-developer-common-nav > div:nth-child(1){position: static !important;}
  1352. /* 去掉顶栏悬浮 */
  1353. div.Header {position: absolute !important;}
  1354. /* 去掉左按钮栏悬浮,干脆不要了,文章底部都有 */
  1355. .action-aside.action-aside-left{position: absolute !important;display: none !important;}
  1356. /* 右侧栏,近期文章 */
  1357. aside.detail-content-right > section:nth-child(4){display: none !important;}
  1358. /* 右侧栏,新人活动 */
  1359. aside.detail-content-right > section > a:nth-child(1) {display: none !important;}
  1360. aside.detail-content-right > div {display: none !important;}
  1361. /* 右下角悬浮栏 */
  1362. aside.minmenu {display: none !important;}
  1363. /* 右侧栏,不参与居中对齐 */
  1364. aside.detail-content-right {margin-right:-302px !important;}
  1365. /* 去掉顶栏悬浮 */
  1366. .Content.detail-content-new > div.fixtitle {display: none !important;}
  1367. /* 文章主体,更改宽度 */
  1368. article.detail-content-left{width:${cssWidth(980)}px !important;max-width:97vw;}
  1369. /* 文章父布局,更改宽度 */
  1370. div#page_center{width:1020px !important;}
  1371. /* 文章主体,更改padd、添加阴影 */
  1372. .common-section.common-spacing.mb30.article-detail{
  1373. padding:15px ${cssPagePadd()}px !important;
  1374. ${cssArticleBg()}
  1375. ${cssShadow()}
  1376. }
  1377. /* 更改标题大小 */
  1378. div.title>h1{${cssTitleFontSize2()}${cssTitleBold()}}
  1379. /* 左侧栏悬浮按钮,去掉半屏时展开成横条状 */
  1380. /* div.inner{width:0px !important;} */
  1381. /* 左侧栏悬浮按钮,离文章近一点 */
  1382. /* aside.action-aside{left:58% !important;} */
  1383. /* 投骰子 */
  1384. div.right-fixadv{display:none !important;}
  1385. /* 悬停球不要悬停 */
  1386. .hover-ball{position: absolute !important;}
  1387. div.detail-content-new{${cssPageBg()}}
  1388. ${isRemoveTopbar(`div.Header{display: none !important;} header.home-top{display: none !important;} div.detail-content-new{padding: 20px 0 !important;}`)}
  1389. ${cssCustom()}
  1390. `;
  1391. GM_addStyle(css1);
  1392. }
  1393.  
  1394. function wangyi163() {
  1395. // https://www.163.com/dy/article/IHKTIFQ40514AHGG.html
  1396. const css1 = `
  1397. /* 右侧栏 */
  1398. div.post_side{display: none !important;}
  1399. /* 文章主体,添加阴影、更改padd */
  1400. div.post_body{
  1401. ${cssArticleBg()}
  1402. ${cssShadow()}
  1403. padding:20px ${cssPagePadd()}px !important;
  1404. }
  1405. /* 右下角,二维码 */
  1406. a.newsapp-qrcode{display: none !important;}
  1407. /* 右下角,回到顶部 */
  1408. a.ns-side-totop{display: none !important;}
  1409. /* 文章左侧悬浮按钮,去掉悬浮 */
  1410. div.post_top_fixed{display: none !important;}
  1411. /* 右下角弹窗登录 */
  1412. .login-guide-wrap.login-guide-popup{display: none !important;}
  1413. /* 左侧悬浮按钮,放到右边 */
  1414. div.post_top{
  1415. right:0 !important;
  1416. left:auto !important;
  1417. margin-right:-150px !important;
  1418. background:none !important;
  1419. }
  1420. /* 文章主体父布局,去掉padd */
  1421. div#content{padding:0 !important;}
  1422. /* 文章主体,更改距离顶部的marg */
  1423. div.post_crumb{margin: 16px 0 26px !important;}
  1424. /* 文章主体,匹配父布局的宽度 */
  1425. div.post_main{width:100% !important;}
  1426. /* 更改父布局的宽度,适配半屏 */
  1427. div.wrapper{width:${cssWidth(1000)}px !important;max-width:96vw;}
  1428. /* 适配半屏 */
  1429. @media screen and (max-width: ${cssWidth(1000)}px){
  1430. div.post_body {padding: 20px 5px !important;}
  1431. }
  1432. body{min-width:0px !important;}
  1433. /* 底部文章推荐,更改padd */
  1434. .post_recommends.js-tab-mod{padding-left:0px !important;}
  1435. h1.post_title{${cssTitleFontSize2()}${cssTitleBold()}}
  1436. body{${cssPageBg()}}
  1437. ${isRemoveTopbar(`div#js_N_NTES_wrap{display: none !important;}div.post_crumb{display: none !important;}`)}
  1438. ${cssCustom()}
  1439. `;
  1440. GM_addStyle(css1);
  1441. }
  1442.  
  1443. function juejin() {
  1444. // https://article.juejin.cn/post/7156157715230752782
  1445. const css1 = `
  1446. /* 右侧栏,推广 */
  1447. div.sidebar > li{display: none !important;}
  1448. /* 右侧栏,推广 */
  1449. div.sidebar > a{display: none !important;}
  1450. /* 去掉顶栏悬浮 */
  1451. header.main-header{position:absolute !important;}
  1452. /* 左侧栏,去掉悬浮 */
  1453. .article-suspended-panel.dynamic-data-ready{position:absolute !important;}
  1454. /* 文章下面,小册推广 */
  1455. div.category-course-recommend{display: none !important;}
  1456. /* 右侧栏悬浮按钮,觉得还不错,一键收藏 */
  1457. div.guide-collect-popover{display: none !important;}
  1458. /* 文章主体,匹配父布局宽度 */
  1459. .main-area.article-area{width:100% !important;}
  1460. /* 文章父布局,更改宽度,适配半屏窗口 */
  1461. main.main-container{max-width: ${cssWidth(960)}px !important;margin: 0 auto !important;}
  1462. /* 右侧栏悬浮按钮,不参与居中对齐 */
  1463. div.sidebar{margin-right: calc(-25rem - 32px) !important;}
  1464. /* 文章主体,添加阴影 */
  1465. article.article{
  1466. ${cssArticleBg()}
  1467. ${cssShadow()}
  1468. padding: 20px ${cssPagePadd()}px !important;
  1469. }
  1470. /* 底部文章推荐,匹配父布局宽度 */
  1471. .main-area.recommended-area.shadow{width:100% !important;}
  1472. /* 右下角悬浮按钮 */
  1473. .suspension-panel.suspension-panel{display: none !important;}
  1474. /* 登录界面 */
  1475. .login-guide-wrap.login-guide-popup{display: none !important;}
  1476. /* 登录领礼包 */
  1477. div.bottom-login-guide{display:none !important;}
  1478. /* 右侧栏搜索建议 */
  1479. div.jj-search-suggest{display:none !important;}
  1480. /* 右侧栏加群 */
  1481. div.ad-container{display:none !important;}
  1482. /* 右下角悬浮推广,一起。。 */
  1483. div.global-float-banner{display:none !important;}
  1484. h1.article-title{${cssTitleFontSize()}${cssTitleBold()}}
  1485. body{${cssPageBg()}}
  1486. ${isRemoveTopbar(`div.main-header-box{display: none !important;}`)}
  1487. ${cssCustom()}
  1488. `;
  1489. GM_addStyle(css1);
  1490. }
  1491.  
  1492. function juejin2() {
  1493. // s 的网页访问不了了
  1494. const css1 = `
  1495. /* 右下角悬浮推广,一起。。 */
  1496. main.main-container{
  1497. box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;
  1498. padding: 16px 40px !important;
  1499. background-color:#fefefe !important;
  1500. }
  1501. /* 登录界面 */
  1502. .login-guide-wrap.login-guide-popup{display: none !important;}
  1503. /* 登录领礼包 */
  1504. div.bottom-login-guide{display:none !important;}
  1505. `;
  1506. const topBar = `div.main-header-box{display: none !important;}`
  1507. GM_addStyle(shouldRemoveTopbar() ? css1 + topBar : css1);
  1508. }
  1509.  
  1510. function freesion() {
  1511. // https://www.freesion.com/article/43281281735/
  1512. const css1 = `
  1513. /* 文章父布局,更改宽度,更改padd */
  1514. div#wrapper{padding: 0px !important;width: ${cssWidth(960)}px !important;}
  1515. /* 右侧大窗 */
  1516. section#intro{display: none !important;}
  1517. /* 推广 */
  1518. #setupad_750_200_ads{display: none !important;}
  1519. /* 左侧栏,改到右边,不参与居中对齐 */
  1520. section#sidebar{
  1521. float: right !important;
  1522. position: absolute !important;
  1523. width: 0px !important;
  1524. margin-right: -350px !important;
  1525. top: unset !important;
  1526. }
  1527. /* 文章主体,添加阴影,更改padd,更改宽度,更改背景 */
  1528. div#article_content{
  1529. ${cssShadow()}
  1530. padding: 24px ${cssPagePadd()}px !important;
  1531. max-width: 96vw !important;
  1532. ${cssArticleBg()}
  1533. }
  1534. #main > h2 > span{${cssTitleFontSize()}${cssTitleBold()}}
  1535. body{${cssPageBg()}}
  1536. ${isRemoveTopbar(`header#header{display: none !important;} body{padding-top: 10px !important;}`)}
  1537. ${cssCustom()}
  1538. `;
  1539. GM_addStyle(css1);
  1540. }
  1541.  
  1542. function php1() {
  1543. // https://www.php1.cn/detail/Python_ShuJuKeSh_eb129037.html
  1544. const css1 = `
  1545. /* 第二顶栏更改高度 */
  1546. div.top-bar-full-nav{height: 48px !important;}
  1547. /* 第二顶栏内容 */
  1548. div.nav{margin: 7px 0 0 30px !important;}
  1549. /* 顶栏搜索栏 */
  1550. div.nav-rsear{margin-top: 10px !important;}
  1551. /* 右侧栏,热门标签 */
  1552. div.tools{display: none !important;}
  1553. /* 右侧栏,热门文章 */
  1554. div.rank{display: none !important;}
  1555. /* 顶栏logo */
  1556. div.logo{margin-top: 2px !important;}
  1557. /* 文章父布局,调整宽度 */
  1558. div.article_main{
  1559. max-width:${cssWidth(860)}px !important;
  1560. margin-top: 0px !important;
  1561. }
  1562. /* 顶栏logo,缩小尺寸 */
  1563. div.logo > a > img{width: 114px !important;height: 44px !important;}
  1564. /* 使右侧栏,不参与居中 */
  1565. div.article_right{width: 0px !important;margin-right: -30px !important;}
  1566. /* 文章主体,更改宽度,更改padd,添加阴影 */
  1567. div.article_box{
  1568. width:100% !important;
  1569. padding: 0px ${cssPagePadd()}px !important;
  1570. ${cssArticleBg()}
  1571. ${cssShadow()}
  1572. border:unset !important;
  1573. }
  1574. @media screen and (max-width: ${cssWidth(860)}px){
  1575. div.article_box{padding: 0px 4px !important;}
  1576. }
  1577. /* 主体内容,更改宽度,更改marg */
  1578. div.article_title,div.article_info,div.article_intro,div.article_content{margin:0 !important;width: 100% !important;}
  1579. div.article_title > h1{${cssTitleFontSize2()}${cssTitleBold()}}
  1580. body{${cssPageBg()}}
  1581. ${isRemoveTopbar(`div.top-bar-head,div.top-bar-full-nav{display: none !important;}`)}
  1582. ${cssCustom()}
  1583.  
  1584. `;
  1585. GM_addStyle(css1);
  1586. }
  1587.  
  1588. function codeleading() {
  1589. // https://codeleading.com/article/36425823550/
  1590. const css1 = `
  1591. /* 右侧栏推广 */
  1592. .columns.sidebar > div{display:none !important;}
  1593. /* 使右侧栏,不参与居中 */
  1594. .columns.sidebar{width: 280px !important;margin-right: ${-1 * cssPagePadd() -330}px !important;}
  1595. /* 右侧栏,热门文章 */
  1596. .columns.sidebar ul:nth-of-type(2){display:none !important;}
  1597. .columns.sidebar ul:nth-of-type(3){display:none !important;}
  1598. /* 右侧栏,推荐文章 */
  1599. .columns.sidebar h3:nth-of-type(2){display:none !important;}
  1600. .columns.sidebar h3:nth-of-type(3){display:none !important;}
  1601. /* 顶栏推广 */
  1602. div.outterWrapper > .columns > div:nth-child(n+4){display:none !important;}
  1603. /* 底部推广 */
  1604. #footerads{display:none !important;}
  1605. /* 文章推广 */
  1606. #g-before-content-ads{display:none !important;}
  1607. #g-after-content-ads{display:none !important;}
  1608. #below_desc_ads{display:none !important;}
  1609. #g-between-recom-ads{display:none !important;}
  1610. #g-native-ads{display:none !important;}
  1611. #topads{display:none !important;}
  1612. #g-top-ads{display:none !important;}
  1613. #below_title_ads{display:none !important;}
  1614. /* 顶栏标题,更改字号,更改marg */
  1615. div.header-inner > h1{
  1616. font-size:15px !important;
  1617. margin-bottom: 2px !important;
  1618. margin-top: 2px !important;
  1619. }
  1620. /* 主体父布局,更改宽度 */
  1621. .row.outterWrapper{max-width: ${cssWidth(940)}px !important;}
  1622. /* 文章主体,更改宽度 */
  1623. div.content-inner > div.row > div:nth-child(1){width: 100% !important;}
  1624. /* 文章标题,使用粗体 */
  1625. div.content-inner > div.row > div:nth-child(1) > h2:nth-child(1){
  1626. ${cssTitleFontSize()}${cssTitleBold()}
  1627. }
  1628. /* 第二顶栏,调整高度 */
  1629. ul.sf-menu{line-height: 0.5 !important;}
  1630. .top-menu.top-nav{border-bottom: none !important;}
  1631. /* 搜索栏,调整高度 */
  1632. div.content-title-inner{padding: 0 !important;}
  1633. #searchForm > div > input{height: 25px !important;}
  1634. /* 搜索栏,与上面的合并,居右 */
  1635. div.content-title-inner > div.row > div{
  1636. margin-top: -28px !important;
  1637. float: right !important;
  1638. width:auto !important;
  1639. padding-right: 48px !important;
  1640. }
  1641. div.outterWrapper{
  1642. ${cssArticleBg()}
  1643. ${cssShadow()}
  1644. }
  1645. #article_content{max-width:unset !important;}
  1646. /* 文章父布局,调整padd */
  1647. div.content-inner{padding:20px ${cssPagePadd()}px !important;}
  1648. body{${cssPageBg()}}
  1649. ${isRemoveTopbar(`div.outterWrapper > div:nth-child(1){display: none !important;}`)}
  1650. ${cssCustom()}
  1651. `;
  1652. GM_addStyle(css1);
  1653. }
  1654. function manongjc() {
  1655. // 挂掉了
  1656. const css1 = `
  1657. /* 网页背景更改为灰色 */
  1658. body{background:#F5F6F7 !important;}
  1659. /* 页面推广 */
  1660. #article_right_top{display:none !important;}
  1661. #outer-ad-right-sticky-article{display:none !important;}
  1662. #ads_under_title{display:none !important;}
  1663. #article_left_top_banner{display:none !important;}
  1664. #article_left_bottom_banner{display:none !important;}
  1665. .header-ads{display:none !important;}
  1666. /* 页面推广通用匹配 */
  1667. .adsbygoogle , .common_ad_class{display:none !important;}
  1668. /* 本站教程列表 */
  1669. #outer_float_course{display:none !important;}
  1670. /* 随机文章,知识点必读 */
  1671. div.left > div.common{display:none !important;}
  1672. /* 随机文章 */
  1673. div.hot_article{display:none !important;}
  1674. /* 知识点必读 */
  1675. ul.article-tutorial-list{display:none !important;}
  1676. /* 更改顶栏搜索框高度 */
  1677. div.search{height: 48px !important;}
  1678. /* 更改顶栏logo高度 */
  1679. div.logo > a{margin-top: 8px !important;height: 48px !important;}
  1680. /* 更改标题字体大小 */
  1681. div.article-title > h1{font-size: 30px !important;}
  1682. /* 正文匹配父布局宽度 */
  1683. div.left{width: 100% !important;}
  1684. /* 使右侧栏不参与居中 */
  1685. div.right{
  1686. float: none !important;
  1687. margin-left: auto !important;
  1688. margin-right: -308px;
  1689. width:288px !important;
  1690. }
  1691. /* 使正文父布局,可以水平排列子元素 */
  1692. div.main-content{
  1693. overflow: visible !important;
  1694. display: inline-block !important;
  1695. width: 100% !important;
  1696. }
  1697. /* 正文父布局添加阴影,更改宽度,适配更窄窗口 */
  1698. div.page-content{
  1699. width: 965px !important;
  1700. box-shadow: 0 16px 45px rgb(0 0 0 / 15%) !important;
  1701. max-width: 100vw !important;
  1702. }
  1703. /* 顶部导航条,更改宽度 */
  1704. div.menu{width: 965px !important;}
  1705. /* 更改正文的padd */
  1706. div.article-content{padding: 12px 40px !important;}
  1707. /* 更改语言导航栏的按钮间距 */
  1708. div.menu > ul > li > a > b {padding: 0px 3px 0 0 !important;}
  1709. /* 更改顶栏的padd */
  1710. div.header {padding-top: 0 !important;}
  1711. /* 去掉正文的边框样式 */
  1712. div.first-left {border:none !important;}
  1713. `;
  1714. const topBar = `div.header,div.menu{display: none !important;}`
  1715. GM_addStyle(shouldRemoveTopbar() ? css1 + topBar : css1);
  1716. }
  1717.  
  1718. function newqq() {
  1719. // https://new.qq.com/rain/a/20240527A0ABJX00
  1720. const css1 = `
  1721. /* 右侧栏不参与正文居中 */
  1722. div#RIGHT{width:0px !important;}
  1723. div#RIGHT > div{width:300px !important;margin-left: ${cssPagePadd() + 30}px !important;}
  1724. /* 右侧栏去掉悬浮 */
  1725. .right-sticky{position:absolute !important;}
  1726. /* 更改正文父布局宽度 */
  1727. div.LEFT{width:100% !important;}
  1728. /* 更改正文宽度 */
  1729. div.content-article{width:100% !important;}
  1730. /* 更改正文宽度,添加阴影,适配半屏,更改padd */
  1731. .qq_conent.clearfix{
  1732. width:${cssWidth(960)}px !important;
  1733. max-width:85vw !important;
  1734. ${cssArticleBg()}
  1735. ${cssShadow()}
  1736. padding:0px ${cssPagePadd()}px !important;
  1737. }
  1738. /* 去掉左侧栏悬浮 */
  1739. div#LeftTool{position: absolute !important;margin-left: ${-1 * cssPagePadd() -90}px;}
  1740. /* 去掉右侧栏悬浮 */
  1741. div.sticky{position: static !important;}
  1742. div.content-article > h1{${cssTitleFontSize2()}${cssTitleBold()}}
  1743. body{${cssPageBg()}}
  1744. ${isRemoveTopbar(`div#TopNav{display:none !important;}body{padding-top:16px !important;}`)}
  1745. ${cssCustom()}
  1746. `;
  1747. GM_addStyle(css1);
  1748. }
  1749.  
  1750. function bilibili() {
  1751. // https://www.bilibili.com/read/cv25383802/?from=search
  1752. const css1 = `
  1753. /* 正文添加阴影 */
  1754. div.article-container{
  1755. ${cssArticleBg()}
  1756. ${cssShadow()}
  1757. max-width:95vw !important;
  1758. }
  1759. div.article-detail{width: ${cssWidth(900)}px !important;}
  1760. /* 右下栏去掉悬浮 */
  1761. div.right-side-bar{position: absolute !important;bottom: unset !important;top:50px !important;}
  1762. /* 去掉多余padd */
  1763. div#article-content{padding:0 ${cssPagePadd()}px !important;}
  1764. div.article-container{padding:0 !important;}
  1765. h1.title{
  1766. padding-top:12px;
  1767. ${cssTitleFontSize()}
  1768. ${cssTitleBold()}
  1769. }
  1770. body,html{${cssPageBg()}}
  1771. div.right-side-bar{margin-left:-80px !important;}
  1772. ${isRemoveTopbar(`div.z-top-container,div.fixed-top-header{display:none !important;}`)}
  1773. ${cssCustom()}
  1774. `;
  1775. GM_addStyle(css1);
  1776. //img.normal-img{height:unset !important;width:unset !important;}
  1777. }
  1778.  
  1779. function zhidao() {
  1780. // https://zhidao.baidu.com/question/943240055513013812.html
  1781. const css1 = `
  1782. /* 正文 */
  1783. article{
  1784. width:100% !important;
  1785. min-width:0px !important;
  1786. padding:0px 0px !important;
  1787. border-right:unset !important;
  1788. }
  1789. /* 更改标题字体大小 */
  1790. span.ask-title{
  1791. ${cssTitleFontSize2()}${cssTitleBold()}
  1792. }
  1793. /* 更改正文父布局宽度,适配半屏,添加阴影 */
  1794. div.layout-wrap{
  1795. max-width:94vw !important;
  1796. width:${cssWidth(800)}px !important;
  1797. ${cssArticleBg()}
  1798. ${cssShadow()}
  1799. padding:0px ${cssPagePadd()}px !important;
  1800. }
  1801. @media screen and (max-width: ${cssWidth(800)}px){
  1802. div.layout-wrap{padding:0px 4px !important;}
  1803. }
  1804. div.wgt-answers{${cssArticleBg()}}
  1805. /* 更改正文父布局宽度 */
  1806. #body{width: auto !important;}
  1807. /* 免费咨询律师 */
  1808. #wgt-lvlin-bottom{display:none !important;}
  1809. body,html{${cssPageBg()}}
  1810. ${cssCustom()}
  1811. `;
  1812. GM_addStyle(css1);
  1813. }
  1814.  
  1815. function doc360() {
  1816. // http://www.360doc.com/content/23/0406/09/22873936_1075294456.shtml
  1817. const css1 = `
  1818. /* 正文添加阴影 */
  1819. div#bgchange{
  1820. ${cssArticleBg()}
  1821. ${cssShadow()}
  1822. padding:20px ${cssPagePadd()}px !important;
  1823. width:${cssWidth(960) - cssPagePadd() * 2}px !important;
  1824. max-width:95vw !important;
  1825. }
  1826. /* 使右侧栏不参与居中 */
  1827. .a_right{width:0px !important;}
  1828. #rightfixed{
  1829. margin-left:24px !important;
  1830. width:300px !important;}
  1831. @media screen and (max-width: ${cssWidth(960)}px){
  1832. div#bgchange{padding:20px 4px !important;}
  1833. }
  1834. /* 屏蔽登录窗口、左侧二维码、右下悬浮栏 */
  1835. iframe#registerOrLoginLayer,.floatqrcode,#goTop2,#goTop{display:none !important;}
  1836. .vipact,#divad,#divad2,#divad3,#divad4,#divad5,#divad6{display:none !important;}
  1837. /* 更改正文宽度,适配半屏 */
  1838. div.a_left{
  1839. margin-left:unset !important;
  1840. margin-right:unset !important;
  1841. width:100% !important;
  1842. }
  1843. div.doc360article_content{
  1844. width:${cssWidth(960)}px !important;
  1845. max-width:95vw !important;
  1846. }
  1847. #artContent > div:nth-child(1){width: unset !important;}
  1848. img,#artContent{
  1849. min-width:unset !important;
  1850. max-width:100% !important;
  1851. }
  1852. #articlecontent > table{
  1853. width:100% !important;
  1854. }
  1855. #GLTitile{${cssTitleFontSize2()}${cssTitleBold()}}
  1856. body{${cssPageBg()}}
  1857. ${isRemoveTopbar(`div.atfixednav,div.header{display:none !important;}div#bgchange{margin-top: -66px;}`)}
  1858. ${cssCustom()}
  1859. `;
  1860. GM_addStyle(css1);
  1861. }
  1862.  
  1863. function wenkucsdn() {
  1864. // https://wenku.csdn.net/answer/b650e75d4cd2432298ff235fe1c9d072
  1865. const css1 = `
  1866. /* 正文添加阴影 */
  1867. div.layout-center > div.main{
  1868. ${cssArticleBg()}
  1869. ${cssShadow()}
  1870. }
  1871. /* 更改正文宽度 */
  1872. div.layout-center{max-width:98vw !important;}
  1873. .layout-center{width:${cssWidth(1030)}px !important;}
  1874. div.article-box{padding: 00px ${cssPagePadd()}px !important;}
  1875. /* 使右侧栏不参与居中 */
  1876. div.layout-right{width:0px !important;}
  1877. /* 更改标题字体大小 */
  1878. h1.title{${cssTitleFontSize()}${cssTitleBold()}}
  1879. body, html {min-width: 0px !important;}
  1880. /* 正文居中,适配半屏 */
  1881. div#chatgpt-article-detail{display:-webkit-box !important;}
  1882. /* 顶栏广告 */
  1883. div.top-bar{display:none !important;}
  1884. #chatgpt-article-detail{${cssPageBg()}}
  1885. ${isRemoveTopbar(`div#csdn-toolbar{display:none !important;}`)}
  1886. ${cssCustom()}
  1887. `;
  1888. GM_addStyle(css1);
  1889. }
  1890. function jingyan() {
  1891. // https://jingyan.baidu.com/article/3c343ff713fcf24c377963a6.html
  1892. const css1 = `
  1893. /* 右下角栏调整位置 */
  1894. #wgt-exp-share,#wgt-barrier-free{margin-right: -100px;}
  1895. /* 红包任务、通知消息数去掉悬浮 */
  1896. .task-panel-list,.task-panel-entrance,.msg-container{position: absolute !important;}
  1897. /* 更改正文父布局宽度 */
  1898. div.content-container{width:${cssWidth(800)}px !important;max-width: 93vw;}
  1899. /* 正文添加阴影,更改正文宽度 */
  1900. div.main-content{
  1901. ${cssArticleBg()}
  1902. ${cssShadow()}
  1903. padding: 0px ${cssPagePadd()}px 0px !important;
  1904. width:100% !important;
  1905. }
  1906. /* 适配半屏 */
  1907. @media screen and (max-width: ${cssWidth(800) + 100}px){
  1908. div.main-content{padding: 0px 5px 0px !important;}
  1909. }
  1910. /* 更改标题字体大小 */
  1911. span.title-text{${cssTitleFontSize()}${cssTitleBold()}}
  1912. /* 适配半屏 */
  1913. body {min-width: 0px !important;}
  1914. /* 设置点赞栏离正文远一点,并去掉悬浮 */
  1915. div.wgt-like{margin-left:-70px;position: absolute;}
  1916. body{${cssPageBg()}}
  1917. ${isRemoveTopbar(`header,nav.nav,div.breadcrumb{display:none !important;}`)}
  1918. ${cssCustom()}
  1919. `;
  1920. GM_addStyle(css1);
  1921. }
  1922. function iasksina() {
  1923. // https://iask.sina.com.cn/b/iRgaLddSbxjB.html
  1924. const css1 = `
  1925. /* 右侧栏没啥用,隐藏 */
  1926. div#detail_right_xf{display:none !important;}
  1927. /* 右侧栏去掉悬浮 */
  1928. div.addfix{position: absolute !important;}
  1929. /* 更改正文父布局宽度 */
  1930. div.w680 {width:100% !important;}
  1931. /* 更改正文父布局宽度 */
  1932. div.pw {width:${cssWidth(860)}px !important;max-width:93vw;}
  1933. /* 正文添加阴影,更改正文宽度 */
  1934. div.iask-detail-curt{
  1935. ${cssArticleBg()}
  1936. ${cssShadow()}
  1937. padding: 0px !important;
  1938. width:100% !important;
  1939. }
  1940. .detail-answer-item{${cssArticleBg()}}
  1941. /* 答案卡片添加padd */
  1942. ul.detail-answer-list {padding: 0 40px;}
  1943. /* 适配半屏 */
  1944. @media screen and (max-width: 850px){
  1945. ul.detail-answer-list {padding: 0 5px;}
  1946. }
  1947. /* 更改标题字体大小 */
  1948. p.problem-title-text{${cssTitleFontSize2()}${cssTitleBold()}}
  1949. /* 适配半屏 */
  1950. body {min-width: 0px !important;}
  1951. /* 右下栏去掉悬浮 */
  1952. div.iask-mui-right{position: absolute;}
  1953. body{${cssPageBg()}}
  1954. ${isRemoveTopbar(`div.crumb,div.detail-header,div.top-bar{display:none !important;}`)}
  1955. ${cssCustom()}
  1956. `;
  1957. GM_addStyle(css1);
  1958. }
  1959. function mbd() {
  1960. // https://mbd.baidu.com/newspage/data/dtlandingsuper?nid=dt_3188205064148630303
  1961. const css1 = `
  1962. /* 增加正文行高 */
  1963. span.index-module_forwardWrapper_10-LF{
  1964. line-height: 28px;
  1965. font-size: 18px;
  1966. }
  1967. /* 右侧栏不参与居中 */
  1968. div.app-module_rightSection_bgA0C{margin-right: -390px;}
  1969. /* 更改正文父布局宽度,去掉padd */
  1970. div.app-module_leftSection_2GBVu{
  1971. width:100% !important;
  1972. padding-left:unset !important;
  1973. padding-right:unset !important;
  1974. }
  1975. /* 更改正文父布局宽度,适配半屏 */
  1976. div.app-module_articleWrapper_32Vny{width:${cssWidth(860)}px !important;max-width:93vw;}
  1977. /* 正文添加阴影,更改padd */
  1978. div.index-module_articleContainer_32gOp{
  1979. ${cssArticleBg()}
  1980. ${cssShadow()}
  1981. padding: 0px ${cssPagePadd()}px !important;
  1982. margin-bottom:40px;
  1983. }
  1984. /* 适配半屏 */
  1985. @media screen and (max-width: ${cssWidth(860) - 160}px){
  1986. div.index-module_articleContainer_32gOp {padding: 0 5px !important;}
  1987. }
  1988. body{${cssPageBg()}}
  1989. ${isRemoveTopbar(`div.app-module_topbarWrapper_2A357{display:none !important;}div.app-module_contentWrapper_12u0y{padding-top: 0px;}`)}
  1990. ${cssCustom()}
  1991. `;
  1992. GM_addStyle(css1);
  1993. }
  1994.  
  1995. /** 把 br 标签换成 hr 标签,增加段落间距离 */
  1996. function replaceBrWithHr(element) {
  1997. // 获取目标元素内的所有 <br> 标签
  1998. const brs = element.getElementsByTagName("br");
  1999.  
  2000. // 使用 while 循环从后往前遍历替换 <br> 标签,避免顺序替换产生错误
  2001. while (brs.length > 0) {
  2002. // 创建 <hr> 标签
  2003. const hr = document.createElement("hr");
  2004. hr.style.border = "none";
  2005. hr.style.height = "5px";
  2006. // 替换 <br> 为 <hr>
  2007. brs[0].parentNode.replaceChild(hr, brs[0]);
  2008. }
  2009. }
  2010. })();