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

Remove use of Function constructor in compiled code to create chrome extension #1426

Closed
sumit-terabits opened this issue May 1, 2023 · 1 comment
Labels
question Further information is requested

Comments

@sumit-terabits
Copy link

Odoo/owl uses function constructor to add reactivity in code which hinders latest manifest version's security policy of chrome extensions.
How can I remove use of these Function constructors or is there any other way to make owl chrome extension friendly.

Thank You!!

@sdegueldre sdegueldre added the question Further information is requested label May 2, 2023
@sdegueldre
Copy link
Contributor

sdegueldre commented May 2, 2023

You can use the compile_xml.js script to compile templates ahead of time and bundle them in your extension, this is exactly what we do for the owl devtools which are a chrome extension written in owl. See this the owl devtools rollup config for more details:

https://github.com/odoo/owl/blob/master/tools/devtools/rollup.config.js

(also please not that the use of the function constructor has nothing to do with adding reactivity, the reactivity is an entirely runtime feature that doesn't depend on the compiler)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants