Javascript Template Engines that work with Chrome's Content Security Policy

后端 未结 2 1009
深忆病人
深忆病人 2021-02-19 15:48

The Chrome API\'s Manifest version 2 has removed the ability to do unsafe-eval. This means using the eval function or in general dynamically creating a function from text.

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 16:31

    The best solution to this problem is to pre-compile your templates before you deploy your extension. Both handlebarsjs and eco offer pre-compilation as a feature. I actually wrote a blog post that goes into more depth.

提交回复
热议问题