全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 788|回复: 2
打印 上一主题 下一主题

谷歌搜索全部显示在左边的解决方法

[复制链接]
跳转到指定楼层
1#
发表于 2021-9-23 03:20:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
之前看到帖子说信息都跑到左侧。原帖没找到。方法查了下,强迫症的人可以参考下
https://www.reddit.com/r/chrome/comments/mr4ned/google_search_shifted_all_the_way_to_the_left/

tampermonkey

-----------------------------

// ==UserScript==
// @name         faster google left margin
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  adds left margin to google.com search results
// @author       You
// @match        https://www.google.com/search*
// @exclude      https://www.google.com/search*&tbm=nws*
// @icon         https://www.google.com/s2/favicons?domain=google.com
// @grant        none
// ==/UserScript==

    /*globals $*/
    var top_nav = document.getElementById("top_nav"); top_nav.setAttribute("style", "margin-left:152px;");
    var slim_appbar = document.getElementById("slim_appbar"); slim_appbar.setAttribute("style", "margin-left:332px;");
    var center_col = document.getElementById("center_col"); center_col.setAttribute("style", "margin-left:332px;");
    var rhs = document.getElementById("rhs"); rhs.setAttribute("style", "margin-left:1047px;");


-----------------------------
2#
发表于 2021-9-23 05:02:51 | 只看该作者
虽然看不懂,但是还是很谢谢
3#
发表于 2021-9-23 09:10:13 | 只看该作者
嘎,没有遇到过这种情况,另外你这四行代码完全可以合并为一行代码:
  1. // ==UserScript==
  2. // [url=home.php?mod=space&uid=5839]@name[/url]         faster google left margin
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  adds left margin to google.com search results
  6. // @author       You
  7. // @match        https://www.google.com/search*
  8. // @exclude      https://www.google.com/search*&tbm=nws*
  9. // @icon         https://www.google.com/s2/favicons?domain=google.com
  10. // @run-at       document-start
  11. // @grant        none
  12. // ==/UserScript==

  13. (function() {
  14. 'use strict';
  15.     document.lastElementChild.appendChild(document.createElement('style')).textContent = '#top_nav {margin-left:152px !important;} #slim_appbar, #center_col {margin-left:332px !important;} #rhs {margin-left:1047px !important;}';
  16. })();
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-10-3 00:43 , Processed in 0.058331 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表