Sanitizer: add javascriptURLs option to SanitizerConfig and Sanitizer - #12898
Merged
Conversation
annevk
reviewed
Sep 3, 2026
|
|
||
| <li><p>If <var>configuration</var>["<code | ||
| data-x="dom-SanitizerConfig-javascriptURLs">javascriptURLs</code>"] does not <span data-x="map | ||
| exists">exist</span>, then set it to <var>allowCommentsPIsAndDataAttributes</var>.</p></li> |
Member
There was a problem hiding this comment.
We should rename the variable. Perhaps allowBooleanMembers? cc @evilpie
Contributor
Author
There was a problem hiding this comment.
Note that this also affects the default PI handling which is not boolean...
I'd suggest <var>defaults</var> which can be "permissive" or "restrictive" ?
permissiveDefaults if we want to simplify
Member
There was a problem hiding this comment.
That all sounds fine to me, even just permissive might work.
Contributor
Author
There was a problem hiding this comment.
Done, changed to permissiveDefaults
This was referenced Sep 3, 2026
evilpie
reviewed
Sep 4, 2026
| data-x="dom-SanitizerConfig-valid">valid</span>.</p></li> | ||
|
|
||
| <li><p>If <var>configuration</var>["<code | ||
| data-x="dom-SanitizerConfig-javascriptURLs">javascriptURLs</code>"] <span data-x="map |
Member
There was a problem hiding this comment.
I think this is an issue with e.g. setComments as well, but doesn't javascriptURLs always exist after canonicalizing a SanitizerConfig?
Member
|
Otherwise this looks good to me. |
annevk
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Instead of the "remove JS URLs" directive rely solely on the method being "Safe", keep it in the configuration.
That makes it apply also in the
removeUnsafe()case.It follows the exact same logic as data attributes and comments.
Closes #12686
javascriptURLoption mdn/mdn#862(See WHATWG Working Mode: Changes for more details.)