Correct javascript generates problems

Joined
Dec 31, 2022
Messages
12
Reaction score
1
Hi, I'm using a Chrome extension. I have a problem with this (saved) page:

https://miospaziodigitale.w3spaces.com/lista_report.html#

This script autoclicks the first print item of the list in "Description" (that is, in the example, "Stampa etichetta - inv. : 59949"),

JavaScript:
(() => {
  var links = document.querySelectorAll("a[href='#']");
  for(let i=0; i<links.length; i++){
    var text = links[i].innerHTML;
    if(text.includes("Stampa etichetta")) {
      links[i].click();
break;
    }
 }
})();

The autoclick correctly opens this kind of window:

https://polormb.sebina.it/sebina/ge...e/stpEtiColloc1672484520087_01.pdf?id=3873631

The problem is that this window also opens (but shouldn't) when I select and delete (top right) an item from the "Descrizione" list, as in this example:


Is it possible to fix the script to avoid this effect? Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top