Last active
August 18, 2025 01:35
-
-
Save scarf005/fddcef68aefaba19bb512cc8a9258cf8 to your computer and use it in GitHub Desktop.
force enables URL context in aistudio.google.com because some forsaken reason it's not enabled by default
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 aistudio search and URL context always ON | |
// @namespace https://github.com/scarf005 | |
// @version 1.1 | |
// @description force enables web search in aistudio.google.com because some forsaken reason it's not enabled by default | |
// @author scarf005 | |
// @match https://aistudio.google.com/* | |
// @homepageURL https://gist.github.com/scarf005/fddcef68aefaba19bb512cc8a9258cf8 | |
// @supportURL https://gist.github.com/scarf005/fddcef68aefaba19bb512cc8a9258cf8 | |
// @downloadURL https://gist.github.com/scarf005/fddcef68aefaba19bb512cc8a9258cf8/raw/aistudio-urlcontext-on.user.js | |
// @grant none | |
// ==/UserScript== | |
const ids = ["searchAsAToolTooltip", "browseAsAToolTooltip"] | |
const enableSearch = () => { | |
ids.forEach(id => { | |
const toggleButton = document.querySelector(`[data-test-id="${id}"] button[role="switch"][aria-checked="false"]`) | |
toggleButton?.click() | |
}) | |
} | |
const observer = new MutationObserver(enableSearch) | |
observer.observe(document.body, { childList: true, subtree: true }) | |
enableSearch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment