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.
This PR adds an Injection API so that resources can be passed to the Navigator in order to inject them in a given list of resources – regex is also an option.
For instance:
At the moment, the API accepts either a
Blobor aurl. For CSP, a list ofallowedDomainshas to be passed to check whetherurlis valid and create alink/scriptto it. It does not accept a raw string.An
Injectorclass is taking care of applying rules, etc. Blobs URL are also shared and released when possible, so that they are not duplicated for each document.More testing to do. Although no memory leaks have surfaced during the initial extensive testing, there is additional testing to do with more complex use cases such as significant scripts. I must also migrate the internal scripts and stylesheets we inject by default to the API.
Probably some improvements to make as well, as you need to be very explicit through attributes, etc.
So it’s time to open a draft PR so that issues can be caught early, and inputs/feedbacks collected for API improvements.