Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 682589 of URL.revokeObjectURL()

  • Revision slug: Web/API/URL.revokeObjectURL
  • Revision title: URL.revokeObjectURL
  • Revision id: 682589
  • Created:
  • Creator: afreen
  • Is current revision? No
  • Comment

Revision Content

{{ApiRef("URL")}}{{SeeCompatTable}}

Summary

The URL.revokeObjectURL() static method releases an existing object URL which was previously created by calling {{domxref("window.URL.createObjectURL()") }}.  Call this method when you've finished using a object URL, in order to let the browser know it doesn't need to keep the reference to the file any longer.

Syntax

window.URL.revokeObjectURL(objectURL);
objectURL
is a {{domxref("DOMString")}} representing the object URL that was created by calling {{domxref("URL.createObjectURL()") }}.

Example

See Using object URLs to display images.

Specification

Specification Status Comment
{{SpecName('File API', '#dfn-revokeObjectURL', 'URL')}} {{Spec2('File API')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 8.0 with URL prefixed as webkitURL {{CompatGeckoDesktop(2.0)}} 10.0 15.0 6.0 with URL prefixed as webkitURL
7.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} with URL prefixed as webkitURL {{CompatGeckoMobile(14.0)}} {{CompatVersionUnknown}} 15.0 6.0 with URL prefixed as webkitURL
7.0

See also

Revision Source

<p name="Summary">{{ApiRef("URL")}}{{SeeCompatTable}}</p>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <strong><code>URL.revokeObjectURL()</code></strong> static method releases an existing object URL which was previously created by calling {{domxref("window.URL.createObjectURL()") }}.&nbsp; Call this method when you've finished using a object URL, in order to let the browser know it doesn't need to keep the reference to the file any longer.</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
window.URL.revokeObjectURL(<em>objectURL</em>);
</pre>
<dl>
 <dt>
  <em>objectURL </em></dt>
 <dd>
  is a {{domxref("DOMString")}} representing the object URL that was created by calling {{domxref("URL.createObjectURL()") }}.</dd>
</dl>
<ul>
</ul>
<h2 id="Example" name="Example">Example</h2>
<p>See <a href="/en-US/docs/Using_files_from_web_applications#Example.3a_Using_object_URLs_to_display_images" title="Using files from web applications#Example.3a Using object URLs to display images">Using object URLs to display images</a>.</p>
<h2 id="Specification" name="Specification">Specification</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('File API', '#dfn-revokeObjectURL', 'URL')}}</td>
   <td>{{Spec2('File API')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_Compatibility" name="Browser_Compatibility">Browser compatibility</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari (WebKit)</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>8.0 with <code>URL</code> prefixed as <code>webkitURL</code></td>
    <td>{{CompatGeckoDesktop(2.0)}}</td>
    <td>10.0</td>
    <td>15.0</td>
    <td>6.0 with <code>URL</code> prefixed as <code>webkitURL</code><br />
     7.0</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}} with <code>URL</code> prefixed as <code>webkitURL</code></td>
    <td>{{CompatGeckoMobile(14.0)}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>15.0</td>
    <td>6.0 with <code>URL</code> prefixed as <code>webkitURL</code><br />
     7.0</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also" name="See_also">See also</h2>
<ul>
 <li>{{domxref("URL.createObjectURL()") }}</li>
 <li><a href="/en-US/docs/Using_files_from_web_applications" title="Using files from web applications">Using files from web applications</a></li>
</ul>
Revert to this revision