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

Restrict SpeechRecognition and friends to secure contexts #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ The term "final result" indicates a SpeechRecognitionResult in which the final a
The term "interim result" indicates a SpeechRecognitionResult in which the final attribute is false.

<pre class="idl">
[Exposed=Window, Constructor]
[SecureContext, Exposed=Window, Constructor]
interface SpeechRecognition : EventTarget {
// recognition parameters
attribute SpeechGrammarList grammars;
Expand Down Expand Up @@ -184,36 +184,36 @@ enum SpeechRecognitionErrorCode {
"language-not-supported"
};

[Exposed=Window]
[SecureContext, Exposed=Window]
interface SpeechRecognitionError : Event {
readonly attribute SpeechRecognitionErrorCode error;
readonly attribute DOMString message;
};

// Item in N-best list
[Exposed=Window]
[SecureContext, Exposed=Window]
interface SpeechRecognitionAlternative {
readonly attribute DOMString transcript;
readonly attribute float confidence;
};

// A complete one-shot simple response
[Exposed=Window]
[SecureContext, Exposed=Window]
interface SpeechRecognitionResult {
readonly attribute unsigned long length;
getter SpeechRecognitionAlternative item(unsigned long index);
readonly attribute boolean isFinal;
};

// A collection of responses (used in continuous mode)
[Exposed=Window]
[SecureContext, Exposed=Window]
interface SpeechRecognitionResultList {
readonly attribute unsigned long length;
getter SpeechRecognitionResult item(unsigned long index);
};

// A full response, which could be interim or final, part of a continuous response or not
[Exposed=Window]
[SecureContext, Exposed=Window]
interface SpeechRecognitionEvent : Event {
readonly attribute unsigned long resultIndex;
readonly attribute SpeechRecognitionResultList results;
Expand All @@ -222,14 +222,14 @@ interface SpeechRecognitionEvent : Event {
};

// The object representing a speech grammar
[Exposed=Window, Constructor]
[SecureContext, Exposed=Window, Constructor]
interface SpeechGrammar {
attribute DOMString src;
attribute float weight;
};

// The object representing a speech grammar collection
[Exposed=Window, Constructor]
[SecureContext, Exposed=Window, Constructor]
interface SpeechGrammarList {
readonly attribute unsigned long length;
getter SpeechGrammar item(unsigned long index);
Expand Down