Web IDLでSecure contextsのみで使えるフィールドの属性
[SecureContext]属性
以下は例。
code:widl
interface ExampleFeature {
// This call will succeed in all contexts.
Promise <double> calculateNotSoSecretResult();
// This operation will not be exposed to a non-secure context.
SecureContext Promise<double> calculateSecretResult();
// The same applies here: the operation will not be exposed to a non-secure context.
SecureContext boolean getSecretBoolean();
};
SecureContext
interface SecureFeature {
// This interface will not be exposed to non-secure contexts.
Promise<any> doAmazingThing();
};
引用元: Secure Contexts
以下はWeb Cryptoの例。interfaceの上についている。
これはcrypto.subtle自体がSecure contextsではないと使えないからだと思う。
code:widl
SecureContext,Exposed=(Window,Worker)
interface SubtleCrypto {
Promise<any> encrypt(AlgorithmIdentifier algorithm,
...
};
引用元: Web Cryptography API