node-webkit

nodewebkit - documentation said screen will work, but its getting impossible to make it work

孤人 提交于 2019-12-11 14:37:53
问题 I am using latest nodewebkit and running the following code as per documentation ( https://github.com/rogerwang/node-webkit/wiki/Screen ) but its always failing. Can anyone please tell me why i have this error please and how do you fix it? <!DOCTYPE html> <html> <body> <script> function ScreenToString(screen) { var string = ""; string += "screen: "+ screen.id; return string; } var gui = require('nw.gui'); gui.Screen.Init(); var string = "" ; var screens = gui.Screen.screens; for(var i=0;i

Node-Webkit Tray on click bring window to front

大憨熊 提交于 2019-12-11 12:13:55
问题 I'm new to node-webkit and have the tray created as such var gui = require('nw.gui'); var tray = new gui.Tray({ icon: 'images/Appicon.png' }); tray.on('click', function() { console.log("what goes in here?")}); When the tray icon is clicked I want the window to be pulled up if it's minimized and open index.html. Right now I get the log statement to print. 回答1: Try this var gui = require('nw.gui'); var win = gui.Window.get(); var tray = new gui.Tray({ icon: 'images/Appicon.png' }); tray.on(

How to know if node-webkit app is running with Administrator/elevated privilege?

一世执手 提交于 2019-12-11 12:03:04
问题 How to determine if node-webkit is running with administrator privilege on Windows? 回答1: On windows, you can use the npm package is-admin, to check if the node process is elevated. const isAdmin = require('is-admin'); isAdmin().then(elevated => { if (elevated) { console.log('Elevated'); } else { console.log('Not elevated'); } }); There is also a cross platform implementation called is-elevated which bundles elevation checks for Unix and Windows 回答2: Using the node-windows module, you can call

Node.js fs get icon of files in directory

拥有回忆 提交于 2019-12-11 09:36:19
问题 I want to build a file system explorer app, and I want to list files with icons. I use node-webkit. And files can be executables, directories and normally files. In file list I want to diplay files icon and name. Can I use node.js fs module for getting icons? Or there a module for reading icons? How can I get icon of file? 回答1: Icons are dependent on the operating system / browser application and aren't a generic interface provided by node.js - you instead need to first resolve the type of

node webkit: export data to csv and prompt the user to save the file

不问归期 提交于 2019-12-11 09:05:45
问题 I could implement the export data to csv on node webkit with node fs modules. But now I want to prompt the user to save the file in his/her desired location. Like the download pop-up in case of html. I tried doing on the lines of this code and even this file dialog. Could someone help me find a way out of this. Here's my code. fs.writeFile("export.csv", data, function(err) { if(err) { console.log(err); } else { $('#export_file').show(); $('#export_file input').on('change', function (event) {

Custom URL Scheme Possible in Node-webkit application?

为君一笑 提交于 2019-12-11 08:47:05
问题 I've written a basic node-webkit application, and I also have a separate web application. I would like to be able to pass information to the node-webkit application from the web application directly, but from what I can tell so far this has not been done. I looked into using CORS, but this will not work when pointed outside of a web browser (I tried to point it at a file url [file://blahblah/blah] on the host machine). I realize that I could just run a webserver within the node-webkit

How to handle links that open _blank windows in node-webkit properly?

ε祈祈猫儿з 提交于 2019-12-11 02:46:15
问题 I'm trying to use new-win-policy event to handle link clicks that open new windows. https://github.com/rogerwang/node-webkit/wiki/Window#new-win-policy win.on('new-win-policy', newWinPolicyHandler); function newWinPolicyHandler(frame, url, policy) { gui.Window.open(url, { position: 'center', frame: true, toolbar: true, focus: true }); policy.ignore(); } After click on a link the handler isn't called. I got the message in console: [17120:1029/214512:INFO:CONSOLE(138)] ""Remove zombie callback

Node app created by enclose module getting shuts down on idle in production mode

爱⌒轻易说出口 提交于 2019-12-11 00:51:39
问题 I am working with a node.js application whose .exe has been made using Enclose module, although it is working fine, only problem is that the application automatically shuts down after 10 minutes opening if left idle, no interaction with it. Is it because of "Process working time" and "Network connections" are Limited in the free version? Will the app run continuously without shutting down if i subscribe to the full version? Will this issue be permanently fixed for the exe builds created with

Gridx/Dojo & jQuery : Is there a callback when sorting is completed?

北城余情 提交于 2019-12-10 21:17:30
问题 This table is generated using GridX / dojo in NodeWebkit. The "[BV][B][V]" are links that are handled by jQuery using class selector. However, once I sort the grid, the listeners are unbinded. How do I reapply the click function? Is there a callback when sorting & rendering is complete? 回答1: There is no callback or event that I know of when sorting is complete in gridx. However, the whole grid is re-rendered when it is sorted or filtered. So you can use something like: grid.connect(grid.body,

Building node-sqlite3 with nw-gyp

烈酒焚心 提交于 2019-12-10 19:44:37
问题 I am trying to build sqlite3 for a node-webkit. The sqlite3 page explains that it needs to be done with with nw-gyp As far as I understand it, I should download the source locally and then navigate to the src folder and run this (shown here): npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION) Thing is, whatever location I run that command, I get these errors: npm WARN package.json sqlite3@3.0.10 No licence field. npm WARN install