-
Notifications
You must be signed in to change notification settings - Fork 48
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
The copy button is invalid. #250
Comments
What do you mean by "is invalid"? |
All Copy buttons not working |
Is it possible you are accessing that Docker container on an external connection over Assuming you are on the latest version of Chrome, do you see any errors/warnings in Inspector when you click on the button? |
Can't you reproduce it over there? |
I'm using "OpenAI: Compatible servers (i.e. llama.cpp)" |
That is likely the problem, browsers don't allow copy/paste functionality over HTTP (unless you are hosting the server on |
You can try creating a tunnel using HTTPS for free with Cloudflare or Ngrok. |
Okay, I'll test it. |
This is indeed the reason. After I forward the port to the local area, it will be fine. At least the following projects can implement this feature. Maybe we can do some research about it. |
Glad it worked!
Interesting, I just took a quick look at the way |
The Clipboard API requires HTTPS, function copyToClipboard(text) { // Fallback to older method for compatibility try { |
I'll try it, if it can be solved, maybe I can send a PR. |
Well, I don't know which files should be modified. |
Appreciate the effort but the solution mentioned above looks a bit like a hack. The copy functionality has been implemented for several months and this issue has never come up so I'd rather not add a workaround for what it seems to be an anti-pattern. What I'd be down to implement is to check |
I noticed that open-webui considered HTTP compatibility. The method used by open-webui is:
|
The home local area network is a common use case. In this scenario, HTTP is the easiest to deploy and sufficient. |
I hear ya. We recently had another issue where we were using That one wasn't too bad because we weren't using it for privacy reasons, but in this case it might become a vulnerability, in addition to I'd be down to implementing the workaround as long as we alert the user that they are using the feature on an insecure context, for example: function copyContent() {
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(content);
} else {
const textArea = document.createElement('textarea');
textArea.value = content;
document.body.appendChild(textArea);
textArea.select();
try {
document.execCommand('copy');
toast.warning('Content copied, but your connection is not private');
} catch (e) {
console.error(e);
toast.error("Couldn't copy content. Connection is not private");
}
document.body.removeChild(textArea);
}
} |
🎉 This issue has been resolved in version 0.24.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
version:
ghcr.io/fmaclen/hollama:latest (0.23.2)
Tested browser:
chrome
edge
firefox
The text was updated successfully, but these errors were encountered: