Before minimizing the node-webkit window it looked like this:
After restoring the node-webkit window it looked like this:
package.json
{
"name": "Gallay",
"description": "Simplified Billing",
"version": "0.1",
"main": "index.html",
"window": {
"icon": "icons/16.png",
"show": true,
"toolbar": false,
"frame": true,
"position": "center",
"width": 507,
"height": 570,
"min_width": 507,
"min_height": 570,
"max_width": 507,
"max_height": 570
}
}
I need fixed width while minimizing and restoring the node-webkit window. How can I solve the above problem?
After including jQuery and the following JavaScript, the problem can be solved.
$(document).ready(function(){
$(window).resize(function(){
window.resizeTo(507,570);
window.focus();
});
});
Add to package.json: "resizable": false and remove min_width, min_height, max_width, max_height.
Related
Ive tried 64, 32px, 24px, 16px FAVICON.png in the same DIR as the manifest file. No luck. I also tried and ICO with ever 32bit size.
package.json
{
"main": "INDEX.html",
"name": "cacluclator",
"description": "NWJS SMART CALCULATOR",
"version": "00.00.00",
"keywords": [ "SMART CALCULATOR", "INSECURITY" ],
"window": {
"title": "SMART CALCULATOR",
"icon": "FAVICON 32.png",
"frame": false,
"toolbar": true,
"transparent": true,
"position": "center",
"height": 500,
"min_height": 500,
"max_height": 500,
"width": 400,
"min_width": 400,
"max_width": 400
},
"webkit": {
"plugin": true
}
}
I have a very peculiar issue, I have a Neutralino app built with Preact that runs perfectly fine when run with neu run, however, once I build the project (with enableServer on or off), the built application will not load anything.
With enableServer on, it will complain that it cannot connect to localhost:
"This localhost page cannot be found"
and with it off it gives me a completely white screen/DOM.
The GitHub repository is here: https://github.com/SpikeHD/XeniaLauncher
I suspect it may be the way I am building the project, but I find it weird that neu run works completely fine.
Below is my configuration:
{
"applicationId": "js.xenia_launcher.app",
"version": "1.0.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/build/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true
},
"nativeAllowList": [
"app.*",
"os.*",
"filesystem.*",
"storage.*",
"window.*",
"debug.log"
],
"modes": {
"window": {
"title": "XeniaLauncher",
"width": 1000,
"height": 800,
"minWidth": 400,
"minHeight": 200,
"fullScreen": false,
"alwaysOnTop": false,
"icon": "/resources/icons/appIcon.png",
"enableInspector": true,
"borderless": false,
"maximize": false,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
},
"browser": {},
"cloud": {
"url": "/resources/#cloud",
"nativeAllowList": [
"app.*"
]
},
"chrome": {
"width": 1000,
"height": 800,
"args": "--user-agent=\"Neutralinojs chrome mode\""
}
},
"cli": {
"binaryName": "XeniaLauncher",
"resourcesPath": "/resources/",
"extensionsPath": "/extensions/",
"clientLibrary": "/resources/js/neutralino.js",
"binaryVersion": "4.4.0",
"clientVersion": "3.3.0"
}
}
Fixed it! I ended up just setting up some scripts that will put all the built Preact code into the resources folder and re-setup my config to only use the resources folder, like the original Neutralino template. I am sure there could have been a more elegant way, but I am still just learning Neutralino and Preact so this works perfectly well enough for me.
It looks like the resourcesPath needs to be set to the directory where your index.html is found. I have a public dir, and moved the icons over there, then set resourcesPath to /public/ and I was able to neu build --release and run.
My media host is using JSONP to embed videos. I embed this script, along with a few others, in order to embed videos. My understanding is that it's using JSONP in order to overcome CORS issues.
What I do not understand is the last line of the script.
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'];
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = {
"media": {
"assets": [{
"type": "original",
"slug": "original",
"display_name": "Original file",
"width": 1920,
"height": 1080,
"ext": "mp4",
"size": 109515791,
"bitrate": 16127,
"public": true,
"status": 2,
"progress": 1.0,
"url": "https://embed-ssl.wistia.com/deliveries/9b53a11c8a871733aadd479d26a10d4555de2d66.bin",
"created_at": 1522785172
}, {
"type": "still_image",
"slug": "still_image_1920x1080",
"display_name": "Image",
"width": 1920,
"height": 1080,
"ext": "jpg",
"size": 216848,
"bitrate": 0,
"public": true,
"status": 2,
"progress": 1.0,
"url": "https://embed-ssl.wistia.com/deliveries/bf2cc0bf9de369545df9c9fa8be8371ab8b12f56.bin",
"created_at": 1522785744
}],
"options": {}
};
window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'] = window['wistiajsonp-/embed/medias/8up1lc9606.jsonp'];
(Redacted for the sake of brevity)
Regarding the linked question: I am not talking about Swift; I am talking about JavaScript. Secondly, what I'm asking is directed at the purpose, not the implementation of such "self-assignment".
I'm developping a desktop app using NWJS. I have a problem when I try to maximize the window. The button appears disabled, so I can`t maximize the window, only let me closing and minimizing the window.
Thats my package.json:
{
"name": "APP",
"main": "index.html",
"icon": "icon.png",
"version": "0.0.1",
"window": {
"title": "APP",
"icon": "icon.png",
"toolbar": false,
"resizable": true,
"frame": true,
"fullscreen": false,
"width": 1280,
"height": 1024,
"min_width": 360,
"min_height": 640,
"max_width": 1920,
"max_height": 1080,
"position": "center"
}
}
Anyone could help me? It was grateful. Thanks!
When your app starts do something like this...
var MaxWin=require('nw.gui').Window.get();
MaxWin.setMaximumSize(0,screen.availHeight);
And later use a couple of icons or buttons to maximize/minimize like this...
<input type="button" onclick="MaxWin.minimize();" value="Minimize">
<input type="button" onclick="MaxWin.maximize();" value="Maximize">
I have created the app using node-webkit . But when i click on gte.exe it giving nw.js empty scree.
my JSON file is:
{
"main": "index.html",
"name": "app",
"description": "app",
"version": "0.2.3",
"nodejs": true,
"window": {
"title": "app",
"icon": "favicon.ico",
"toolbar": false,
"frame": true,
"width": 1200,
"height": 768,
"min_width": 1024,
"min_height": 768,
"resizable": true
},
"webkit" :{
"plugin":true
},
"chromium-args": "--disable-web-security --experimental-location-features --enable-geolocation --allow-file-access-from-files --allow-file-access --enable-device-policy"
}
I changed my folder into zip and changed to .nw extension. After that i ran D:\nw>copy /b nw.exe+app.nw gte.exe .
Please any one help me out