title: JavaScript - Check if Object URL has been used
body: <p>I can create an object URL like this:</p>
  <pre class="lang-js prettyprint-override"><code>let pixel = &quot;iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==&quot;;
  let data = atob(pixel);
  let buffer = new ArrayBuffer(data.length);
  let array = new Uint8Array(buffer);
  for (var i = 0;i&lt;data.length;i++){
      array[i]=data.charCodeAt(i);
  }
  let blob = new Blob([buffer], {type: 'image/jpeg'});
  let url = URL.createObjectURL(blob);
  </code></pre>
  <p>And I can revoke an object URL like this:</p>
  <pre class="lang-js prettyprint-override"><code>URL.revokeObjectURL(url);
  </code></pre>
  <p><strong>But what I would like to do is automatically revoke the URL after one use.</strong></p>
  <p><strong>Is there a way to check if an object URL has been accessed?</strong></p>
  <p>Thank you in advance.</p>
  <h2>EDIT:</h2>
  <p>In this case, I can't just trigger a function when I use the URL. Instead, I would like to be able to check if it has been used even OUTSIDE of the page. An example would be if someone typed the URL into the address bar, this can't call javascript AFAIK.</p>