title: Firefox Storage Access API denies local storage after successful requestStorageAccess() call
body: <p>I want to test the new <a href="https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API#Storage_Access_API_methods" rel="noreferrer">Firefox Storage Access API</a> to allow 1st party storage (cookie, local storage, indexeddb, ...) to an iframe of a different domain (but still under my control). </p>
  
  <h2>Parent Markup / code</h2>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;Parent Domain&lt;/title&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jschannel/1.0.0-git-commit1-8c4f7eb/jschannel.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div&gt;
              Cookies: &lt;ul class="cookie-data"&gt;&lt;/ul&gt;
          &lt;/div&gt;
          &lt;iframe 
              id="rpc-gateway"
              src="http://child.local:8080/iframe-firefox.html"
              sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin"&gt;&lt;/iframe&gt;
          &lt;script type="text/javascript"&gt;            
              var chan = Channel.build({
                  window: document.getElementById("rpc-gateway").contentWindow,
                  origin: "*",
                  scope: "testScope"
              });
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>Child Iframe Markup / code</h2>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;Child Domain&lt;/title&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jschannel/1.0.0-git-commit1-8c4f7eb/jschannel.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;button onClick="onLoginClick()"&gt;Login&lt;/button&gt;
          &lt;script type="text/javascript"&gt;
              var chan = Channel.build({
                  window: window.parent,
                  origin: "*",
                  scope: "testScope"
              });
  
              let onLoginClick = function(trans, params) {
                  document.hasStorageAccess().then(hasAccess =&gt; {
                      if (!hasAccess) {
                          console.log("no access - requesting access");
                          return document.requestStorageAccess();
                      }
                  }).then(_ =&gt; {
                      document.hasStorageAccess().then(hasAccess =&gt; {
                          console.log("hasAccess:", hasAccess);
                          window.localStorage.setItem('foo', 'bar');
                      })
                  }).catch((err) =&gt; {
                      console.log("hasStorageAccess() failed", err);
                  });
              };
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When clicking on the "Login" button from the Child Iframe, the following log output is generated:</p>
  
  <pre><code>no access - requesting access      # iframe-firefox.html:22:25
  hasAccess: true      # iframe-firefox.html:27:25
  Request to access cookie or storage on “http://child.local:8080/iframe-firefox.html” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.      # iframe-firefox.html:28:24
  </code></pre>
  
  <p>The visible conclusion is:</p>
  
  <ul>
  <li>The promise document.hasStorageAccess() resolves</li>
  <li>The hasAccess parameter is initially 'false'</li>
  <li>The promise of document.requestStorageAccess() is returned and resolves</li>
  <li>The 2nd promise document.hasStorageAccess() resolves</li>
  <li>The hasAccess parameter is now 'true'</li>
  <li>nevertheless, simple storage access to local storage is not possible.</li>
  </ul>
  
  <p>What do I do wrong?</p>
  
  <p>More Info's:</p>
  
  <ul>
  <li>Firefox Developer Edition Version 65.0b9</li>
  <li>Content Blocking Setting: <a href="https://i.stack.imgur.com/XUydf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XUydf.png" alt="Content Blocking Setting"></a></li>
  </ul>