Streamlit in snowflake, URL links are not opening on direct click

Streamlit is running in snowflake, version 1.5.and a link to a word document from sharepoint is displayed. when i rightclick open in a new tab, it opens up but when i left click and open it opens the tab but doesnt render the webpage , instead its blank

here is the sample code
import streamlit as st

test_url= “https:///:w:/r/sites/SPCoE/_layouts/15/Doc.aspx?sourcedoc=%7B0D1B2541-1799-4B00-8BCF-98EDC9DD6AE5%7D

st.title(“LINK TEST APP”)

st.markdown(f’LINK', unsafe_allow_html=True)

python 3.12

streamlit 1.50

on the left click tab,in the developer options, the error message is form’s frame is sandboxed and the ‘allow-forms’ permission is not set.

Hey, thanks for sharing your question and welcome to the community! :blush: It seems likely that this issue is due to how Streamlit (especially when running in Snowflake) and browsers handle security for embedded links. When you left-click the link, Streamlit or the browser may open it in a sandboxed iframe without the necessary permissions (like allow-forms), which prevents the SharePoint page from rendering. Right-clicking and opening in a new tab bypasses this restriction, so the page loads as expected. This is a known limitation with sandboxed iframes and external sites, especially with services like SharePoint that require certain permissions to display content in an embedded context.

My understanding is that there isn’t a Streamlit config or parameter to change this behavior directly, as the sandboxing is enforced for security reasons and is not user-configurable in Streamlit’s markdown or link rendering. This is also consistent with similar issues reported in the Streamlit community, where links to external sites often require opening in a new tab to work properly due to browser and platform security policies. You might consider instructing users to right-click and open in a new tab, or use a button that triggers a JavaScript redirect (if allowed in your environment), but there is no official Streamlit API to change the iframe sandbox attributes or permissions for links in markdown or HTML.

Sources:

Thanks alot, This clarifies alot.