Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

https://jackchilds.tech/posts/handling_user_logic_in_javascript #15

Open
utterances-bot opened this issue May 22, 2022 · 3 comments
Open
Labels
post-comments A blog post comment section

Comments

@utterances-bot
Copy link

Handling user logic in javascript

How I handle user-created logic and run it safely on the client

https://jackchilds.tech/posts/handling_user_logic_in_javascript

Copy link

LoueeD commented May 22, 2022

Great post! Love the flexibility this gives to the end user.

Out of interest, did you consider using web workers to execute the user defined JS code. Workers don't have access to the DOM and limited access to methods and properties on the window object. Example here https://jsbin.com/vicayavumi/1/edit?js,console

@JackChilds
Copy link
Owner

@LoueeD thanks for the feedback!

An interesting suggestion – I did in fact look at web workers but I just found that they still gave too much access to the user's device. The main concern being the fact that users could write logic that sends data (that's considered private by privacy laws) to other servers which is going to be a nightmare to try to moderate in the project that I'm working on.
Nonetheless, it's absolutely an alternative solution that's much faster but does sacrifice control over the user's privacy and what can be accessed.

@JackChilds JackChilds added the post-comments A blog post comment section label May 22, 2022
Copy link

dscham commented May 23, 2022

Stumbled upon this on reddit, amazing website for a 15-yo 👏 And thanks for the post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
post-comments A blog post comment section
Projects
None yet
Development

No branches or pull requests

4 participants