BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.

Home Page:http://www.jsviews.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chrome Extension Manifest V3

thao33 opened this issue · comments

We are using jsrender for Chrome Extension and now migrating from manifest v2 to v3.

But, I got a problem with jsrender which be defined at content_scripts.

 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

Seem like source code of jsrender are using eval which is not allowed at manifest v3.
Do you have a plan for supporting that?

There is no plan for any specific changes to address v3 Chrome Extensions. But I have not tested using JsRender within a Chrome Extension. If I have time I may try to investigate that scenario, but it may take a while. Meantime, if you are able to explore that issue further, and come up with any additional thoughts or data, please post them here... Thanks...

It may be possible to provide a new feature to pre compile a JsRender template. If the precompiled template is loaded before calling the jsrender templates() method, then eval (new Function) will not be called, and the code will work in the Chrome Extension, manifest V3.

But I'm not sure yet whether/when this precompile feature will be available...

We won't be able to provide this precompile feature for now, although we may reconsider it in the future... See also here.

Closing this issue for now,