diff --git a/tracker/tracker/src/main/app/sanitizer.ts b/tracker/tracker/src/main/app/sanitizer.ts index 5a79b3588..32ec1468c 100644 --- a/tracker/tracker/src/main/app/sanitizer.ts +++ b/tracker/tracker/src/main/app/sanitizer.ts @@ -9,8 +9,28 @@ export enum SanitizeLevel { } export interface Options { + /** + * Sanitize emails in text DOM nodes + * + * (for inputs, look for obscureInputEmails) + * */ obscureTextEmails: boolean + /** + * Sanitize emails in text DOM nodes + * + * (for inputs, look for obscureInputNumbers) + * */ obscureTextNumbers: boolean + /** + * Sanitize the DOM node based on the returned level + * (Plain = 0, Obscured = 1, Hidden = 2) + * + * higher security levels will override other settings or data-params. + * + * @param node - the DOM node to sanitize + * @returns the level of sanitization to apply + * + * */ domSanitizer?: (node: Element) => SanitizeLevel } diff --git a/tracker/tracker/src/main/modules/input.ts b/tracker/tracker/src/main/modules/input.ts index 375dcb9b6..e8297f2b8 100644 --- a/tracker/tracker/src/main/modules/input.ts +++ b/tracker/tracker/src/main/modules/input.ts @@ -91,10 +91,27 @@ export const InputMode = { export type InputModeT = (typeof InputMode)[keyof typeof InputMode] export interface Options { + /** + * Sanitize numbers from DOM input nodes. + * + * (for plain text nodes, look for obscureTextNumbers) + * */ obscureInputNumbers: boolean + /** + * Sanitize emails from DOM input nodes. + * + * (for plain text nodes, look for obscureTextEmails) + * */ obscureInputEmails: boolean - defaultInputMode: InputModeT + /** + * Sanitize dates from DOM input nodes. + * */ obscureInputDates: boolean + /** + * Default input mode for all input nodes. Higher security level + * will override other settings. + * */ + defaultInputMode: InputModeT } export default function (app: App, opts: Partial): void {