Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html>
  <head>
    <title>Cross-origin resouce status leak via MediaError </title>
  </head>
  <body>
    <div id="contents">
      <p><code>MediaError</code> message property can be used to
        detect cross-origin response status.</p>
      
      <p>When a cross-origin request succeeds (200 OK), <code>MediaError.message</code>
        will be <code>"Failed to init decoder"</code>. The same message will be <code>"404: Not Found"</code>
        for URLs that are not found. The difference can be used to detect
        cross-origin response status.</p>
      
      <p>Compare <strong><code>https://stackoverflow.com/404</code></strong> and
        <strong><code>https://stackoverflow.com/</code></strong> using the input box below.</p>
      
      <input id="testUrl" type="text" value="https://stackoverflow.com/404"></input>
      <button id="startTest">Test</button>
      <audio autoplay id="audio"></audio>
      <div id="log"></div>
    </div>
  </body>
</html>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers