Implemented auto-adding required ContentSecurityPolicy rules #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Will resolve #101
I decided to go with option 3 just to show you what I mean, but now that I have it (and it works properly), I'm thinking this might be considered bad add-on behavior, since it basically opens up potential security issues without the user actually knowing this.
To elaborate, this will not change
config\environment.js
physically on the disk. Instead, it will add the rules required by the add-on into the config object in memory. It's way more robust than option 2 in the issue description, but as I said, there may be a security concern.On the other hand, option 2 is more transparent, but also much less robust. It has to deal with all the same issues that pull request #106 has listed, slightly increased by the fact that there's more text to add in this one. That being said, I'm also leaning towards option 2 now and it should be a quick thing to abandon the current approach and implement it that way.