게시판 » 제작 요청

求一个bing搜索居中的脚本

§
작성: 2022-06-30

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

NotYou관리자
§
작성: 2022-07-01

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

§
작성: 2022-07-01

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

NotYou관리자
§
작성: 2022-07-04

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

NotYou관리자
§
작성: 2022-07-04

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.

댓글 남기기

댓글을 남기려면 로그인하세요.