谷歌google居中
这个是能凑活用的篡改猴脚本,用于让google搜索居中显示。
为什么是凑活用呢?因为刷新一下就乱了。
然而,一般情况下,我们使用谷歌的时候,搜索后不太会刷新,所以没啥影响。
// ==UserScript==
// @name 谷歌居中
// @namespace http://tampermonkey.net/
// @version 1.3.1
// @description Center the Google search results.
// @author GDUFXRT
// @match https://www.google.com/search*
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
var style = document.createElement('style');
var cssStyle = `@media(min-width:1410px) {
#extabar {display: flex; justify-content: left;}
#slim_appbar {
width: 1280px; /* 宽度 */
margin-left: auto !important; /* 左外边距自动,!important 确保覆盖其他规则 */
margin-right: auto !important; /* 右外边距自动,!important 确保覆盖其他规则 */
box-sizing: border-box;
display: flex;
justify-content: center; /* 内部元素居中 */
}
#searchform .tsf {margin: 0 auto;}
.MUFPAc {margin-left: 0;} /* 注意:如果上面的修改无效,这个也可能需要调整 */
.mw {margin: 0 auto;}
#fbar {text-align: center;}
.GyAeWb {display: flex; justify-content: space-around;}
#main {display: flex; justify-content: center;}
#topabar {max-width: 1197px; margin: 0 auto; min-width: 1100px;}
.GLcBOb {justify-content: center; display: flex;}
.D6j0vc {width: auto;}
}`;
style.innerText = cssStyle;
document.querySelector('head').appendChild(style);
})();
