Window.open with empty url does not work


#1

I’ve built an application that uses window.open (which is apparently not very well-supported) and I’ve just now tried making it work with electron. After a bit of messing around, I got it to work, but I noticed my window.open call simply refuses to work. Code is as follows:

    const reportWindow = window.open('', this.formattedReportName, 'height=500&width=500');

    if(!reportWindow) {
      throw new Error('Report window could not be opened. Probably, something is blocking popups?');
    }

Basically, what I do here is write to the document manually with the HTML I generate:

    reportWindow.document.write(reportAggregate(this.currentReport, this.formattedReportName, this.settings, transformedData));

What can I do to make this work? I can’t find an example of electron with no url, but truly there is no file:// I can use or url that I can use, I just need an empty window.