0

I was facing some problems finding a way to open a blob from an Aura (Lightning component) in a new tab of the browser, the window.close() function doesn't work because open with base URL of the lightning context

1 Answer 1

0

I was able to open a new tab with the lightning navigation event like below

var binaryData = [];
binaryData.push('SomeBinaryStringComehere');
var fileURL = window.URL.createObjectURL(new Blob(binaryData, { type: "application/pdf" }));
// var tab = window.open(fileURL); //this doesn't works well

var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
    "url": fileURL 
});
urlEvent.fire();

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .