Skip to content

Instantly share code, notes, and snippets.

@gu-ma
Last active June 24, 2021 10:43
Show Gist options
  • Save gu-ma/4c19e179c27b6d5769e0edb1e2fee846 to your computer and use it in GitHub Desktop.
Save gu-ma/4c19e179c27b6d5769e0edb1e2fee846 to your computer and use it in GitHub Desktop.
Keep colab active (paste in the console)
// Start
let keepActive = setInterval(()=>{
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
setTimeout(()=> {
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
}, 5000);
}, 60000)
// Stop
clearInterval(keepActive)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment