Skip to content

Commit

Permalink
Restrict to secure contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Oct 9, 2024
1 parent ce02edf commit 12e810e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ In all cases, the exception used for rejecting promises or erroring `ReadableStr
// Shared self.ai APIs
partial interface WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute AI ai;
[Replaceable, SecureContext] readonly attribute AI ai;
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AI {
readonly attribute AITranslatorFactory translator;
readonly attribute AILanguageDetectorFactory languageDetector;
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AICreateMonitor : EventTarget {
attribute EventHandler ondownloadprogress;
Expand All @@ -229,13 +229,13 @@ enum AICapabilityAvailability { "readily", "after-download", "no" };
```webidl
// Translator
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AITranslatorFactory {
Promise<AITranslator> create(AITranslatorCreateOptions options);
Promise<AITranslatorCapabilities> capabilities();
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AITranslator {
Promise<DOMString> translate(DOMString input, optional AITranslatorTranslateOptions options = {});
ReadableStream translateStreaming(DOMString input, optional AITranslatorTranslateOptions options = {});
Expand All @@ -246,7 +246,7 @@ interface AITranslator {
undefined destroy();
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AITranslatorCapabilities {
readonly attribute AICapabilityAvailability available;
Expand All @@ -269,21 +269,21 @@ dictionary AITranslatorTranslateOptions {
```webidl
// Language detector
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AILanguageDetectorFactory {
Promise<AILanguageDetector> create(optional AILanguageDetectorCreateOptions options = {});
Promise<AILanguageDetectorCapabilities> capabilities();
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AILanguageDetector {
Promise<sequence<LanguageDetectionResult>> detect(DOMString input,
optional AILanguageDetectorDetectOptions options = {});
undefined destroy();
};
[Exposed=(Window,Worker)]
[Exposed=(Window,Worker), SecureContext]
interface AILanguageDetectorCapabilities {
readonly attribute AICapabilityAvailability available;
Expand Down

0 comments on commit 12e810e

Please sign in to comment.