node-webkit

Is there a way to package chrome apps using nodejs-webkit

与世无争的帅哥 提交于 2020-01-03 10:54:06
问题 Lets say i have an app and i want it to be executable standalone. I've found that you can do that with normal webpages, webapps, using https://github.com/rogerwang/node-webkit. But if its chrome packaged app how do you do that. I know it's possible as you can see in slides it uses webkit. https://speakerdeck.com/u/zcbenz/p/node-webkit-app-runtime-based-on-chromium-and-node-dot-js 回答1: Theoretically it is possible but you will have to implement by hand all of the chrome apis you use in your

App window restore on keypress

 ̄綄美尐妖づ 提交于 2020-01-03 03:20:06
问题 In my app I have added a functionality to minimize app window to system tray on keypress (on ESC or Pause/Break buttons press). So when pressing them the window get minimized. Is there a way to add functionality to restore app window on certain keypress (even if other application will be currently active)? For example I press Pause and the window is minimized. I press Pause and the app window is restored. 回答1: Here is the solution extracted from node-webkit wiki : // Load native UI library.

Node-Webkit - Starting Maximized

懵懂的女人 提交于 2020-01-01 07:50:08
问题 I don't want a fullscreen application, but I would like to start a Node-Webkit application maximized. Can this be done? I am guessing its something to do with package.json, but can't seem to find what needs to be done. 回答1: I don't think the manifest has an option to do that. Instead, call nw's Window.maximize() on startup. Something like: // Load native UI library var ngui = require('nw.gui'); // Get the current window var nwin = ngui.Window.get(); Sometime later, in onload or some other

Node Webkit clear cache

半城伤御伤魂 提交于 2020-01-01 06:30:58
问题 I recently discovered that c:/Users/username/AppData/Local/AppName/Cache contained over 100K cache files. I read up a bit and saw that the gui.App.clearCache() method should fix this. I execute this method at start and at shutdown of the app. (after assigning gui to require("nw.gui") ) However, this doesn't seem to help. Nothing is being deleted. Any ideas why that is? 回答1: The require cache is apparently only available on global.require.cache . Clearing that cache manually made it work for

Right Click Menu using React JS

谁都会走 提交于 2019-12-31 09:17:13
问题 I'd like to know if there is a best practice/correct way to setup a right-click menu for a React component. I currently have this... // nw is nw.gui from Node-Webkit componentWillMount: function() { var menu = new nw.Menu(); menu .append(new nw.MenuItem({ label: 'doSomething', click: function() { // doSomething } })); // I'd like to know if this bit can be done in a cleaner/more succinct way... // BEGIN var that = this; addEventListener('contextmenu', function(e){ e.preventDefault(); // Use

Triggering event on change of element in unordered list in an iframe

回眸只為那壹抹淺笑 提交于 2019-12-25 17:45:24
问题 I am developing an app using node-webkit. I have an iframe which loads a webpage. The webpage has an unordered list and I would like to get a trigger if an element in the unordered list changes. <iframe id="app" src="https://www.somewebsite.com/" nwdisable nwfaketop></iframe> The unordered list does not have a class name and its only tag is data-reactid="XYZ" . However the first item in the unordered list always has a class name: .abc From another SO question (Call jquery function when <ul>

Writing text files with node webkit

ⅰ亾dé卋堺 提交于 2019-12-25 01:54:11
问题 I'm trying to do something rather simple: write a text file with data entered in a text input field to a file... var data = document.getElementById("fileContent").value; fs.writeFileSync("test.txt", data); For instance if I type in, Write this to file 123 123 I end up with this in the file... Write this to If I hard code a string into the application, it writes correctly. fs.writeFileSync("test.txt", "this is a hard coded string"); I tried using writeFileSync with and without the encoding

Node-Webkit: How to play AVI videos?

拟墨画扇 提交于 2019-12-25 01:49:31
问题 I am trying to make a simple node-webkit app that lets you play .avi videos (which should work both on windows and mac). Is there a way to do this with node-webkit? 回答1: It is unlikely you will be able to just do this with Node-Webkit. Especially since the official webkit does not support AVI. Your best bet is to use an external application like libav (avplay) or use node to serve a webpage that has a player capable of playing the content and just let the users browser do the work. (Flash is

Using phantom on Node webkit

大兔子大兔子 提交于 2019-12-24 12:37:28
问题 I am trying to scrape dynamic content in Node webkit by using Phantom . I have added phantomjs to env variable also. When i run the application i get a version mismatch error: "Uncaught Error: Module version mismatch. Expected 43, got 46." By running nw:version i get the following versions: nw.js v0.12.3 io.js v1.2.0 Chromium 41.0.2272.76 How should i get around this error? If you were able to implement similar functionality using some other package, let me know. 回答1: Native modules (phantom

node-webkit loading module fails

▼魔方 西西 提交于 2019-12-24 03:24:27
问题 I'm starting with node-webkit and I cannot load a module (a JS file) I made in my project. Here is the tree view : root |-index.html |-js/ |---app.js |---resources/ |-----angular..jquery.. |---crawler/ |-----leboncoin/ |-------lbcCrawler.js I want to load the module "mycrawler" in the "app.js", but I get the following error : Error: Cannot find module 'js/crawler/leboncoin/lbcCrawler.js' at Function.Module._resolveFilename (module.js:334:15) at Function.Module._load (module.js:273:25) at