question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Call window.close() on javascript with Eel

See original GitHub issue

Hi so I’ve been trying to close a window on javascript working with eel, but window.close() doesn’t seem to work, are there any other ways to make the window close or to terminate the eel process on javascript?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
Jack-Stollercommented, Oct 14, 2019

I was able to fix this issue with this window.open('','_self').close() code instead of the window.close() method.

0reactions
ghostcommented, Oct 15, 2019

Found it so instead of redirecting with javascript to my page which I couldn’t close later I created a js function that replaced the href and opened a new window so I could then call the window.close() argument. Here is my function if anyone wants to use it:

function Pospopup(URL, title) //?Function to open new window with same position of parent window
{
  let left = window.screenX; //takes left property of mainfile window
  let top = window.screenY; //takes left property of mainfile window
  window.open(URL, title, "width=800, height=600, top=" + top + ", left=" + left); //opens new window and sets the left and top property
}

the left and top var are just to keep the window in the same position as the previous one. Anyway big thanks to @samuelhwilliams and @FutureLights for helping me out

Read more comments on GitHub >

github_iconTop Results From Across the Web

Call window.close() on javascript with Eel · Issue #198 - GitHub
Hi so I've been trying to close a window on javascript working with eel, but window.close() doesn't seem to work, are there any...
Read more >
How to start another window using eel python? - Stack Overflow
In this case, you can call eel. show which will re-use your existing web instance to show the new window and page.
Read more >
Eel options - DEV Community ‍ ‍
init, close_callback, this function allow us to modify default behavior upon closing the window; instead of only exit, it will first print "Bye!...
Read more >
Eel - PyPI
close_callback, a lambda or function that is called when a websocket to a window closes (i.e. when the user closes the window). It...
Read more >
Create HTML User Interface using Eel in Python
The HTML file here is used to create a window that displays all the required attributes, the javascript file will be called by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found