I would like to open a popup window of another streamlit app.
import streamlit as st
from streamlit.components.v1 import html
def open_page(url):
open_script= """
<script type="text/javascript">
window.open('%s', "mozillaWindow", "popup").focus();
</script>
""" % (url)
html(open_script)
st.button('test', on_click=open_page, args=('https://www.mozilla.org/',))
I found and edited code from here.
I would like to use the button to open the popup window when the user clicks on it like its normal functionality. When the user hits clicks the first time it works exactly how I want it to work. However, after the first time it no longer will open a popup window. Instead I have to reload the page for it to work again once.
Does anyone have any ideas of how to allow this to run multiple times?
Thanks.
Jason is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.