Обсуждения » Хотелки

求一个bing搜索居中的脚本

现在结果都是靠左边显示,求一个居中的。谢谢有大神能提供。

Easy-peasy:

let style = document.createElement('style')
style.textContent =  `
#b_content {
  display: grid;
  place-content: center;
}`
document.head.appendChild(style)

Program to make Bing search result in center.
Centered Bing Search (c) 2022 NotYou
License - GNU General Public License 3.0 only

Easy-peasy:

let style = document.createElement('style')
style.textContent =  `
#b_content {
  display: grid;
  place-content: center;
}`
document.head.appendChild(style)


Program to make Bing search result in center.

Centered Bing Search (c) 2022 NotYou

License - GNU General Public License 3.0 only

// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://cn.bing.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant none
// ==/UserScript==

(function() {
let style = document.createElement('style')
style.textContent = `
#b_content {
display: grid;
place-content: center;
}`
document.head.appendChild(style)
})();
这样吗?

Easy-peasy:

let style = document.createElement('style')
style.textContent =  `
#b_content {
  display: grid;
  place-content: center;
}`
document.head.appendChild(style)


Program to make Bing search result in center.

Centered Bing Search (c) 2022 NotYou

License - GNU General Public License 3.0 only

// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://cn.bing.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant none
// ==/UserScript==

(function() {
let style = document.createElement('style')
style.textContent = `
#b_content {
display: grid;
place-content: center;
}`
document.head.appendChild(style)
})();
这样吗?

You better use something like that match to make sure that script will match in http, and also other languages: // @match ://*bing.com*.

Also, I don't think you need to use SEAF (Self Executing Anonymous function) to make script work, but if it's more readable for you like that, you can use it.

Ответить

Войдите, чтобы ответить.