-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy of code blocks does not work for LAN access #4324
Comments
This error is due to the browser security policy that does not allow the The reason it works properly when accessed locally is that the local environment is considered a trusted environment and therefore the clipboard API can be used. To solve this problem, you can use a library or technology such as
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
navigator.clipboard.writeText(code_node.innerText.trimEnd()). for: const clipboard = new ClipboardJS(button, {
text: function() {
return code_node.innerText.trimEnd().
}
}). Make sure you have properly introduced the By using Translated with www.DeepL.com/Translator (free version) |
Hi @Kilig947 it looks like you are using an older version of Gradio. Can you confirm if this is still an issue in the latest version of |
|
Both in 3.28.3 and 3.32.0, when I visit http://localhost:7891, the copy button works fine, but when I visit http://10.13.78.56:7891/? __theme=dark, the copy button does not work properly
|
大佬牛皮 |
Describe the bug
When I access my application on the LAN and click the copy button in the code block, an error is reported
If I access localhost, the problem will no longer exist
Please fix it as soon as possible
Is there an existing issue for this?
Reproduction
.launch(server_name="0.0.0.0"
Screenshot
No response
Logs
System Info
Severity
annoying
The text was updated successfully, but these errors were encountered: