Re: [w3c/editing] Should we modify the clipboard API spec to match Safari's behavior for HTML-referenced media? (#285)

I'm a bit concerned about using blob: URLs like this. In general we've been trying to move away from using blob URLs in more places, and instead having APIs that accept either URLs or objects. In this case that wouldn't work of course, since you need some reference in a string based format. But even then I think the currently spec'ed behavior is in some ways superior to using blob: URLs. A big problem with blob URLs is their lifetime. Them being just strings means that it is impossible for a browser implementation to know if there still are any references to the URL, as such blob URLs remain valid until the page that created them closes or until they are explicitly revoked. This can (and does) easily lead to memory leaks in single-page application style websites (or just long-running websites). In this case it potentially seems even worse, since no existing website will have any logic in place to revoke these blob URLs, and thus they (and their backing Blob objects) are guaranteed to leak until the page is navigated away from.

The currently spec'ed behavior does not have this problem, since the references to blobs are only meaningful in the context of the DataTransfer object, and only if a website explicitly keeps around references to the actual Blob/File objects will they be kept alive.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/285#issuecomment-794599214

Received on Tuesday, 9 March 2021 23:27:18 UTC