Reputation: 14596
Is it possbile to inject raw html code into a BrowserWindow
?
mainWindow = new BrowserWindow({width: 1200, height: 800});
mainWindow.loadURL("<p>Hello, World!</p>");
The above code will crash because loadURL
only accepts a file path.
Upvotes: 2
Views: 2753
Reputation: 5714
You can use data urls to accomplish this:
mainWindow.loadURL("data:text/html,<p>Hello, World!</p>");
Upvotes: 7