I
I
Ivanq2015-11-27 20:14:01
JavaScript
Ivanq, 2015-11-27 20:14:01

JS window closing?

Hello dear toasts!
You need to write a web application. The user (on Windows) enters his user, instead of the explorer the browser (Chrome came up) is displayed in full screen mode, does something, then there is a "Logout" button on the page, which shows the user selection window.
Here's how it works for me now:
1. BAT is called through a parameter in the registry.
2. BAT opens Chrome via [chrome.exe -kiosk "127.0.0.4"].
3. Due to the fact that BAT is waiting for chrome to close, I put the command "shutdown / l" (user change).
I close chrome via Ctrl+W, but it is desirable to make a button on the page. To make "window.close()" work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg Matrozov, 2015-11-27
@Ivanq

The only thing that comes to mind is a small web server implemented, for example, in python, which will listen to a specific address like 127.0.0.1:8080/close and kill chrome when you click on it. Well, accordingly, on the site on the button, just make a transition to this address.

P
Pavel Bezrukov, 2015-11-27
@bezrukovPS

www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/Closi...

V
Vyacheslav Zolotov, 2015-11-28
@SZolotov

Use cef or cef sharp. This library is based on Chromium and it has the ability to pass js functions to C / C # code, and there it is not a problem to close the application. And there will be no dancing with tambourines and other registers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question