after did st.set_page_config(page_title=‘MyApp’)
the web page title will become MyApp.Streamlit
Hope we can remove this from page title
after did st.set_page_config(page_title=‘MyApp’)
the web page title will become MyApp.Streamlit
Hope we can remove this from page title
Hi @BeyondMyself,
Thanks for sharing with the Streamlit community!
Can you provide a code snippet or link to your app to help us understand your question?
Best,
Caroline
import streamlit as st
st.set_page_config(page_title=‘MyApp’)
after run this code, you can see that web page title will change into “MyApp●Streamlit”
my target is remove the “●Streamlit” from the web page title, do you have any solutions?
Hello @BeyondMyself ,
Sorry to hear you bumped on this, this is still a known issue you can find here:
There is a hacky solution there to edit your Streamlit installation to remove the ●Streamlit part, just note you will need to do it every time you update Streamlit.
You can +1 the issue to bring more attention to it.
Cheers,
Fanilo
the way of changing document.title in main.*.chunk.js file is not work.
●Streamlit is still exists in page title.
we need a new solution.
Hello @BeyondMyself,
So here’s another very hacky solution. You just have to add and call the following function in your app.
def set_page_title(title):
st.sidebar.markdown(unsafe_allow_html=True, body=f"""
<iframe height=0 srcdoc="<script>
const title = window.parent.document.querySelector('title') \
const oldObserver = window.parent.titleObserver
if (oldObserver) {{
oldObserver.disconnect()
}} \
const newObserver = new MutationObserver(function(mutations) {{
const target = mutations[0].target
if (target.text !== '{title}') {{
target.text = '{title}'
}}
}}) \
newObserver.observe(title, {{ childList: true }})
window.parent.titleObserver = newObserver \
title.text = '{title}'
</script>" />
""")
set_page_title("My new title")
This will however add a small padding where you’ll call the function.
Caution though, for security reasons, do not let the app user change that title with a text_input.
set_page_title("🎈 My title") # OK
set_page_title(st.text_input("Edit my title")) # Security risks
well down, this function works after app restarted.
thanks for your help.
This has been resolved with version 0.84!
Thanks a lot for this, it works! Has anyone figured out how to reduce the padding it creates?
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.