Open mingyc opened 2 months ago
This is a great question.
I would prefer not to require user activation, but we should check the precedent of other APIs to see if that's reasonable.
My recollection for workers is that dedicated workers inherit permissions directly from their parent (and, e.g., can cause a prompt in their parent's window). But in most cases shared/service workers cannot do any prompting, and either various permission-requiring APIs do not work there, or they only work if the user has previously granted permission to a window/dedicated worker.
This gets a bit more complicated in specs and in Firefox where it's possible to nest dedicated workers under shared/service workers.
Let me do more research and try to come up with clearer answers.
Assuming we are adding permission (as described by the doc) to gate download/access to language models, what are the default behaviors for shared/dedicated/service workers when they try to use the Translation API?