Autoclick on print confirmation – JavaScript – SitePoint Forums


Share post:

Hi, from a Chrome extension I would like to auto-click on (print) confirmation but this script partially works:

  labels = document.querySelectorAll('label');
  if (labels[1].innerText == "Modello di stampa")
  {document.getElementsByClassName("button confirm")[0].click();}

Because the page refreshes repeatedly. Could you help me please? Thank you
Here is the saved static page (the site is restricted):

FYI, the script for the “report” click (third small icon at the top from right to left) is identical but works well and without repetitions because it links to the next page and not to the same page:

  labels = document.querySelectorAll('label');
  if (labels[1].innerText == "Modello di stampa")

Can I do something to avoid repeating clicks in the first script? Thanks

Source link


Please enter your comment!
Please enter your name here

Related articles

DEC addresses new semi-automatic gun laws – Oneida Dispatch

New York State recently adopted new requirements for the purchase and transfer of ownership of semi-automatic rifles...

What Your Business Get from Partnering With Prodev Solutions

Florida in the US has many top software development companies. Yet businesses find it tough to hire...

Online car sales platform Carwow sheds a fifth of staff

Carwow, the largest online new car sales portal in the UK, Germany and Spain, has cut about...

U.K. shares higher at close of trade; United Kingdom 100 up 0.31% – U.K. equities were higher at the close on Friday, as gains in the , ...