Disable javascript when going back

Joined
Dec 16, 2022
Messages
4
Reaction score
0
Hello, I'm using a Chrome extension. is it possible to disable this script when I go back in the application or browser?

clickme = document.querySelector('[title="Stampa etichette"]');
if (clickme) {clickme.click()};


I tried in vain this feature, however deprecated:


if (performance.navigation.type != 2)
{ clickme = document.querySelector('[title="Stampa etichette"]');

if (clickme) {clickme.click()};
}


Thanks very much!
 
Hi. I just tested the code in Chrome and it works.

"2" means that the click event will happen every time unless the page was accessed by navigating into the history, like you said.
 
Back
Top