Quantcast
Channel: Loading a website and html file in electron - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by ben_foster04 for Loading a website and html file in electron

$
0
0

In the interests of keeping threads up to date, I'd recommend reading through the Web Embeds page in the Electron documentation. The accepted answer isn't recommended by Electron.https://www.electronjs.org/docs/latest/tutorial/web-embeds

I'm currently developing a Kiosk application designed for Raspberry Pis which similarly only displays another web page. You could rely upon the native application window structure in the Constructor Options for BrowserWindow or BaseWindow to handle your application control (Max/Min/Close). See below

const mainWindow = new BaseWindow({    width: 1920,    height: 1080});const view = new WebContentsView();// Put your URL in hereview.webContents.loadURL("https://bapbap.gg");// This expands the WebContentsView to the max bounds of the BaseWindow parent.view.setBounds(mainWindow.getBounds());// Now add it to the BaseWindow parentmainWindow.contentView.addChildView(view);

Viewing all articles
Browse latest Browse all 3

Trending Articles