bassmanitram / actions-for-nautilus

An extension to the Gnome "Files" file manager that allows you to add arbitrary actions to the file selection context menu.
Apache License 2.0
165 stars 16 forks source link

Switch to keep alive interval and add unsaved changes warning #65

Open garzj opened 2 months ago

garzj commented 2 months ago

I added these two little features, it felt like this warning is a necessity. Thank you for this project!

bassmanitram commented 1 month ago

Hey there - thanks for this. I'll test the warning, but the terminate functionality is intentional, in response to security concerns, so that stays.

garzj commented 1 month ago

Oh, I did leave the termination logic, just changed it up a bit. The window unload event may be skipped in certain cases, so the server should now close after a timeout of 10 seconds if the frontend stops sending keep alives. Also, another unload handler may interfere with the added warning if the event order is incorrect, that's why I cared in the first place.

garzj commented 1 month ago

It may still be better to do it your way to prevent unintentional server shutdowns. If the server keeps running, it shouldn't be that of an issue, since it's just reachable from localhost, not from 0.0.0.0.