Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I'm using a Chrome extension. Is it possible to disable this script when I go back in the application or browser?

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





Thanks very much!

What I have tried:

I tried in vain this feature, however deprecated:

JavaScript
if (performance.navigation.type != 2)
{  clickme = document.querySelector('[title="Stampa etichette"]');
  if (clickme) {clickme.click()};
}
Posted
Updated 21-Dec-22 0:57am
v5
Comments
Parvares 21-Dec-22 7:33am    
I tried:

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

but by going back the page reruns the script and reclicks the print button, without stopping

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900