From 966ce7de8a23f63d0f30b1748fe69ccaf07519e0 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 7 Apr 2021 15:22:14 +0200 Subject: feat: blob URL support (#10045) This commit adds blob URL support. Blob URLs are stored in a process global storage, that can be accessed from all workers, and the module loader. Blob URLs can be created using `URL.createObjectURL` and revoked using `URL.revokeObjectURL`. This commit does not add support for `fetch`ing blob URLs. This will be added in a follow up commit. --- op_crates/url/00_url.js | 8 -------- op_crates/url/lib.deno_url.d.ts | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'op_crates/url') diff --git a/op_crates/url/00_url.js b/op_crates/url/00_url.js index 9dd2b7800..bf1ed6059 100644 --- a/op_crates/url/00_url.js +++ b/op_crates/url/00_url.js @@ -389,14 +389,6 @@ toJSON() { return this.href; } - - static createObjectURL() { - throw new Error("Not implemented"); - } - - static revokeObjectURL() { - throw new Error("Not implemented"); - } } window.__bootstrap.url = { diff --git a/op_crates/url/lib.deno_url.d.ts b/op_crates/url/lib.deno_url.d.ts index 2a27fe693..3f9745352 100644 --- a/op_crates/url/lib.deno_url.d.ts +++ b/op_crates/url/lib.deno_url.d.ts @@ -155,8 +155,8 @@ declare class URLSearchParams { /** The URL interface represents an object providing static methods used for creating object URLs. */ declare class URL { constructor(url: string, base?: string | URL); - createObjectURL(object: any): string; - revokeObjectURL(url: string): void; + static createObjectURL(blob: Blob): string; + static revokeObjectURL(url: string): void; hash: string; host: string; -- cgit v1.2.3