Skip to content

Instantly share code, notes, and snippets.

@patharanordev
Created March 8, 2021 14:54
Show Gist options
  • Save patharanordev/68acd5b5fa7d80f298dc4e1301ec38a0 to your computer and use it in GitHub Desktop.
Save patharanordev/68acd5b5fa7d80f298dc4e1301ec38a0 to your computer and use it in GitHub Desktop.
To prevent CoLab's session loss

Long run CoLab

In CoLab, press (CTRL + SHIFT + i) to open inspect window. Go to console tab then press source code below and press enter :

function ClickConnect(){
console.log("Working"); 
document
  .querySelector('#top-toolbar > colab-connect-button')
  .shadowRoot.querySelector('#connect')
  .click() 
}
setInterval(ClickConnect,60000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment