Closed Bug 1245960 Opened 8 years ago Closed 8 years ago

base 64 pdf/iframe

Categories

(Firefox :: Untriaged, defect)

44 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: cvenkel.miran, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160123151951

Steps to reproduce:

<!---HTML & javascript to return base64 encoded pdf from server (saved as db blob there)-->

<iframe  allowtransparency="true" id ="pdfFrame" style="float:none;display:inline;width:100%;height:100%;-moz-box-sizing:border-box;z-index:1000;" src="" frameborder="0"></iframe>


/*http://stackoverflow.com/questions/8022425/getting-blob-data-from-xhr-request*/
        function loadPdfBlob(u_id)
        {
          var xhr = new XMLHttpRequest();
xhr.open('GET', contextPath + '/servlets/GetBlobDataServlet?u_id='+u_id, true);

xhr.responseType = 'arraybuffer';

xhr.onload = function(e) 
{
 
  if (this.status == 200) 
  {
    
    var uInt8Array = new Uint8Array(this.response);
    var i = uInt8Array.length;
      
    var binaryString = new Array(i);
    while (i--)
    {
      binaryString[i] = String.fromCharCode(uInt8Array[i]);
    }
    var data = binaryString.join('');

    var base64 = window.btoa(data);
    //alert(base64);
    document.getElementById("pdfFrame").src= "data:application/pdf;base64,"+ base64;
    
    //var blob = this.response;
    //alert(blob);
    //document.getElementById("pdfFrame").src =  window.URL.createObjectURL(blob);
    
  }
  else
  {
    alert(this.status);    
      
  }    
};


Actual results:

No expected results.


Expected results:

Test page: http://agrozoo.net/jsp/a_oglasna_deska.jsp
Open in google chrome, Click on B button.
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Could you explain the bug, please.

When I click on the button "B", a 2-page PDF is loaded on the right side.
What's the role of the button "test"?
Flags: needinfo?(cvenkel.miran)
Ignore test button.
2 page pdf is loaded on B click, only in google chrome. Not in FF, nither in IE. At least at me.
Flags: needinfo?(cvenkel.miran)
Hmm, yes, that does the trick.
Created new default profile (empty I presume), and set it as 'use automaticaly as defult' at startup.

Any way to step by step import things from old profile to see what blocks the thing ?
also note, at old profile, when test page opened in fresh started FF (only then ), click B, I'm firts asked in right half of screen to 'activate adobe acrobat'. Cick that and pdf does not show ...
old profile:

tested following: tools/ plugins disable adobe acrobat 11.0.13.

Gets me closer, instead of nothing, pdf file gets downloaded now. Does not appear at expected iframe.
OK. Next step: Tools/options/applications/pdf 
change to preview in firefox.

Works. Thanks for help.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.