title: Listen for changes with localStorage on the same window
body: <p>I want to listen for changes that are happening in the localStorage API on the same page (Not in multiple tabs like the spec says).</p>
  
  <p>I am currently using this code:</p>
  
  <pre><code>var storageHandler = function () {
      alert('storage event 1');
    };
  
    window.addEventListener("storage", storageHandler, false);
  
  localStorage.setItem('foo', 'bar');
  </code></pre>
  
  <p>Does anyone know a vanilla JavaScript way to listen to events on localStorage on one page (no jQuery)</p>