0

we are working in react application, in that we want to show the pdf content in new tab for all the browsers. below code working fine in all browsers except IE11. in IE11 we are getting "Access Denied " message error. i referred lot of links but no luck

const binary = atob(response.content.value.replace(/\s/g, ''));
            const len = binary.length;
            const buffer = new ArrayBuffer(len);
            const view = new Uint8Array(buffer);
            for (let i = 0; i < len; i++) {
                view[i] = binary.charCodeAt(i);
            }

            const blob = new Blob([view], { type: "application/pdf" });
            const url = URL.createObjectURL(blob);
            //url will be "blob:888-ggg-ggggasdsad"
            window.open(url, "_blank");

we are using typescript in react application. above code opening pdf in chrome browser. but in IE11 it is throwing access denied error. we don't want to use iframe like below links,

Displaying Blob PDF in Edge/IE11 IE how to open blob object in new Tab

Is there anyother way of achieving this functionality to open the PDF content in IE11.

SivaRajini
  • 7,225
  • 21
  • 81
  • 128
  • those two links seem to indicate that Internet Explorer is incapable of doing what you want - since IE11 is a dead browser, and no development is being done on it, certainly nothing in the last 3 years since those two actual solutions the the problem were posted, I dare say you'll need to either stop supporting IE11, or deal with it as those two answers have - I'm tempted to close your question as a duplicate of https://stackoverflow.com/questions/37937876/ie-how-to-open-blob-object-in-new-tab ... because it is a duplicate – Jaromanda X Mar 23 '19 at 07:03
  • this may help you https://stackoverflow.com/questions/2792069/permission-denied-on-ie-using-window-open https://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab – Kishan Jaiswal Mar 23 '19 at 12:41

0 Answers0