4

With google chrome manifest 2.0, my template engine on javascript doesn't work. I've used Jquery Template, and now can't upgrade manifest, beacause new Function and eval deprecated.

Is the any way to use templates with manifest 2.0, or only one way it's create dom objects in javascript?

1 Answer 1

5

See the extension docs relating to sandboxing eval. There's even an example (may take a while to load) of how to do this with the Handlebars templating library.

In brief, you run the template engine within a sandboxed iframe, then use window.postMessage to transfer the results back to your extension.

1
  • Thanks. I found soulutions with sanbox earlier, but that look crazy. Commented Sep 28, 2012 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.