Created
September 21, 2023 03:07
-
-
Save aeongdesu/2b11363b93557adbb56e39f84cad9e0b to your computer and use it in GitHub Desktop.
prevent colab inactive session (from ai hub)
This file contains 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
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
https://discord.com/channels/1089076875999072296/1125169728260931675/1150128414724997150