Search code examples
htmlweb-applicationsconvertersdesktop-application

How do I convert web application into desktop executable?


I've HTML application build with AngularJS/jQuery/Bootstrap with AJAX REST API.
Is it possible to create executable/installer for Windows operating system?

Without any 3rd-party software, it should look like native application, but HTML.
For example, Slack messenger has web/mac/windows versions and they look same.

Any ideas?

// UPD

I probably need a wrapper (webview), but I need all features for EcmaScript5/CSS3.


Solution

  • Electron is the easiest way:

    1. Install

    2. Create and edit main.js:

    const electron = require('electron');
    const { app, BrowserWindow } = electron;
    
    let mainWindow;
    
    app.on('ready', () => {
        mainWindow = new BrowserWindow({
            width: 1000,
            height: 700
        });
    
        mainWindow.setTitle('title of the desktop app');
        mainWindow.loadURL('http://www.yourwebpage.com');
    
        mainWindow.on('closed', () => {
            mainWindow = null;
        });
    });
    

    3. Execute desktop app:

    electron main.js
    

    And to build the app, use a builder such as electron-builder.

    Hope that helps you!