title: Reading plan/text from blob url
body: <p>The requirement is to read the pdf text to a String using Java for testing purpose. I am not sure if it is possible to extract the content using <em>Blob</em> url extracted from the browser.</p>
  
  <p>This is what I see in DOM</p>
  
  <pre><code>&lt;embed id="plugin" type="application/x-google-chrome-pdf" src="blob:https://XXX.XX.XXX.com/d4c1b2ec-bd22-4e7c-aa41-31d6ba5212b3" stream-url="blob:chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/141ca21a-5f63-410b-a4c8-dc9a0554eb77" headers="Content-Length: 8159 Content-Type: application/pdf " background-color="0xFF525659" top-toolbar-height="56"&gt;
  </code></pre>
  
  <p>I was initially thinking there should be a way to extract the text(plain or base64 encoded) and then convert it to a specific format but I was unable to find any answer because of my limited understanding of Blob url. </p>
  
  <p>This is what I have tried so far and I get null response.</p>
  
  <pre><code>var xhr = new XMLHttpRequest;
  xhr.responseType = 'text';
  
  xhr.onload = function() {
     var recoveredBlob = xhr.response;
  
     var reader = new FileReader;
  
     reader.onload = function() {
       var blobAsDataUrl = reader.result;
       window.location = blobAsDataUrl;
     };
  
     reader.readAsDataURL(recoveredBlob);
  };
  
  xhr.open('GET', 'blob:https://XXX.XX.XXX.com/d4c1b2ec-bd22-4e7c-aa41-31d6ba5212b3');
  xhr.send();
  </code></pre>
  
  <p>It is also worth mentioning that, I am executing this script using Selenium. My goal is to extract data without downloading the pdf into any local machine. So, ultimately I have two confusions:</p>
  
  <ol>
  <li>Is it possible to extract data from a blob url which was created as 'Content-Type: application/pdf'?</li>
  <li>Is there any other way; possibly, converting blob url to dataurl and then extract the content as String? </li>
  </ol>