diff --git a/4-binary/03-blob/article.md b/4-binary/03-blob/article.md index ce32b29b..062e1834 100644 --- a/4-binary/03-blob/article.md +++ b/4-binary/03-blob/article.md @@ -1,4 +1,4 @@ -`Blob` # Blob +# Blob `ArrayBuffer` and views are a part of ECMA standard, a part of JavaScript. @@ -89,7 +89,7 @@ link.click(); URL.revokeObjectURL(link.href); ``` -`URL.createObjectURL` takes a `Blob` and creates an unique URL for it, in the form `blob:/`. +`URL.createObjectURL` takes a `Blob` and creates a unique URL for it, in the form `blob:/`. That's what the value of `link.href` looks like: @@ -101,11 +101,11 @@ The browser for each URL generated by `URL.createObjectURL` stores an the URL -> A generated URL (and hence the link with it) is only valid within the current document, while it's open. And it allows to reference the `Blob` in ``, ``, basically any other object that expects an url. -There's a side-effect though. While there's an mapping for a `Blob`, the `Blob` itself resides in the memory. The browser can't free it. +There's a side-effect though. While there's a mapping for a `Blob`, the `Blob` itself resides in the memory. The browser can't free it. -The mapping is automatically cleared on document unload, so `Blob` o bjects are freed then. But if an app is long-living, then that doesn't happen soon. +The mapping is automatically cleared on document unload, so `Blob` objects are freed then. But if an app is long-living, then that doesn't happen soon. -**So if we create an URL, that `Blob` will hang in memory, even if not needed any more.** +**So if we create a URL, that `Blob` will hang in memory, even if not needed any more.** `URL.revokeObjectURL(url)` removes the reference from the internal mapping, thus allowing the `Blob` to be deleted (if there are no other references), and the memory to be freed. @@ -119,7 +119,7 @@ An alternative to `URL.createObjectURL` is to convert a `Blob` into a base64-enc That encoding represents binary data as a string of ultra-safe "readable" characters with ASCII-codes from 0 to 64. And what's more important -- we can use this encoding in "data-urls". -A [data url](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) has the form `data:[][;base64],`. We can use such urls everywhere, on a par with "regular" urls. +A [data url](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) has the form `data:[][;base64],`. We can use such urls everywhere, on par with "regular" urls. For instance, here's a smiley: