Skip to content

Add trusted modifier #6149

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

Merged
merged 7 commits into from
Jun 27, 2021
Merged

Conversation

Kapsonfire-DE
Copy link
Contributor

@Kapsonfire-DE Kapsonfire-DE commented Mar 30, 2021

Fixes #6137

Adding a trusted modifier to make events not be dispatchable by console/sourcecode.
Useful to prevent injected code to automatically dispatch event for preventing botting

added trusted modifier to dom.ts
added trusted to valid modifiers in Element.ts
execute trusted modifier in EventHandler.ts
extended to fix trusted
Copy link
Member

@tanhauhau tanhauhau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks great 👍🏻 👏

Add a test for this and everything should be good

@Kapsonfire-DE
Copy link
Contributor Author

Thanks - I hope i did it right. Never done before.

@Kapsonfire-DE
Copy link
Contributor Author

Local test:
runtime
√ event-handler-modifier-trusted (52ms)
√ event-handler-modifier-trusted (with hydration)

ssr
√ event-handler-modifier-trusted

3 passing (159ms)

@Kapsonfire-DE Kapsonfire-DE requested a review from tanhauhau April 27, 2021 14:48
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

Successfully merging this pull request may close these issues.

trusted events modifier
3 participants