Walter2
November 17, 2024, 12:44pm
1
I’m going through the doc for “Build an embed link” and the “Share” button is not visible. I expected to see it in the upper right corner of the app. Is there another method to build an embed link?
Are you logged in? If this is an app where you have write permissions to its repository, you should see an edit icon in the upper right and “Manage app” in the lower right. (Technically, you can see the share button if you have write permissions to some other app in the workspace, too, in which case you wouldn’t see developer options. However, that’s a less common scenario.)
Walter2
November 17, 2024, 1:41pm
3
I’m logged into streamlit. I do see an edit icon in the upper right and “Manage app” in the lower right. The upper right drop-down;
Hmm. As far as I know you should be able to see the Share button if you can see the developer options. Can you share your app URL so I can ask the devs?
Walter2
November 17, 2024, 1:57pm
5
Thanks! It’s here and public. Does the link work for you? I see a ‘Not found’ after posting.
What web browser are you using and which version?
Walter2
November 17, 2024, 3:01pm
7
Firefox 132.0.2 (64-bit) on macOS Sonoma 14.6.1
There’s a long-standing bug in Streamlit that makes many Community Cloud customizations not apply in Firefox:
opened 02:13PM - 12 Nov 24 UTC
closed 05:46PM - 15 Nov 24 UTC
type:bug
status:confirmed
priority:P3
### Checklist
- [X] I have searched the [existing issues](https://github.com/st… reamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.
### Summary
When running a Streamlit app in Community Cloud in Firefox (tested 132.0.1 on macOS Sequoia), CC customizations do not apply. For example:
1. The Fork & GitHub buttons are missing in the top menu.
2. When using `st.navigation`, when you inspect URLs of the pages, in Firefox they will look like https://my-app.streamlit.app/~/+/page_2 - the `/~/+` prefix should not be there - CC sends a `SET_PAGE_LINK_BASE_URL` message to set `pageLinkBaseUrl` to `https://my-app.streamlit.app`.
### Reproducible Code Example
```Python
import streamlit as st
pages = {
"Section 1": [
st.Page("page_1.py", title="Page 1"),
st.Page("page_2.py", title="Page 2"),
],
"Section 2": [
st.Page("page_3.py", title="Page 3"),
st.Page("page_4.py", title="Page 4"),
],
}
pg = st.navigation(pages)
pg.run()
```
### Steps To Reproduce
1. Create a file named "streamlit_app.py" app from the code above. Create `page_1.py` etc. with any content. You can also clone https://github.com/sfc-gh-mgolebiowskiowczarek/streamlit-navigation-test-app/blob/main/streamlit_app.py instead.
2. Deploy it in CC (https://share.streamlit.io)
3. Open the deployed app in Firefox.
### Expected Behavior
1. Right click on a link to "Page 2", look at the URL. Its pathname part should just be `part_2`.
2. The Fork & GitHub buttons should be present in the top right menu.
### Current Behavior
1. Right click on a link to "Page 2", see it contains `/~/+` at the beginning of the path part.
2. See that there's no Fork button or the GitHub button at the top-right of the page.
### Is this a regression?
- [ ] Yes, this used to work in a previous version.
### Debug info
- Streamlit version: 1.40.1
- Python version: 3.11.x
- Operating System: macOS Sequoia 14.7.1 (23H222)
- Browser: Firefox 132.0.1
### Additional Information
The cause is that Firefox doesn't receive messages from Community Cloud. Messages are sent but Streamlit then validates the domain against supported ones. It does so by wrapping the pattern in the `URL` constructor. The problem is, `new URL("https://*.streamlit.apptest")` crashes in Firefox with:
```
Uncaught TypeError: URL constructor: https://*.streamlit.apptest is not a valid URL.
```
Fortunately, I have just fixed it:
streamlit:develop ← sfc-gh-mgolebiowskiowczarek:firefox-allowed-domains-fix
opened 02:20PM - 12 Nov 24 UTC
## Describe your changes
Support [URLPattern](https://developer.mozilla.org/e… n-US/docs/Web/API/URL_Pattern_API)-compatible patterns in allowed domain matching.
This also fixes an issue where in Firefox domain patterns like `https://*.streamlit.app` were never matched - this was because previously the pattern was converted to a `URL` object by passing it to the `URL` constructor and Firefox throws on such URLs.
The issue meant that in Firefox no messages sent from Community Cloud apps were reaching Firefox, breaking URLs, making CC-specific menu items not applied, etc.
In UriUtil tests, replace all `.toBeFalsy()` occurrences with `.toBe(false)` and `.toBeTruthy()` with `.toBe(true)` to better reflect the API is supposed to return a boolean.
Fixes #9848
## GitHub Issue Link (if applicable)
* #9848
## Testing Plan
JS Unit tests added.
I also tested it in Firefox on the app https://app-navigation-test-app-5e8tdhuv6wvkscfe8vwxcn.streamlit.app/ by using network overrides in Firefox DevTools and replacing the relevant function in the minified JS code of the file https://app-navigation-test-app-5e8tdhuv6wvkscfe8vwxcn.streamlit.app/~/+/static/js/main.75ac1cb6.js. After the refresh, the problems described in issue #9848 disappeared.
**NOTE:** There's one change - previously, the pattern `"https://*.com"` would not match `https://example.example.com` and now it does. If one wants to forbid it, a more detailed regex pattern can be used, e.g. `"https://(\w+).com"`.
As I understand, for now the list of allowed domains is not exposed as a public API, so perhaps such a change is fine.
There's an open issue for this (https://github.com/streamlit/streamlit/issues/6389) and a PR for it labded (https://github.com/streamlit/streamlit/pull/7180) but to the `feature/host-security-config` branch.
---
**Contribution License Agreement**
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
The fix should be available in Streamlit 1.41.0. Until it’s released, you’ll only be able to see the buttons in non-Firefox browsers.
1 Like
Walter2
November 17, 2024, 4:02pm
9
Thank you! Yes, Chrome works and looking forward to Firefox fix.
1 Like
system
Closed
November 19, 2024, 4:03pm
10
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
@Walter2 Streamlit 1.41.0 with the fix has been released.
1 Like