title: How to detect third-party cookies had being blocked without a page refresh; [?]
body: <blockquote>
    <p>[?] detect <strong>third-party cookies</strong> had being blocked at <em>runtime</em>;
    without a page refresh;</p>
  </blockquote>
  
  <pre><code>JavaScript; localStorage Cookie; Block third-party cookies and site data;
  </code></pre>
  
  <p>creating Dynamic Self-Contained HTML Documents in which "<em>the Project</em>" is Offline First;<br>the detection of Third-party cookies happens by changing the browser settings, the cookie continue to set until the page is refreshed;</p>
  
  <blockquote>
    <p>sample code: using a <strong>try to catch</strong> "access" had failed(blocked);</p>
  </blockquote>
  
  <pre><code>if (typeof(Storage) !== "undefined") {
    try{
      localStorage.setItem("document","test");
      localStorage.removeItem("document");
    } catch(err) {
      alert("Cookies had failed to be set; Blocked!!");
    }
  }
  </code></pre>
  
  <blockquote>
    <p>sample code: using <strong>navigator.cookieEnabled</strong>;</p>
  </blockquote>
  
  <pre><code>if (!navigator.cookieEnabled) {
    //Sample Code here;
  } else { //Sample Code Here; }
  </code></pre>
  
  <p><hr>
  this situation only detects without a refresh the main cookie setting, not the third-party data;</p>