branchseer / deskgap Goto Github PK
View Code? Open in Web Editor NEWA cross-platform desktop app framework based on Node.js and the system webview
Home Page: https://deskgap.com/
License: MIT License
A cross-platform desktop app framework based on Node.js and the system webview
Home Page: https://deskgap.com/
License: MIT License
npm start 成功了, 请问如何导出可运行版本, 如 win上的 exe
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?
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.
A pattern PUA/CoinMinter.Gen has been classified as riskware , on C:\Users\Jolly\Desktop\JollySoftware\deskgap\dist\DeskGap\DeskGap.exe
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?
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.
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
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
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!
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.
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.
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?
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 ?
Avira (Antivirus) suspect DeskGap.exe
as virus
How are permissions supposed to work ?
I've tried requesting microphone access, but with no success.
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.
how react with webpack
Unless I missed something, notifications are currently not working (at least on Windows).
Can notifications be supported?
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
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.
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?
It'll would be great if this lib support Webview2 :)
https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2
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)
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.
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. :)
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!
Using window.location.reload()
in code removes the window.deskgap
reference and all of the drag functionality from elements with the data-deskgap-drag
attribute.
Reloading with BrowserWindow
works fine.
Unsupported OS version: 10.0.17134
The minimum supported OS version is 10.0.17763
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:
Any recommendations for debugging ?
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 ;)
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');
});
What would it take to port the global shortcuts from electron to deskgap?
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
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
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!
Hey! Great work on this, super excited to try DeskGap on a personal project.
Perhaps you could find some ideas on how to add linux from this project: https://github.com/zserge/webview
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()
})
Is there any way to force the BrowserWindow userAgent? I'd like the UA to always be the same regardless of OS.
Thank's
Will deskgap support webkit2?
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" 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 ?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.