python-eel/Eel

close_callback -> how can I close any additional windows that are still open?

Open

#283 geöffnet am 21. Apr. 2020

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (570 Forks)batch import
help wanted

Repository-Metriken

Stars
 (5.980 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Hello, First of all, thank you for eel and the support. the package helps me a lot!

I've created a 2 window app. the first one is launched by eel.start() and the second one is spawned from js code with window.open()

I'm trying to close the secondary window if the main one gets closed. So far I've managed to close the websocket by the close_callback function but no idea about how to close the browser itself...

Is there a built-in way to do it from eel or the websocket that I receive?

import eel

def eel_close_callback(closed_window_relative_path, list_of_opened_websockets):
    if closed_window_relative_path == main_window_path':
        for websocket in list_of_opened_websockets:
            websocket.close()


eel.start(config['db_handler_html_path'], size=size, close_callback=eel_close_callback)


<html>
   let map_window = window.open('map.html');
</html>

Desktop:

  • OS: linux
  • Browser chromium, chrome
  • Version 80

Contributor Guide