add chrome.tts.onVoicesChanged event to tts extension API?

2 views
Skip to first unread message

Katie Dektar

unread,
Feb 1, 2024, 1:01:40 PMFeb 1
to extension-...@chromium.org, David Tseng, Anastasia Helfinstein
Hi extensions team,

I'm interested in adding chrome.tts.onVoicesChanged as a ChromeEvent in the chrome.tts api. This would be fired at the same time as the current window.speechSynthesis.onvoiceschanged, only it would allow service worker extensions to get notified (since there's no easy `window` for service workers to get the speechSynthesis object). Sending the event would be trivial since the codebase is already set up to send it to speechSynthesis, and I don't think there's any privacy/security impact since it's already exposed there.

I made a bug to request this change at crbug.com/1319741. I haven't written up any design / justification documents because it seems very straightforward given the speechSynthesis version, but I'd be happy to do so if needed.

Thank you!
Katie

Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback

Katie Dektar

unread,
Feb 6, 2024, 12:18:43 PMFeb 6
to extension-...@chromium.org, David Tseng, Anastasia Helfinstein
Hi extensions team,

Friendly ping on this minor API change request, thank you!

-Katie


Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback


Katie Dektar

unread,
Feb 12, 2024, 11:01:35 AMFeb 12
to extension-...@chromium.org, Devlin Cronin, David Tseng, Anastasia Helfinstein
+Devlin Cronin can you help with this request below?

This will provide some support for migrating one of the Chrome OS A11y extensions to MV3.

Thanks!


Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback


Katie Dektar

unread,
Feb 14, 2024, 10:56:24 AMFeb 14
to extension-...@chromium.org, Devlin Cronin, David Tseng, Anastasia Helfinstein, CrxCore
+CrxCore, maybe someone on this list can help me get a response from extension-api-reviews@chromium?

Thanks!

Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback


Patrick Kettner

unread,
Feb 14, 2024, 3:40:44 PMFeb 14
to Devlin Cronin, Katie Dektar, extension-...@chromium.org, David Tseng, Anastasia Helfinstein, CrxCore
Hey Devlin! Would you be able to weigh in on this? Or point out who would be the right person to investigate?

@Katie Dektar in the meantime, have you considered using chrome.offscreen? While I hope we can give you the changes you are looking for, the offscreen document would unblock you today.

patrick

Devlin

unread,
Feb 14, 2024, 5:35:09 PMFeb 14
to Patrick Kettner, Devlin Cronin, Katie Dektar, extension-...@chromium.org, David Tseng, Anastasia Helfinstein, CrxCore
Hi Katie!

I think adding chrome.tts.onVoicesChanged would be fine -- it seems very inline with the rest of the API and, as you point out, shouldn't have any security or privacy implications that we can think of.  Especially in terms of allowing for a path forward for these extensions to migrate to MV3, that sounds fine to me.  Generally we don't like to provide these kind of "mirroring" APIs (we don't want separate implementations for a web API and an extension API), but in this case, I think we can allow it because:
a) The event fits in very well with the rest of the tts API as it is (that is, we're not introducing a fully new API that mirrors web functionality)
b) The implementation should be very straightforward (there should be very little technical cost to adding and maintaining it).

More broadly, though, do you know if there's a reason the SpeechSynthesis object is restricted to window contexts?  Could it be exposed to workers, as well?  That would solve the issue more fully, and could benefit both extension and web-based service workers.

Cheers,
Devlin

--
You received this message because you are subscribed to the Google Groups "extension-api-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extension-api-re...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/extension-api-reviews/CAPAuxoAcsysWqqz8%3Dsjgt%3Dm77DyauypRGk9itFyWJ99qNYLi5A%40mail.gmail.com.

Devlin

unread,
Feb 14, 2024, 5:35:49 PMFeb 14
to Patrick Kettner, Devlin Cronin, Katie Dektar, extension-...@chromium.org, David Tseng, Anastasia Helfinstein
[Removing internal group aliases]

Katie Dektar

unread,
Feb 14, 2024, 5:48:09 PMFeb 14
to Devlin, Evan Liu, Patrick Kettner, Devlin Cronin, extension-...@chromium.org, David Tseng, Anastasia Helfinstein
Thanks Devlin and Patrick,

Devlin, many parts of window.speechSynthesis and chrome.tts overlap already, for what it's worth; I believe chrome.tts predated the standardized version. If window.speechSynthesis could be exposed to workers I think that would be nice; I'm not sure if that would require some sort of web standards change or something? +Evan Liu who is an OWNER of blink/renderer/modules/speech to comment here.

Patrick, I could certainly try the offscreen API. Even so, this feels like something that makes sense in chrome.tts and it's a *really* small change to add it (just crrev.com/c/5253987 modulo code review).

-Katie

Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback


Devlin

unread,
Feb 14, 2024, 5:52:17 PMFeb 14
to Katie Dektar, Evan Liu, Patrick Kettner, Devlin Cronin, extension-...@chromium.org, David Tseng, Anastasia Helfinstein
Thanks, Katie!

Yeah, moving SpeechSynthesis to be exposed to worker contexts would likely require a spec change -- but it should be something we can ask about / pursue if there are no objections.  Another middle ground is exposing the API to extension service workers, which is what we do with other APIs like WebHID (though this doesn't have quite as well-trodden of a path in terms of either code changes or standards process.)

That said, I think that can be an additional exploration (relatedly, I'd be curious if that would be beneficial for any of your other a11y extensions), and I have no problem adding the new event to chrome.tts (for the reasons mentioned in my first email).

Cheers,
Devlin

Katie Dektar

unread,
Feb 14, 2024, 6:07:36 PMFeb 14
to Devlin, Evan Liu, Patrick Kettner, Devlin Cronin, extension-...@chromium.org, David Tseng, Anastasia Helfinstein
Ok, sounds good, thank you Devlin! I'll proceed with adding this voices changed event to TTS for now.


Katie Dektar (she/her) | Software Engineer | kat...@google.com |  ka...@chromium.org | feedback


Reply all
Reply to author
Forward
0 new messages