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

AIR Sandbox #16

Closed
ramiel opened this issue Oct 27, 2010 · 9 comments
Closed

AIR Sandbox #16

ramiel opened this issue Oct 27, 2010 · 9 comments

Comments

@ramiel
Copy link

ramiel commented Oct 27, 2010

new Function() generate a Sandobox violation in Adobe AIR,so it's not possible to use this plugin to write an AIR application

@Somebi
Copy link

Somebi commented Nov 9, 2010

+1 please fix that.

@BorisMoore
Copy link
Owner

Do you mean that any js file that is loaded in the browser, and which uses new Function() in the context of an AIR application will fail? That's a big restriction to put on all javascript platforms. Even jQuery itself uses it (in parseJSON).

Or is it some error arising in the specific instance of a call to new Function() in buildTmplFn? In that case, does the error occur no matter what template you are using?

@tommoor
Copy link

tommoor commented Nov 30, 2010

Unfortunately this restriction is very real, and very frustrating:

See official documentation:
http://cookbooks.adobe.com/post_Avoid_JavaScript_security_errors_in_the_AIR_applic-8083.html

Any suggestions on how to overcome this?

@BorisMoore
Copy link
Owner

Does $.parseJSON(...) also generate a violation?

@jzaefferer
Copy link
Contributor

$.parseJSON uses JSON.parse when available, which is probably the case in Adobe AIR.

@tommoor
Copy link

tommoor commented Dec 9, 2010

parseJSON seems to work fine.

We are still using jquery-tmpl, the work around has been to compile all of the templates when the application starts, before the body onload event as obviously it is only the compilation that generates the sandbox violation.

@jzaefferer
Copy link
Contributor

Could you clarify what "when the application starts" means? Is that an acceptable workaround, or is this issue still big enough that it should be resolved within the template plugin?

@tommoor
Copy link

tommoor commented Dec 28, 2010

when the application starts means before the onload event.

Is it an acceptable workaround? Probably not.
Is it a problem for the jquery-tmpl team? Probably not.

Unfortunately it's an inherent limitation of Adobe Air, and on reflection it probably isn't worth the time figuring out a fix.

@BorisMoore
Copy link
Owner

Closing issue for now.

This issue was closed.
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

5 participants