您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to change the background color of Google search page on click
当前为
// ==UserScript== // @name Change Background Color for Google // @version 1.0 // @description Adds a button to change the background color of Google search page on click // @match *://www.google.com/* // @license MIT // @namespace https://gf.qytechs.cn/users/1129625 // ==/UserScript== (function() { // Create the button element var button = document.createElement('button'); button.textContent = 'Change Color'; button.style.position = 'relative'; button.style.marginLeft = '10px'; // Find the Store button var storeButton = document.querySelector('[aria-label="Google apps"]'); // Insert the button next to the Store button storeButton.parentNode.insertBefore(button, storeButton.nextSibling); // Add click event listener to change the background color button.addEventListener('click', function() { var color = prompt("Select a color:\n1. Blue\n2. Red\n3. Green\n4. Yellow\n5. Purple\n6. Orange\n7. Pink\n8. Teal\n9. Gray\n10. Brown\n11. Custom RGB"); switch (color) { case "1": document.body.style.backgroundColor = 'blue'; break; case "2": document.body.style.backgroundColor = 'red'; break; case "3": document.body.style.backgroundColor = 'green'; break; case "4": document.body.style.backgroundColor = 'yellow'; break; case "5": document.body.style.backgroundColor = 'purple'; break; case "6": document.body.style.backgroundColor = 'orange'; break; case "7": document.body.style.backgroundColor = 'pink'; break; case "8": document.body.style.backgroundColor = 'teal'; break; case "9": document.body.style.backgroundColor = 'gray'; break; case "10": document.body.style.backgroundColor = 'brown'; break; case "11": var rgbColor = prompt("Enter a custom RGB value (e.g., 'rgb(255, 0, 0)'):"); document.body.style.backgroundColor = rgbColor; break; default: alert("Invalid selection. Please choose a valid option."); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址