mediasource:

blob: URL scheme

[3] blob: URLBlobFile を表すために使われます。

仕様書

意味

[64] Blob (やそのサブクラスである File) >>2 や、 MediaSource >>62 を表します。

構文

[14] Blob URL は、 URL scheme blob: の後に起源/UUID を続けたものです。 素片識別子を使うこともできます。 >>2

  1. blob:
  2. 起源
  3. /
  4. UUID
  5. ?
    1. #
    2. 素片識別子

素片識別子

[27] 素片識別子の処理は MIME型に依存します。 利用者エージェントMIME型を認識できない時や当該資源中で意味が無い時は、 無視しなければなりません素片識別子は、 資源を識別するために使ってはなりません>>2

生成

[10] Blob URL を生成する手順である Blob URLの直列化 (Serialization of a Blob URL) は、 次のようにしなければなりません >>2

  1. [11] 結果を、blob: に設定します。
  2. [69] 直列化を、現在設定群オブジェクト起源ASCII直列化に設定します。
  3. [70] 直列化null なら、
    1. [71] 結果の末尾に、実装定義の値を追加します。
  4. [72] それ以外なら、
    1. [73] 結果の末尾に、直列化を追加します。
  5. [23] 結果の末尾に、 / を追加します。
  6. [24] UUID を、新しい RFC 4122 UUID 文字列に設定します。
  7. [13] 結果の末尾に、UUID を追加します。
  8. [25] 結果を返します。

[21] 実装定義とはいっても、他の起源と衝突しない値が期待されていると思われます。

起源

Blob URL の生成時

[17] Blob URL起源は、作成するメソッドが呼び出された時の現在設定群オブジェクト起源と同じでなければなりません >>2

[18] 直列化した Blob URL起源は、 起源Unicode直列化でなければなりません >>2

[20] File API 仕様書としては、 http:https:起源の場合しか規定していません。 file: URL起源は実装依存となっており、例えば blob:file:///Users/arunranga/702efefb-c234-4988-a73b-6104f1b615ee は実装によっては妥当かもしれませんし、そうでないかもしれません。 >>2

[19] Blob URL に対する cross-origin要求は、ネットワークエラーとしなければなりません >>2

[63] MediaSource object URL の場合 (createObjectURL で作成した場合) にあっては、 createObjectURL メソッドthis関連設定群オブジェクト (の起源???) が起源です。 >>62

Blob URL の利用時

[26] blob: URL起源は、 scheme dataURLの構文解析した結果得られる URLの起源です。 構文解析に失敗する場合は、新しい大域的に固有な識別子です。 >>34

分類

[36] blob: URL scheme は、局所スキームです >>35

URL のオブジェクト

[31] URL構文解析器によって構文解析した URL は、 blob URL entry を持つことができます >>30

[33] 値は nullblob URL entry です >>30

[95] かつてはオブジェクト (object) と呼ばれ、 Blob URL StoreBlob URL が登録されていれば、その BlobMediaStream構造化クローン >>32、 そうでなければ null でした。

[79] かつては MediaSource にも使われていました。

[41] URLの構文解析の時点で Blob との関連付けが行われることになりますから、 自動revokeや手動の revokeObjectURLBlob URL Store から削除されたとしても、既に fetch が始まっていれば、その fetch は成功するはずです。

作成

[15] Blob URL は、次の方法で作成できます。

fetch

[38] blob: URL記録 URL基本fetchは、次のようにしなければなりません >>37

  1. [86] blob を、 URLblob URL entryオブジェクトに設定します。
  2. [39] blobBlobない場合、
    1. [74] ネットワークエラーを返し、ここで停止します。
  3. [51] 要求メソッドGET 以外の場合、
    1. [75] ネットワークエラーを返し、ここで停止します。
  4. [40] 新しい応答を作成し、返します。
    [87] 応答
    状態メッセージ
    OK
    ヘッダーリスト
    1. Content-Length: blobsize
    2. Content-Type: blobtype
    HTTPS状態
    要求クライアントnull でなければ、その HTTPS状態
    本体
    blob読み取り操作の結果
[48] 実際には読み取り操作非同期的に結果を返すものですから、 応答も一度に返されるものではなく、非同期的本体が完成してゆくものと考えるべきでしょう。
[46] 読み取り操作はエラーになるかもしれません。 Fetch Standard には明記されていませんが、他のプロトコルで応答の途中でエラーとなった場合同様に取り扱うべきと思われます。
[42] File API参考として述べている >>2 次の点は、 Fetch Standard には反映されていないようです。これが意図的なものなのかどうか、実装はどうなっているのかは不明です。

破棄

[16] Blob URL は、次の方法で revoke できます。

[29] createFor メソッドで作成された Blob URL は、自動revokeの対象となります。

歴史

[28] 当初 Geckomoz-filedata: URL scheme を使っていました。

実装

[1] url_constants.cc - chrome/common - Code Search ( ( 版)) http://www.google.co.jp/codesearch/p?hl=ja#hfE6470xZHk/chrome/common/url_constants.cc&q=package:chromium

[4]

blob:550e8400-e29b-41d4-a716-446655440000#aboutABBA

[5] ChromecreateObjectURL で返す例

blob:http://suika.fam.cx/6ff6e0e9-51d5-41e2-8752-411cbfc3fc7a

メモ

[6] IRC logs: freenode / #whatwg / 20140508 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20140508#l-839

[7] Blob URL Origin ( (Arun Ranganathan 著, 版)) http://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0369.html

[8] Data URL loading is now controlled through a flag. Blob URLs have an ori... · 5b64685 · whatwg/fetch ( ( 版)) https://github.com/whatwg/fetch/commit/5b64685a97a7d6f24814172de68399d0225a4cae

[9] Define fetching blob URLs part 1 · a53a57d · whatwg/fetch ( ( 版)) https://github.com/whatwg/fetch/commit/a53a57dfc66911686488111d6cd19297cdb5c354#diff-8d4d847e6257b75f4bf8030496281de4L1105

[12] Reference File API's read operation https://www.w3.org/Bugs/Public/show_... · ecf0661 · whatwg/fetch ( ( 版)) https://github.com/whatwg/fetch/commit/ecf06611c36b4beae4a50fd039957dd8f7238a22

[49] ( 版) http://www.iana.org/assignments/uri-schemes/prov/blob

(last updated 2015-07-17)

Scheme name: blob

Status: Provisional

[50] Fix #125: only allow fetching blob URLs with `GET` · whatwg/fetch@53c071b ( 版) https://github.com/whatwg/fetch/commit/53c071b078bf345aaad7e9cbf2d1d425d53c82ef

[52] 28925 – Append the hyperlink suffix to the URL before resolving ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=28925

[53] Make the Blob URL creating/revoking methods not be exposed on the ser… · w3c/FileAPI@b9c2275 ( 版) https://github.com/w3c/FileAPI/commit/b9c2275df53cf3a808f1f272f3d6134d1b920549

[54] 1270451 – A Blob URL object's origin property should not be "null" ( ()) https://bugzilla.mozilla.org/show_bug.cgi?id=1270451

[55] Treat (valid) blob: URLs as local in the resource fetch algorithm ( (@zcorpan著, )) https://github.com/whatwg/html/commit/f8bc379091f3afc71aa4133a05176a69bb01416e

[56] A URL's object can be a MediaSource or MediaStream object ( (annevk著, )) https://github.com/whatwg/url/commit/1099bb20c056ed5226ee36f20296fe5850fe1cc9

[57] Allow for a URL record's object to be a MediaSource or MediaStream · Issue #126 · whatwg/url ( ()) https://github.com/whatwg/url/issues/126

[58] Blob URLs for MediaStreams ( (Robert O'Callahan 著, 版)) http://lists.w3.org/Archives/Public/public-media-capture/2012Oct/0023.html

[59] MediaStream API - Web API Interfaces | MDN ( ( 版)) https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_API

[60] 1279493 – Use blob URLs exclusively rather than having mediastream and mediasource URLs ( ()) https://bugzilla.mozilla.org/show_bug.cgi?id=1279493

[61] Remove the GET method restriction for data URLs (annevk著, ) https://github.com/whatwg/fetch/commit/c4cb4f4a5fa90a72f1000449495aec04f6c8c96b

[65] Remove the URL.createFor method. (#62) (mkruisselbrink著, ) https://github.com/w3c/FileAPI/commit/c04e485a8d4eb93c62de873776b44a806b6e9c9c

[66] Fix several issues with the "Serialization of a Blob URL" algorithm. (#… (mkruisselbrink著, ) https://github.com/w3c/FileAPI/commit/b2e4c236d2015676e20e4bde52bce3d0ffc24a2f

[22] Refactor Blob URL Store definition. (#92) (mkruisselbrink著, ) https://github.com/w3c/FileAPI/commit/0fd8922f877b7701b9d364d9257c5d9d76971fae

[67] Clipboard API Improvements | WebKit () https://webkit.org/blog/8170/clipboard-api-improvements/

[68] Only allow blob: URLs that point to Blob objects (annevk著, ) https://github.com/whatwg/fetch/commit/8193ffef20b659a1ec1e6ae58831dd40fc08aad9

[76] fetch assumes a url's object is always a Blob · Issue #457 · whatwg/fetch () https://github.com/whatwg/fetch/issues/457

[77] Only allow blob: URLs that point to Blob objects by annevk · Pull Request #708 · whatwg/fetch () https://github.com/whatwg/fetch/pull/708

[78] Make status message default to the empty byte sequence (annevk著, ) https://github.com/whatwg/fetch/commit/0dec453f642c1fe57e6e7627c9a66cf7f8b8394d

[80] URL's object can no longer be a MediaStream (annevk著, ) https://github.com/whatwg/url/commit/21711b0c85bc489612a5e39473d525d903ead824

[81] Remove mention of MediaStream · Issue #380 · whatwg/url () https://github.com/whatwg/url/issues/380

[82] URL's object can no longer be a MediaStream by annevk · Pull Request #381 · whatwg/url () https://github.com/whatwg/url/pull/381

[83] Refactor Blob URL Store definition. (#92) (mkruisselbrink著, ) https://github.com/w3c/FileAPI/commit/0fd8922f877b7701b9d364d9257c5d9d76971fae

[84] Refactor Blob URL Store definition. by mkruisselbrink · Pull Request #92 · w3c/FileAPI () https://github.com/w3c/FileAPI/pull/92

[85] Firefoxblob:resource://pdf.js/77b77780-4e37-4b69-99b2-9d0c636ab46d?AttachedFile.txt のような URL を使うようです。

[88] Editorial: align with changes to URL and File API (mkruisselbrink著, ) https://github.com/whatwg/fetch/commit/939817ce80c08ac48232d8bce9ed1aca47567657

[89] Use definitions in FileAPI spec to resolve blob URLs and their origins. by mkruisselbrink · Pull Request #371 · whatwg/url () https://github.com/whatwg/url/pull/371

[90] there can be more than one Blob URL Store · Issue #290 · whatwg/url () https://github.com/whatwg/url/issues/290

[91] Origin of blob URLs doesn't match what implementations do · Issue #127 · whatwg/url () https://github.com/whatwg/url/issues/127

[92] Fix Blob Origin · Issue #20 · w3c/FileAPI () https://github.com/w3c/FileAPI/issues/20

[93] "origin of a blob URL" is redundant/confusing · Issue #63 · w3c/FileAPI () https://github.com/w3c/FileAPI/issues/63

[94] Follow changes from whatwg/url#371. by mkruisselbrink · Pull Request #857 · whatwg/fetch () https://github.com/whatwg/fetch/pull/857

[96] Use File API to resolve blob: URLs and their origins (mkruisselbrink著, ) https://github.com/whatwg/url/commit/d2ef633869b3f31d8c7e3bb76602400e4d2c126c

[97] Origin of blob URLs doesn't match what implementations do · Issue #127 · whatwg/url () https://github.com/whatwg/url/issues/127

[98] there can be more than one Blob URL Store · Issue #290 · whatwg/url () https://github.com/whatwg/url/issues/290

[99] Fix Blob Origin · Issue #20 · w3c/FileAPI () https://github.com/w3c/FileAPI/issues/20

[100] "origin of a blob URL" is redundant/confusing · Issue #63 · w3c/FileAPI () https://github.com/w3c/FileAPI/issues/63

[101] Use definitions in FileAPI spec to resolve blob URLs and their origins. by mkruisselbrink · Pull Request #371 · whatwg/url () https://github.com/whatwg/url/pull/371