Skip to content

Commit

Permalink
Implement URL.revokeObjectURL
Browse files Browse the repository at this point in the history
Partially fixes #16
  • Loading branch information
developit committed Oct 25, 2022
1 parent 9480e36 commit 0ab01a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ if (!objects) {
objects[id] = blob;
return `blob:http://localhost/${id}`;
};
self.URL.revokeObjectURL = (url) => {
let m = String(url).match(/^blob:http:\/\/localhost\/(.+)$/);
if (m) delete objects[m[1]];
};
}

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

0 comments on commit 0ab01a5

Please sign in to comment.