Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023-05-03 meeting notes #192

Closed
annevk opened this issue May 3, 2023 · 3 comments
Closed

2023-05-03 meeting notes #192

annevk opened this issue May 3, 2023 · 3 comments

Comments

@annevk
Copy link
Collaborator

annevk commented May 3, 2023

General agreement on:

  • Some string -> Document with a filter API (e.g., Document.parseUnsafe())
  • Some string -> Document with a must-be-safe filter API (e.g., Document.parse())
  • Some string -> parse + insert with a filter API (e.g. element.setHTMLUnsafe())
  • Some string -> parse + insert with a must-be-safe filter API (e.g. element.setHTML())

Details to discuss:

  • How are filters delivered? { filter } or { sanitizer } or { filter } for one and { sanitizer } for the other?
  • Are filters dictionaries or Sanitizer objects or either allowed or ...?
    • If there were to be a Sanitizer object it should be useful, e.g. with properties reflecting the "resolved" allowlists you could inspect.
  • Should there be positional methods?
otherdaniel added a commit that referenced this issue May 31, 2023
Explainer for new Sanitizer API design, based on recent sync meeting (#192).
@shgysk8zer0
Copy link

I am struggling to understand what changed in the new API design.

  • I noticed all mentions of Sanitizer have been removed
  • The WICG unofficial draft (2023-05-31) is still mostly about the construction and methods, etc. of Sanitizer
  • The current explainer has no examples
  • Explainer examples #194 Adds examples using element.setHTML & Document.parseHTML that seem to imply passing the options/filter directly to these methods (element.setHTML(html, { allowElements, allowAttributes })) instead of element.setHTML(html, { sanitizer: new Sanitizer({ allowElements, allowAttributes}) })
  • Those examples also differ greatly in structure from the default configuration dictionary (possibly to address SVG and MathML)

I get the impression that Sanitizer has been removed and that setHTML & parseHTML are the direction this is heading, possibly passing in what was formerly the the arguments to new Sanitizer(config). Is this correct?

@annevk
Copy link
Collaborator Author

annevk commented Jun 12, 2023

Mostly, but Sanitizer or something like it might make a comeback if it can be independently useful, see https://github.com/WICG/sanitizer-api/blob/main/explainer.md#open-questions. The current object doesn't do anything at which point it might as well be a dictionary.

@annevk
Copy link
Collaborator Author

annevk commented Oct 18, 2023

No need to keep this open, for the latest see #196.

@annevk annevk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants