title: "Permission denied to access property 'print' " in Firefox when printing PDF from DynamicReport. Changing 'pdfjs.disabled' not helped
body: <p>I am using Dynamic Report in Servlet to generate a PDF and out put it to jsp page using the code</p>
  
  <pre><code>report.toPdf(response.getOutputStream());
  </code></pre>
  
  <p>In Jquery I am loading the pdf in a new window as a popup</p>
  
  <pre><code>var newWindow = window.open(url, 'name', 'height=800,width=1000');
              if (window.focus) {
                  newWindow.focus();
                  setTimeout(function() {
                      newWindow.print();
                  }, 2000);
              }
  </code></pre>
  
  <p>But this returns an error</p>
  
  <blockquote>
    <p>Error: Permission denied to access property "print"</p>
  </blockquote>
  
  <p>Firefox version is 43.0 . I tried changing 'pdfjs.disabled' to 'true' in about:config, but that's not  helping: when that's set and tried to print, the window closes automatically right-away and the pdf gets auto-saved and console shows the error: </p>
  
  <blockquote>
    <p>"NS_ERROR_NOT_AVAILABLE:"</p>
  </blockquote>
  
  <p>.</p>
  
  <blockquote>
    <p>Updated Question</p>
  </blockquote>
  
  <p>I just realized the problem is not just with print, I tried retrieving the HTML contents from the page with.</p>
  
  <pre><code>setTimeout(function() {
                  $(newwindow.document).ready(function() {
                      $(newwindow.document).find("body").on("load", alert($(newwindow.document).find("body").html()));
                  });
              }, 2000);
  </code></pre>
  
  <p>The returned an error,</p>
  
  <blockquote>
    <p>Error: Permission denied to access property "document"</p>
  </blockquote>
  
  <p>Now if I remove the setTimeout() function on both the above codes, first one will print a blank page, and second alerts blank. i.e, the contents are not getting loaded by then i guess.</p>