Component to get and set client url

Awesome tool! Thanks

I need a way to get and set the full url in the client browser.

I wan’t my users to be able to book, share and navigate to specific pages of a multipage application.

I wan’t my users to be able bookmark, share and navigate to my page with custom values for the page components like text boxes, dropdowns via the url etc.

When getting and setting the url i wan’t access to the full url as well as its components like domain, …, parameters

I guess I will have to parse and validate the url parameters and then set the selected values. But if possible I wan’t the selected values to be set automatically and magically when a user changes an url. Maybe i need hidden values as well to store values in the url not corresponding to components in the page. Similarly when the components Change it could be nice if the url automatically updates.

An example, hypothetical url is https://myapp.com/streamlit/streamlit/issues/new?assignees=&labels=enhancement&template=feature_request.md&titlehttps://github.com/streamlit/streamlit/issues/302=

I’ve created a feature request here

Great idea! I’ll continue the discussion the the feature request (Oh, and thanks for creating the FR too :smiley:)

I didn’t want to add noise to the github discussion as it seems to have taken on a larger requirement.

Is it possible to just get the URL from the streamlit server? e.g. st.server.location

I’m happy to parse for params etc. and don’t yet need the state mentioned in the PR.

Hi @paulmwatson, this seems a very simple and useful request. We don’t expose it at the moment, but it definitely simpler to do. Let me open a feature request for this specific issue.

Matteo

1 Like