-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Editorial review: Document the Summarizer API #39263
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
Editorial review: Document the Summarizer API #39263
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answering some editorial questions
files/en-us/web/api/createmonitor/downloadprogress_event/index.md
Outdated
Show resolved
Hide resolved
|
||
Next, we use the {{domxref("EventTarget.addEventListener()")}} method to listen to two sets of events: | ||
|
||
- `click` events on the `<button>` element; when the button is clicked, the `handleSubmission()` function is called (we're not doing a real form `submit`, as they are disabled in the MDN live example embeds for security purposes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `click` events on the `<button>` element; when the button is clicked, the `handleSubmission()` function is called (we're not doing a real form `submit`, as they are disabled in the MDN live example embeds for security purposes). | |
- `click` events on the `<button>` element; when the button is clicked, the `handleSubmission()` function is called (we're not doing a real form `submit`). |
You can do this with "allow-forms"
, like:
{{embedlivesample("example name", "400px", , , , , "allow-forms")}}
See https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Live_samples#sandbox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I've updated the code and wording to use the real submit.
|
||
The rendered exaple looks like this: | ||
|
||
{{EmbedLiveSample("summarizer-example", "100%", "400px")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
750px is tall enough for me to get rid of scroll:
{{EmbedLiveSample("summarizer-example", "100%", "400px")}} | |
{{EmbedLiveSample("summarizer-example", "100%", "750px")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And like this for enabling forms, I believe:
{{EmbedLiveSample("summarizer-example", , "750px", , , , , "allow-forms")}}
Thanks, @chrisdavidmills - all done if you want a look 👀 |
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
Co-authored-by: Brian Smith <brian@smith.berlin>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me, thanks! 👍🏻
Co-authored-by: Brian Smith <brian@smith.berlin>
Description
Chrome 138 onwards supports the Summarizer API; the relevant ChromeStatus entry says 139, but I've been told this is incorrect.
Note
During review, you may need to enable the chrome://flags/#summarization-api-for-gemini-nano flag to get the demos running in Chrome.
Specifically, this PR adds:
Summarizer
interface.CreateMonitor
interface.Motivation
Additional details
Related issues and pull requests