branchseer / DeskGap

A cross-platform desktop app framework based on Node.js and the system webview
https://deskgap.com/
MIT License
1.83k stars 75 forks source link

Unable to load localhost with loadUrl() #50

Closed blaconix closed 4 years ago

blaconix commented 4 years ago

Hello,

I'm currently trying to run a Vue CLI 4 project inside DeskGap 0.3.0 using the following code:

const { app, BrowserWindow } = require('deskgap');

app.on('ready', () => {
    const win = new BrowserWindow({
      frame: false
    });
    // win.loadFile('index.html');
    win.loadURL('http://localhost:8080/')
});

Problem is that the URL is not loaded and instead I get about:blank. This only happens when I load localhost. When loading an external URL (example.com) everything works. I also have the exact same code in electron and it works.

Platform is Win 10 20H1 and Node 13.10.

branchseer commented 4 years ago

This is a limitation of EdgeHTML WebView. It can't access localhost servers.