feat(sanitizer): add support for allowlisting additional URI protocols

Signed-off-by: Nick Hudkins <nick@nickhudkins.com>
This commit is contained in:
Nick Hudkins
2025-07-17 12:39:23 -04:00
parent e656551f8f
commit cb0541f294
5 changed files with 87 additions and 0 deletions
+10
View File
@@ -58,6 +58,16 @@ export interface Config {
* @visibility frontend
*/
allowedCustomElementAttributeNameRegExp?: string;
/**
* Allows listed protocols in attributes with URI values
* Example:
* additionalAllowedURIProtocols: ['vscode']
* this will allow all attributes with URI values to have `vscode` protocol like `vscode://some/path` in addition to the default protocols
* matched by DOMPurify's IS_ALLOWED_URI RegExp:
* @see: https://raw.githubusercontent.com/cure53/DOMPurify/master/src/regexp.ts
* @visibility frontend
*/
additionalAllowedURIProtocols?: string;
};
};
}