We are using this approach to open the content of a PDF document in another tab
var win = window.open();
win.document.write('<iframe src="data:application/pdf;' + someDoc.url + '" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>')
However it seems that over some size the tab freezes and stays in continue loading. I have tried also with 5MB documents.
Is there any better approach to avoid this problem.
Browser used: Google Chrome 80.0.3987.122 or Firefox Extended Support Release (ESR)