nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

trying to close a fullscreen window

Open Jrags87 opened this issue 14 years ago • 3 comments

I have setup everything related to the package.json file to allow the app to open in fullscreen, but when trying to call window.close() nothing happens? How am i supposed to reference the window API? What am I doing wrong?

An example of what I would like to do: Have the app launch in fullscreen initially, and then allow the user to press say the ESC key to close the window.

Thanks.

Jrags87 avatar Dec 04 '12 19:12 Jrags87

Tested node-webkit v0.3.5-pre on Windows XP and found that window.close() happily closes the initially fullscreen window.

What's your system and node-webkit version?

Mithgol avatar Dec 05 '12 11:12 Mithgol

Thank-you for responding, I am using Windows 7 64-bit, and using node-webkit version v0.3.5. If you could provide some sample code as to how I close the fullscreen window that would be great.

Maybe this makes a difference, in the package.json file I am specifying a url (https://www.blah.com), instead of using a locally hosted file for main.

UPDATE: I tested using a local file, and that closes fine. I have actually used a bit of a hack that will close the window now ( window.open('', '_self'); window.close(); ).

Thanks

Jrags87 avatar Dec 05 '12 15:12 Jrags87

could you please try to do it with our native API: https://github.com/rogerwang/node-webkit/wiki/Window

rogerwang avatar Jan 14 '13 05:01 rogerwang