Git Product home page Git Product logo

branchseer / deskgap Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 75.0 724 KB

A cross-platform desktop app framework based on Node.js and the system webview

Home Page: https://deskgap.com/

License: MIT License

CMake 2.35% CSS 0.40% HTML 2.71% JavaScript 9.62% TypeScript 15.56% C++ 50.20% Objective-C++ 15.57% Objective-C 0.89% C 1.75% Shell 0.95%
cpp javascript linux macos nodejs typescript windows

deskgap's People

Contributors

branchseer avatar temporalagent7 avatar ziishaned avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deskgap's Issues

Cordova-Electron and code-signing

This is not an issue, but more of a question to get some things sorted in my brain 😉

Did you see the latest member of the Apache/Cordova project?
https://cordova.apache.org/announcements/2019/02/28/cordova-electron-release-1.0.0.html

They got the code-signing-stuff sorted out nicely. The caveat there is, that they wrap the complete Electron package into an application, which makes the application size really huge.

Would it be possible (and easier) to adapt their build-system and wrap node into the builds - like you do on this DeskGap project?

Unable to load localhost with loadUrl()

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.

Possible Malware Issues

A pattern PUA/CoinMinter.Gen has been classified as riskware , on C:\Users\Jolly\Desktop\JollySoftware\deskgap\dist\DeskGap\DeskGap.exe

Tray-Application

Thanks for this nifty project (there was an attempt a while ago by the apache foundation building such a thing using Cordova https://cordova.apache.org ) but that stalled.
Your approach is pretty good and works really well.
Since the application size comes way down, it seems as the project is also pretty good predestined to create tray/menubar-extra applications. But as far as I can see, there's no support for that - is that right?

No context menu

Hi,
First of all, thank you for this very useful module.
The only problem I find so far is that when pressing the right mouse button, there is no context menu. I have looked at the API, but cannot find a way to make it appear.

Can't run deskgap on Linux because of line endings

Hello,

I was following the guide in the README on Ubuntu Linux 19.04. When I tried to run yarn start I encountered the following error:

$ yarn start
yarn run v1.16.0
warning package.json: No license field
$ deskgap .
/usr/bin/env: ‘node\r’: No such file or directory
error Command failed with exit code 127.

If I execute /usr/bin/env node directly it works as expected:

$ /usr/bin/env node
Welcome to Node.js v12.4.0.
Type ".help" for more information.
> 

Eventually I was able to resolve the issue by running dos2unix on the cli.js file:

$ dos2unix ./node_modules/deskgap/cli.js
dos2unix: converting file ./node_modules/deskgap/cli.js to Unix format...

The file command shows that cli.js (and it looks like the rest of the files too) has CRLF line terminators:

$ file ./node_modules/deskgap/cli.js    
./node_modules/deskgap/cli.js: a /usr/bin/env node script, ASCII text executable, with CRLF line terminators

Name of app always DeskApp

Hi @patr0nus and thanks for amazing tool which we love to see and use.

I'm built app with DeskGap, but can't make it Name of app work.

Can you help me with this?

Also, is there any guide to built, distrubute (DMG convert)?

Note: It's my first app and i decided to use DeskGap instead of Electron because of app size and performance, so, please don't just leave or close issue as is

How to use asyncNode

Hi,
I'm trying to figure out how asyncNode is supposed to be used. I'd like to call node code (that returns a result) from the webview side. I guess one option would be to use the ipc mechanism and build some sort of map of request ids on top of that (similar to electron-promise-ipc), but it looks like asyncNode may have been designed to solve this exact problem, except I can't figure out how to use it. Any tips / examples?

What I'm looking for is something like this:
On the node.js side

function coolNodeFunction(argument: string): Promise<string> {
  return Promise.resolve('from node');
}

On the webview side

let result = await magic.invoke('coolNodeFunction', 'argument from web');

I've tried various combinations of deskgap.asyncNode.getGlobal().invoke() to no avail.

Thank you!

Losing my mind not being able to debug

Hi @patr0nus,

First of all, this project is a god given to all of us because I'm so sick of shipping GUIs that has a single button and 80+ MBs when packed. Electron really is great but rarely practical. I really appreciate the work you have done. Your framework is the only functional lightweight one that's out there.

But I'm having so much trouble not being able to debug either of the instances (Webview and Node). I'm on Windows 10 build 18363. The app simply doesn't show up on devtools.

image

And for the node process, --inspect doesn't work and there's no way to attach a debugger or get any kind of an output. I saw somebody else have mentioned this in #22 (comment) too. Trying to get this very urgent project up and running but can't go on blindly. I also have no idea how to have other node modules running when distributed inside the app directory.

I would really love it if you can give me some insight on how to get this up and running.

Fullscreen support?

I am testing out DeskGap for a new project, but really require fullscreen support. I can't see any mention of this on the site (API, etc.). Is it possible to achieve this?

C Building of DeskGap

Hello, Do you have any plan to impingement library for lunching just by using C ?
Something like webview-x ?
If is it possible currently, could you please describe how can i do this ?

[Question] Permissions

How are permissions supposed to work ?

I've tried requesting microphone access, but with no success.

Unmanaged implementation & MSHTML support for Windows

The current implementation is based on WinForms, C++/CLI and Microsoft.Toolkit.Forms.UI.Controls.WebView.

Related files:

Obviously a pure win32 implementation is better (shorter startup time, lower memory consumption). I just didn't know EdgeHTML WebView was possible in unmanaged Win32 applications until I saw how zserge/webview did it. <---- This link can be a great reference for DeskGap's implementation.

After the unmanaged implementation is done perhaps we can also provide a MSHTML WebView implementation as a fallback for lower versions of Windows. Delay-Loaded DLLs might be useful in this case.

远程过程调用失败

按照readme的代码,刚开始npm start以后没反应,看了一下进程发现Deskgap.exe卡死。
手动结束进程,再之后就这样了。

版本信息:
Windows10专业版 1809
操作系统版本 17763.253

snipaste_2019-02-13_17-04-45

Support Desktop Notifications

Unless I missed something, notifications are currently not working (at least on Windows).

Can notifications be supported?

Double windows created

This snippet create two window, one blank (mainWindow.show()) and one with the website loaded (mainWindow.loadURL())

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

app.once('ready', () => {
    const win = new BrowserWindow();
	
	mainWindow = new BrowserWindow({
        show: false,
        width: 1280, height: 720,
    }).once('ready-to-show', () => {
        mainWindow.show();		
		// mainWindow.maximize();
    });	   
	mainWindow.loadURL("https://discordapp.com");
	
	mainWindow.on('closed', () => {
        mainWindow = null;
    });
});

My guess: loadURL should take effect inside the associated window instead of creating a new one

Ways to contribute?

Sorry if this is the wrong place to put this, but what kinds of tasks need to get done to move this project forward? I'm very interested in seeing DeskGap take off, so I'd love to help any way I can.

Window doesn't go on top on MacOS

Hello!

I'm noticing that when I run DeskGap on MacOS, the created window stays below terminal.. Is there a way to force newly opened window to be on top?

Failing to load files in subfolders

I can't seem to load any javascript/css files that are in subfolders. The message for css files is: "Failed to open ms-local-stream://microsoft.win32webviewhost_cw5n1h2txyewy_4465736b4761704c6f63616c436f6e74656e74/css/main.css" and javascript files are just blank.

image

Icon not showing

I tried using

new BrowserWindow({ icon: 'favicon.ico' });

I tried with .ico, .png and .icns, too.
I even tried to set it using .setIcon().
Does anyone know how to make it show a custom icon?

(Note: using Windows 10)

When will maximize and full-screen support be implemented?

I'm currently developing an application right now and I was wondering when will the maximize and full-screen support be implemented. There is maximize support but it does not auto-maximize the view on the spot. The user has to manually click the maximize button.

Need an app packaging solution

Hi,

This project looks really good!
I would love to give it a try but I can't seem to find any information related to releasing a DeskGap project?

Any hints?

Thank you. :)

Some docs for compiling

It's good to watch this how to go forward. Thanks!

I don't need desktop notifications or electron like API's. I just wanna build a preview desktop for my website. Can you add more docs for compiling, please?

I understand this is alpha now and things can be changed at any time. But I want to give it a shot!

Linux support

Related branch: gtkwebkit.

Since Linux doesn't have a "system webview", we need to choose one among existing webview libraries to dynamically link to. The obvious choices are webkit2gtk and QtWebEngine. (The predecessors of them, webkitgtk and QtWebKit, are both deprecated)

I preferred QtWebEngine but chose webkit2gtk in the end. Here are the reasons:

  • webkit2gtk is preinstalled in more Linux distros than QtWebEngine;
  • webkit2gtk and macOS' WKWebView share the same engine: WebKit, and have similar APIs, resulting in more consistent behaviours across Linux and macOS.

Handling Custom URL Calls

Could you implement handleOpenURL on mac?

In order for your app to respond when it receives a custom URL call, you must implement the application:handleOpenURL method in the application delegate class:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  callbacks_.onOpenURL(url.absoluteString);    
  return YES;
}

The rest of the coding is above my paygrade ;)

maxWidth and maxHeight makes window disappear

When setting maxWidth (or maxHeight), and starting to drag one of the edges to resize the window, it disappears. The app is still running but with no window.

On macOS and DeskGap 0.0.1.

app.once('ready', () => {
    const mainWindow = new BrowserWindow({width: 300, height: 800, maxWidth: 800});
    mainWindow.loadURL('http://example.com');
});

Error following tutorial

image

I've followed the tutorial, then running the app show this message.

Windows 10 1809
NodeJs 10.15.0

EDIT:
Running the prebuilt exe from the release page by double clicking the executable works fine
It also woks fine if I change things inside the files
It stop working If I use my terminal to run either the exe or npm start

My terminal is Cmder
Finally, works fine from Powershell. Both exe and npm start

To sum up: Using (at least) Cmder make DeskGap to crash

Logo proposal

hi @patr0nus ?
I am a designer want to make a logo for this project.I just need a permission to start working with that if you have any requirement to the design then let me know.
thanks

How do I package and distribute apps?

I am delighted to have discovered this project, since it uses the OS's system webview, and am greatly looking forward to developing with DeskGap! However, I am unsure on how to actually package and distribute the app I have built with DeskGap. I have found Issue #5 relating to this, however the instructions could be more specific. Could you give me some pointers on how to effectively package the app for Windows and Linux?

Thank you!

click action not fired in MenuItem

In my javascript file I use the code below to trigger a context menu. Notice that I used two different methods to trigger the click, however none of them work. The context menu is displaying as it should btw, just the click handlers are not triggered. How should this be done?

    const asyncDeskgap = deskgap.asyncNode
    const curWin = asyncDeskgap.getCurrentWindow()
    asyncDeskgap.require('deskgap').then(deskgap => {
        deskgap.prop('Menu')
            .invoke('buildFromTemplate', 
                [{ 
                    'label': 'label one', 
                    onClick() {
                        console.log('click')
                    } 
                }, {
                    'type': 'separator'
                }, { 
                    'label': 'label two', 
                    click() {
                        console.log('k do this')
                    } 
                }])
            .invoke('popup', curWin).value()
    })

Can I edit the userAgent ?

Is there any way to force the BrowserWindow userAgent? I'd like the UA to always be the same regardless of OS.

Thank's

use webdriver for setup a basic view with websocket ?

Hi,

not sure if you considered that idea...
webdriver is supported by all browsers but being HTTP, it brings latency. If performance is a concern for exchanging between node and the webview content, the webview could connect to a websocket server set up by node.

Can't find variable: require

"Can't find variable: require" is displayed in the bowser javascript console when trying to use fs native node library with :

var fs = require('fs');

Any idea to solve the issue ?

(OSX) Inconsistent tab key behavior

On Mac OSX, WKWebView doesn't focus links or buttons when pressing the tab key. It only gives focus to text inputs (unless "fullKeyboardAccessEnabled" is turned on in system prefs).

This isn't a bug with DeskGap, but it's a really unfortunate consequence of WebKit design decisions. Edge, Firefox, Chrome and Electron all give tab focus to links by default. Arguably most developers (and most users as well) will be surprised and frustrated by this, so it would be a nice experience for DeskGap to patch the tab key behavior.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.