This app shows up blank in Safari but works in other browsers: ki.uos.de
Here is the code. The start.py script is the one not loading properly.
The Safari versions we have tested: 16.5.1, 17.2.1
with the latest version of streamlit
There was a similar issue previously but it’s closed so I opened a new one since it appears it’s a persistent problem with some users. But maybe it’s something I did wrong and not a bug? I think it’s a bug since other browsers work fine. But we also tested some other streamlit apps in the same Safari browsers and they worked so it’s not for every Streamlit app apparently.
My script also wouldn’t open in Safari, and am aware of ongoing issues since Safari can be finicky due to its strong emphasis on security, privacy, and its unique JavaScript engine. Checking these areas could help diagnose and resolve the problem.
WebSockets and Protocols: Streamlit relies on WebSockets for real-time communication, and Safari has historically been more stringent about which WebSocket protocols it supports. If Safari is blocking these, the app may fail to load or run correctly.
Cross-Origin Resource Sharing (CORS): Safari has strict security policies regarding cross-origin resource sharing. If resources such as your web fonts or external scripts are being loaded from different origins without proper CORS headers, Safari might block these requests which could break the app.
Blocking Third-Party Cookies: Safari’s Intelligent Tracking Prevention (ITP) can sometimes inadvertently block third-party cookies and scripts that are necessary for functionality. If your Streamlit app requires third-party components (like gTTS, requests, or even some internal state mechanisms), this could be a problem.
Service Workers/Caching Issues: Safari’s handling of service workers and its caching mechanisms can sometimes cause issues. While Streamlit doesn’t use service workers by default, any embedded HTML or dynamic content could be affected.
JavaScript Engine Differences: Safari uses the WebKit engine for rendering pages, which may interpret JavaScript differently compared to other browsers. Certain JavaScript functions or modern features might not be fully supported or could behave differently.
Here are some options to try:
Websockets: Ensure that Safari supports the WebSockets implementation you are using. Sometimes disabling and enabling WebSockets in the developer settings can solve issues.
CORS: Verify that any external resources being accessed (like fonts from Google Fonts or APIs) have the appropriate CORS headers set.
Third-Party Cookies: Check if your app interacts with any third-party APIs that might be blocked by Safari’s privacy settings.
Check JavaScript Compatibility: Make sure that the JavaScript and CSS you are using are fully compatible with WebKit.
Hope you get it right, or perhaps this may help someone else. Mine is working again
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
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.
Performance cookies
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.
Functional cookies
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.
Targeting cookies
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.