Skip to content

Commit aaf2874

Browse files
authored
Implement URL.revokeObjectURL (#18)
Partially fixes #16
1 parent 9480e36 commit aaf2874

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ if (!objects) {
2727
objects[id] = blob;
2828
return `blob:http://localhost/${id}`;
2929
};
30+
self.URL.revokeObjectURL = (url) => {
31+
let m = String(url).match(/^blob:http:\/\/localhost\/(.+)$/);
32+
if (m) delete objects[m[1]];
33+
};
3034
}
3135

3236
if (!self.fetch || !('jsdomWorker' in self.fetch)) {

0 commit comments

Comments
 (0)