您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide/Show toolbar and header in Google AI Studio
// ==UserScript== // @name Google AI Studio UI Tweak // @namespace https://nancex.me/ // @version 1.0.1 // @description Hide/Show toolbar and header in Google AI Studio // @author Nancex // @match https://aistudio.google.com/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @license GPL-3.0 // ==/UserScript== (function() { 'use strict'; const style = document.createElement('style'); style.textContent = ` body.hide-ui .toolbar-container, body.hide-ui .header-container { display: none !important; } `; document.head.appendChild(style); document.body.classList.add('hide-ui'); const addToggleButtons = () => { const togglesContainer = document.querySelector('.toggles-container'); if (togglesContainer && !togglesContainer.querySelector('.toggle-ui-button')) { const existingButton = togglesContainer.querySelector('button'); if (!existingButton) return; const toggleButton = existingButton.cloneNode(true); toggleButton.classList.add('toggle-ui-button'); toggleButton.classList.remove('right-side-panel-button-highlight'); const icon = toggleButton.querySelector('.material-symbols-outlined'); const updateButtonState = () => { if (document.body.classList.contains('hide-ui')) { toggleButton.setAttribute('aria-label', 'Show UI'); toggleButton.setAttribute('mattooltip', 'Show UI'); icon.textContent = 'visibility'; } else { toggleButton.setAttribute('aria-label', 'Hide UI'); toggleButton.setAttribute('mattooltip', 'Hide UI'); icon.textContent = 'visibility_off'; } }; toggleButton.addEventListener('click', () => { document.body.classList.toggle('hide-ui'); updateButtonState(); }); updateButtonState(); togglesContainer.appendChild(toggleButton); } }; const observer = new MutationObserver(addToggleButtons); observer.observe(document.body, { childList: true, subtree: true }); // Initial check in case the element is already there addToggleButtons(); })();