Greasy Fork is available in English.

Discuții » Cerere de creare

求一个bing搜索居中的脚本

§
Postat în: 30-06-2022

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

NotYouMod
§
Postat în: 01-07-2022

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

§
Postat în: 01-07-2022

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)
})();
这样吗?

NotYouMod
§
Postat în: 04-07-2022

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*.

NotYouMod
§
Postat în: 04-07-2022

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.

Postează un raspuns

Autentifică-te pentru a posta un răspuns.