每日闲逛吾爱破解发现发现有人求脚本:
https://www.52pojie.cn/thread-2003050-1-1.html
就是让百度首页底部的关注栏变宽,简单的CSS修改一下就可以
用的框架为vite-plugin-monkey : https://github.com/lisonge/vite-plugin-monkey
最后打包后的代码如下:
// ==UserScript==
// @name make-baidu-weightify
// @namespace npm/vite-plugin-monkey
// @version 0.0.0
// @author monkey
// @icon https://vitejs.dev/logo.svg
// @match https://www.baidu.com/
// @require https://cdn.jsdelivr.net/npm/vue@3.5.13/dist/vue.global.prod.js
// ==/UserScript==
(function () {
'use strict';
(function() {
function init() {
const mainElement = document.getElementById("s_main");
if (mainElement) {
mainElement.classList.remove("c-wrapper-hot-news-all");
}
const styleElement = document.createElement("style");
styleElement.textContent = `
.san-card > div {
width: 100% !important;
}
.site-wrapper > div {
width: 100% !important;
}
.site-wrapper > div > div {
width: 100% !important;
}
`;
document.head.appendChild(styleElement);
}
console.log("baidu-weightify");
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();
})();
引用:
1.【轻松上手】油猴脚本开发:https://juejin.cn/post/7022654292880424991#heading-13
2.油猴脚本开发指南教程目录:https://bbs.tampermonkey.net.cn/thread-184-1-1.html
评论 (0)