function getElementByXpath(path) {
return document.evaluate(path, document, null,
XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
function reconnect(){
console.log('working')
getElementByXpath("//div[@id='top-toolbar']/colab-connect-button").shadowRoot.querySelector('#connect').click()
}
var a = setInterval(reconnect, 1*60*1000);
function stop(){
clearInterval(a)
}
function start(){
a = setInterval(reconnect, 1*60*1000);
}
Colab防止断线2021.3
最新推荐文章于 2023-03-21 15:33:40 发布