Last active
March 7, 2025 09:22
-
-
Save asukaminato0721/0b37ba8e2fb1f2d793a7b7c3ed50529d to your computer and use it in GitHub Desktop.
auto enable tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto enable tools | |
// @namespace Violentmonkey Scripts | |
// @match https://aistudio.google.com/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description 1/29/2025, 7:43:30 PM | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function setAriaCheckedTrueForGrounding() { | |
if(window.location.href.includes("new_chat")){ | |
document.querySelector('button[role="switch"][aria-label="Grounding with Google Search"][aria-checked="false"]' | |
)?.click(); | |
} | |
if(window.location.href.includes("live")){ | |
document.querySelector('button[role="switch"][aria-label="Grounding with Google Search"][aria-checked="false"]' | |
)?.click(); | |
document.querySelector('button[role="switch"][aria-label="Code Execution"][aria-checked="false"]' | |
)?.click(); | |
document.querySelector('button[role="switch"][aria-label="Function calling"][aria-checked="false"]' | |
)?.click(); | |
document.querySelector('button[role="switch"][aria-label="Automatic Function Response"][aria-checked="false"]' | |
)?.click(); | |
} | |
} | |
// Run immediately and on DOM changes | |
setAriaCheckedTrueForGrounding(); | |
const observer = new MutationObserver(setAriaCheckedTrueForGrounding); | |
observer.observe(document.body, { childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment