Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class CrossOriginStorage {
_storeBlobInCOS = async (blob, hashHex) => {
const handle = await navigator.crossOriginStorage.requestFileHandle(makeHashDescriptor(hashHex), {
create: true,
origins: '*',
});
const writableStream = await handle.createWritable();
await writableStream.write(blob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ interface CrossOriginStorageRequestFileHandleHash {
*/
interface CrossOriginStorageRequestFileHandleOptions {
create?: boolean;
/**
* Restricts (or opens up) which origins may later read the stored file.
* `'*'` makes the resource available to all origins; an array of origin
* strings restricts it to that set; omitting the field keeps the
* default (same-site only). Visibility can be upgraded but never
* downgraded.
* @see https://github.com/WICG/cross-origin-storage#example-restricting-resources-to-specific-origins
*/
origins?: '*' | string[];
}

/**
Expand Down
Loading