Closed dannycolin closed 3 years ago
Would a template engine work for a Firefox webextension? I thought that using innerHTML
wasn't permitted in a webextension. I believe I tried using that on another project and it failed AMO's pre-check.
I've asked on #webextensions and they said it should be possible to use something like mustache.js
Is this something you want to do during the redesign that you are working on or are you happy just leaving the Javascript as it is for now and exploring a template engine later?
I thought that using innerHTML wasn't permitted in a webextension.
Yes, is not allowed.. security purposes.
Is this something you want to do during the redesign that you are working on or are you happy just leaving the Javascript as it is for now and exploring a template engine later?
It can be after the redesign
Sounds good @dannycolin!
I thought that using innerHTML wasn't permitted in a webextension.
Yes, is not allowed.. security purposes.
Do you think using a library like [DOMPurify] to sanitize an innerHTML would pass the review process?
Do you think using a library like [DOMPurify] to sanitize an innerHTML would pass the review process?
I don't think so. I think innerHTML()
is off limits, regardless of how you implement it. I looked at some Mozilla-run projects and it appears that even they just dynamically create the elements like we have done in our code.
Currently, there doesn't appear to be a huge benefit to implementing a templating language. The effort doesn't really match the reward, so I'll close this for now. If someone finds an easy-to-implement solution worth reviewing, feel free to reopen this issue.
I think this has already been done, but was never closed. Reopen this issue if I'm incorrect.
I'd like to have a clear separation of the frontend and backend code. Currently, some code is generated from the JS files for the questions list and we also need to use tag with specific ID to inject the data in the frontend.