Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthetic Clicks Now Allowed? #6553

Open
abrdgrt opened this issue Jan 16, 2024 · 4 comments
Open

Synthetic Clicks Now Allowed? #6553

abrdgrt opened this issue Jan 16, 2024 · 4 comments

Comments

@abrdgrt
Copy link

abrdgrt commented Jan 16, 2024

I'm just finding out that synthetic clicks (isTrusted: false) are now allowed in react, please from what version was this implemented, what was the reason for the change and lastly would it be reverted in the future?

@renaldodev
Copy link

Synthetic clicks refer to a technique where a program simulates user clicks on a computer system, in the context of ReactJS or any other front-end framework, these are generally not a built-in feature or explicitly allowed practice. They typically refer to programmatically generated mouse clicks, often used for testing or malicious purposes like security exploits.

@abrdgrt
Copy link
Author

abrdgrt commented Jan 17, 2024

Hanks for taking time out of your day to reply. I'm aware, to be specific I'm referring to clicks with the event - isTrusted set as false

Do you know the answer to the question I asked?

@renaldodev
Copy link

ReactJS itself does not directly implement the generation of synthetic events with isTrusted set to false.
If you need to create a simulated event with isTrusted set to false in React, you would have to do it using plain JavaScript, outside the scope of React's built-in event handling system. This is because React's Synthetic Event system is not designed for creating artificial events but rather for handling real user interactions in a cross-browser compatible way.

@abrdgrt
Copy link
Author

abrdgrt commented Jan 17, 2024

ReactJS itself does not directly implement the generation of synthetic events with isTrusted set to false. If you need to create a simulated event with isTrusted set to false in React, you would have to do it using plain JavaScript, outside the scope of React's built-in event handling system. This is because React's Synthetic Event system is not designed for creating artificial events but rather for handling real user interactions in a cross-browser compatible way.

I'll take it you do not understand the question I'm asking or you do not know the answer to it. It used to be that you couldn't use .click() on react websites in the past, websites like web.whatsapp.com could not be operated without using frameworks like puppeteer which supported synthetic clicks and sets them as trusted. It's no longer the case now, I am asking which version this came to be, why it was changed (so I'll know if I'm to expect a change like that in the future)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants