This is a continuation of Stop or Cancel button - #5 by rohola_zandie, which was closed.
From the useful discussion in that thread I am able to kill the python process on a button click, but not the current browser tab. I would have thought being able to “close” an app would be beneficial for the original use case of distributing analytical apps etc. i.e. a receiver of a streamlit app (standalone) can open it easily then close it easily.
The issue is that the only way to embed Javascript is via the components api, but the iframe sandbox will not allow top navigation. If anyone has a workaround that can work that would be great. If I could just set the parent’s sandbox setting that would be fine but can’t work that out
I realise with the push to cloud that such hacks (i.e. killing the parent pid) will be risky in the cloud so perhaps an enhancement is the best way instead of hacking. I can’t tell how many users are distributing standalone apps, but I would think there would be a few.
One more unrelated feature suggestion: in the api allow an optional id argument which sets the component’s html id. individual styling in css is difficult with some quite complex xpath to identify an individual element. It may also help those who want to attach javascript manipulation or events to in page elements.
I think Streamlit is an incredible product, hats off to you.