Stop/interrupt the scraping process if i'm logged out of a website with javascript

is it possible to stop/kill the scraping process with javascript and how to do it ?

i want to avoid to be banned from a website (already banned twice) when i got disconnected after the session timeout or the daily disconnect from the server and for that i need to stop the scraping instantly if the first requests with disconnect status occurs, i need to do it in a javascript function with tampermonkey

i don't want to log in back since it uses captcha and two factor authentification, i juste want to avoid to be ban because the scrapper still sending requests when i'm logged out from the website