Download components/browser_time_component/index.html from HansTran/TESTING: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/spaces/HansTran/TESTING/resolve/main/components/browser_time_component/index.html
- Command line
-
hf download hf://spaces/HansTran/TESTING/components/browser_time_component/index.html
-
curl -L -o index.html https://huggingface.co/spaces/HansTran/TESTING/resolve/main/components/browser_time_component/index.html
778 Bytes
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <script src="https://unpkg.com/streamlit-component-lib@2.0.0/dist/index.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| function sendBrowserTime() { | |
| const now = new Date().toISOString(); | |
| Streamlit.setComponentValue(now); | |
| Streamlit.setFrameHeight(0); | |
| } | |
| function onRender(event) { | |
| const { disabled } = event.detail.args || {}; | |
| if (!disabled) { | |
| sendBrowserTime(); | |
| } | |
| } | |
| Streamlit.events.addEventListener(Streamlit.RENDER_EVENT, onRender); | |
| Streamlit.setComponentReady(); | |
| Streamlit.setFrameHeight(0); | |
| </script> | |
| </body> | |
| </html> | |