Skip to content

Instantly share code, notes, and snippets.

@aeongdesu
Created September 21, 2023 03:07
Show Gist options
  • Save aeongdesu/2b11363b93557adbb56e39f84cad9e0b to your computer and use it in GitHub Desktop.
Save aeongdesu/2b11363b93557adbb56e39f84cad9e0b to your computer and use it in GitHub Desktop.
prevent colab inactive session (from ai hub)
function ClickConnect() {
console.log("Working")
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
setInterval(ClickConnect, 60000)
// Run this function to prevent the robot prompt when it appears
function preventRobotPrompt() {
// Disable the robot prompt function
const oldPromptFunction = window.showConnectMoreButton
window.showConnectMoreButton = () => {}
// Re-enable the robot prompt after a delay (optional)
setTimeout(() => {
window.showConnectMoreButton = oldPromptFunction
}, 300000) // After 5 minutes (adjust the time as needed)
}
preventRobotPrompt()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment