Greasy Fork

Baidu/Google搜索界面优化(AC-baidu-重定向双列优化)

此脚本为"AC-baidu-重定向双列优化"的样式增强脚本,使用本脚本前需安装"AC-baidu-重定向双列优化"。

当前为 2024-01-18 提交的版本,查看 最新版本

// ==UserScript==
// @name         Baidu/Google搜索界面优化(AC-baidu-重定向双列优化)
// @namespace    ouka2020
// @description  此脚本为"AC-baidu-重定向双列优化"的样式增强脚本,使用本脚本前需安装"AC-baidu-重定向双列优化"。
// @author       Ouka2020
// @match        *://ipv6.baidu.com/*
// @match        *://www.baidu.com/*
// @match        *://www1.baidu.com/*
// @match        *://encrypted.google.com/search*
// @match        *://*.google.com/search*
// @match        *://*.google.com/webhp*
// @exclude      *://*.google.com/sorry*
// @exclude      *://zhidao.baidu.com/*
// @exclude      *://*.zhidao.baidu.com/*
// @updateNote   v0.6.11 修正Google搜索无结果。
// @updateNote   v0.6.10 修改黑暗模式下,Google文字块底色为白色的问题。
// @grant        GM_addStyle
// @version      0.6.11
// @license      GPL-3.0-or-later
// ==/UserScript==

/* Created by TPMK(ver 1.0.0) at 2024/1/18 20:07:16 */

(function () {
  'use strict';

  const googleCss = "#main #cnt,\n#cnt #center_col,\n#cnt #foot {\n  width: 95vw !important;\n  margin: 2px 12px !important;\n}\n\n#rso > div:not(.g) {\n  grid-template-columns: unset;\n  grid-template-areas: unset;\n}\n\n@media (prefers-color-scheme: dark) {\n  #rso .g {\n    filter: invert(1) hue-rotate(180deg);\n  }\n  #rso .g img {\n    filter: invert(1) hue-rotate(180deg);\n  }\n}";

  const baiduCss = "body #container.sam_newgrid #content_left {\n  width: 96vw;\n}";

  if (/google/.test(window.location.host)) {
    GM_addStyle(googleCss);
  }
  if (/baidu/.test(window.location.host)) {
    GM_addStyle(baiduCss);
  }
})();