Why windows.open() is not working as expected?

100 Views Asked by At

I have created url object with Blob and it's type is 'application/pdf'

const [url, setUrl] = useState('');
setUrl(URL.createObjectURL(mediaSource)); // mediaSource is a Blob
useEffect(() => {
if (url) window.open(url, '_blank')
[url]);

By this useEffect(), url is opening in another tab but pdf occupying less space and added scroll bars to it

Partially loading image

If I copy and paste same url in another chrome tab it is working as expected Expected image

I tried these, but nothing work. Please help !

window.open(url, '_blank', "height=500");
window.open(url, '_blank', "fullscreen=yes");
0

There are 0 best solutions below