Skip to content

Truly independent web browser

922 B
Raw Blame
// https://w3c.github.io/ServiceWorker/#cachestorage-interface
[SecureContext, Exposed=(Window,Worker)]
interface CacheStorage {
    [NeedsCallerRealm, NewObject, CreatesPromise] Promise<(Response or undefined)> match(RequestInfo request, optional MultiCacheQueryOptions options = {});
    [NeedsCallerRealm, NewObject, CreatesPromise] Promise<boolean> has(DOMString cacheName);
    [NeedsCallerRealm, NewObject, CreatesPromise] Promise<Cache> open(DOMString cacheName);
    [NeedsCallerRealm, NewObject, CreatesPromise] Promise<boolean> delete(DOMString cacheName);
    [NeedsCallerRealm, NewObject, CreatesPromise] Promise<sequence<DOMString>> keys();
};

dictionary MultiCacheQueryOptions : CacheQueryOptions {
    DOMString cacheName;
};

// https://w3c.github.io/ServiceWorker/#self-caches
partial interface mixin WindowOrWorkerGlobalScope {
    [SecureContext, SameObject] readonly attribute CacheStorage caches;
};