-
Notifications
You must be signed in to change notification settings - Fork 3
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
Infinite loops can occur because of a bug in Safari #5
Comments
Follow this thread as well, it looks like they're doing nearly exactly the same thing: mapbox/mapbox-gl-js#6058 |
To get around this, I'm going to get rid of the web worker for now. This removes one of the security properties we have, which is stopping infinite loops. But until the Safari bug is fixed, it doesn't seem like that is going to be possible. Once Safari does fix the bug, revert to this version: v0.3.3 |
The results of my research are that iframes run on the main JavaScript thread, and so no setTimeout callback can ever be called if there is an infinite loop within the iframe. There doesn't seem to be any generic way of running an iframe in a separate thread or process. Chromium seems to have a way to do it, but I don't believe it's the default behavior for normal iframes. So, we need to get the iframe to run on a separate thread. We can't use web workers within iframes in Safari, so what if we could get the iframe to run in the web worker? Well, you can't manipulate the dom and you don't have access to the window object, so you can't load an iframe within a web worker. Now we're left with just getting rid of the web worker. As far as I know the only extra security properties the web worker is providing us is stopping infinite loops, and an extra layer of security in accessing any kind of dom...though the dom that could be accessed would be the iframe dom, and I believe the sandbox attribute and hiding the iframe are enough there. |
But, perhaps living with infinite loops is okay. Now we should be able to have modules within our eval, and the environment will not be restricted like it would be within a web worker. |
I don't believe this library will work in Safari because of the following bug: https://bugs.webkit.org/show_bug.cgi?id=170075
The text was updated successfully, but these errors were encountered: