Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

can sites detect javascript executions on consoles?

Im building a bot and im wondering whether if its even possible for sites to detect javascript executions on the console. For example for a certain site the bot needs to add the item to cart and I do this

document.getElementsByClassName('w_C8 w_DA w_DF')[0].click()

through the bot will sites be able to detect that it wasn’t an actual human clicking or will they automatically now it was code run to click the button

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes they will be able to detect that, because click event contains more than just an information that it have been clicked, for example coordinates of a mouse pointer. You can check that yourself by defining onclick function, for example:

document.body.onclick = function(e){console.log(e));
document.body.click();

Now click and check the difference in console.

In onclick event object there is also a direct notification if it was actually clicked, or triggered:

e.isTrusted: false // clicked automatically
e.isTrusted: true // real click

Does anybody actually check that? Most sites surely don’t.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading