Murad Elboudy
Murad Elboudy

Reputation: 483

onclick kiosk mode to another opened window

I'm working on a NW.js app and one of the requirements is that when a new window is opened window.open then there must be a button to enable it in kiosk mode since this opened window will be extended to another screen for display. I can't seem to do it. I don't know how I can target this new window which I opened. Even in the browser I can't figure it out. I spent two days on this and still.

I tried using this but with no success:

openWindowBtn.addEventListener('click', function(){
    slavePanelWindow = window.open('url', 'SlavePanel', "height=400,width=700");
    setInterval(function(){gui.Window.get().enterKioskMode();}, 5000);
});

I thought if I dragged the new opened window quickly to the extended display then waited without selecting any other window then this new opened one would enter the kiosk mode.

P.S. I can't open the new window directly to kiosk mode. There must be a button which does this.

Upvotes: 2

Views: 2746

Answers (1)

Saket Patel
Saket Patel

Reputation: 6683

// Open a new window and enable kiosk.
nw.Window.open("url", {
    "width": 700,
    "height": 400
}, function(win) {
    win.on('loaded', function() {
        win.enterKioskMode();
    })
});

Upvotes: 1

Related Questions