[GH-ISSUE #95] Cannot copy voucher code #49

Closed
opened 2026-05-07 00:18:20 +02:00 by BreizhHardware · 4 comments

Originally created by @tomdh76 on GitHub (Sep 6, 2025).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/95

Originally assigned to: @glenndehaan on GitHub.

The problem

Thx for this tool!
It works for me quite well except that I cannot copy the voucher code using the copy icon in ios. The print icon works. Also in a web browser the copy icon does nothing. Strangely enough in the home assistant add on I can copy the code, but not in the home assistant add-on on my iphone....

What version of UniFi Voucher Site has the issue?

latest docker image, latest HA version

What was the last working version of UniFi Voucher Site?

No response

What type of installation are you running?

Docker

Anything in the logs that might be useful for us?


Additional information

No response

Originally created by @tomdh76 on GitHub (Sep 6, 2025). Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/95 Originally assigned to: @glenndehaan on GitHub. ### The problem Thx for this tool! It works for me quite well except that I cannot copy the voucher code using the copy icon in ios. The print icon works. Also in a web browser the copy icon does nothing. Strangely enough in the home assistant add on I can copy the code, but not in the home assistant add-on on my iphone.... ### What version of UniFi Voucher Site has the issue? latest docker image, latest HA version ### What was the last working version of UniFi Voucher Site? _No response_ ### What type of installation are you running? Docker ### Anything in the logs that might be useful for us? ```Text ``` ### Additional information _No response_
BreizhHardware 2026-05-07 00:18:20 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@glenndehaan commented on GitHub (Sep 8, 2025):

Hi @tomdh76,

Just to avoid confusion, are you using the HA Addon or a Seperate Docker container. Because within the What type of installation are you running? you selected Docker.

Assuming you are running the HA Addon, are you using the official HA Companion app or are you using a webbrowser like Safari the access the HA instance.

I just tested this on an iPad I had and it seems the copy function works fine on iOS. However I have seen instances where Safari does not allow this due to secure context problems (A problem Apple created). One way around this would be to add the page to your home screen. This would create it's own context and should bypass this issue or utilize the official app.

Kind regards,
Glenn de Haan

<!-- gh-comment-id:3265041013 --> @glenndehaan commented on GitHub (Sep 8, 2025): Hi @tomdh76, Just to avoid confusion, are you using the HA Addon or a Seperate Docker container. Because within the `What type of installation are you running?` you selected `Docker`. Assuming you are running the HA Addon, are you using the official HA Companion app or are you using a webbrowser like Safari the access the HA instance. I just tested this on an iPad I had and it seems the copy function works fine on iOS. However I have seen instances where Safari does not allow this due to secure context problems (A problem Apple created). One way around this would be to add the page to your home screen. This would create it's own context and should bypass this issue or utilize the official app. Kind regards, Glenn de Haan
Author
Owner

@tomdh76 commented on GitHub (Sep 8, 2025):

Hi @tomdh76,

Just to avoid confusion, are you using the HA Addon or a Seperate Docker container. Because within the What type of installation are you running? you selected Docker.

Assuming you are running the HA Addon, are you using the official HA Companion app or are you using a webbrowser like Safari the access the HA instance.

I just tested this on an iPad I had and it seems the copy function works fine on iOS. However I have seen instances where Safari does not allow this due to secure context problems (A problem Apple created). One way around this would be to add the page to your home screen. This would create it's own context and should bypass this issue or utilize the official app.

Kind regards, Glenn de Haan

I think I found the problem:

I use both the docker and the HA addon. When going to the website of the docker (192.168.20.40:3001/voucher) image in edge browser for example I can use the print icon, but not the copy icon. When going to the website of home assistant using https of my domain (xxx.com) in the addon I can use the copy icon. But when going to the website of my home assistant addon using local ip (192.168.20.42:8123) the copy icon does not work. So it is probably indeed some security issue when using http://localip....

<!-- gh-comment-id:3267771735 --> @tomdh76 commented on GitHub (Sep 8, 2025): > Hi [@tomdh76](https://github.com/tomdh76), > > Just to avoid confusion, are you using the HA Addon or a Seperate Docker container. Because within the `What type of installation are you running?` you selected `Docker`. > > Assuming you are running the HA Addon, are you using the official HA Companion app or are you using a webbrowser like Safari the access the HA instance. > > I just tested this on an iPad I had and it seems the copy function works fine on iOS. However I have seen instances where Safari does not allow this due to secure context problems (A problem Apple created). One way around this would be to add the page to your home screen. This would create it's own context and should bypass this issue or utilize the official app. > > Kind regards, Glenn de Haan I think I found the problem: I use both the docker and the HA addon. When going to the website of the docker (192.168.20.40:3001/voucher) image in edge browser for example I can use the print icon, but not the copy icon. When going to the website of home assistant using https of my domain (xxx.com) in the addon I can use the copy icon. But when going to the website of my home assistant addon using local ip (192.168.20.42:8123) the copy icon does not work. So it is probably indeed some security issue when using http://localip....
Author
Owner

@glenndehaan commented on GitHub (Sep 8, 2025):

Yeah that is indeed correct the Clipboard API needs a secure connection to work.
Will implement a check soon that should hide the icon when the API is unavailable.

<!-- gh-comment-id:3267981296 --> @glenndehaan commented on GitHub (Sep 8, 2025): Yeah that is indeed correct the Clipboard API needs a secure connection to work. Will implement a check soon that should hide the icon when the API is unavailable.
Author
Owner

@glenndehaan commented on GitHub (Sep 8, 2025):

I have just released version 8.1.1 this will hide the copy to clipboard buttons if the browser API is unavailable

<!-- gh-comment-id:3268029752 --> @glenndehaan commented on GitHub (Sep 8, 2025): I have just released version 8.1.1 this will hide the `copy to clipboard` buttons if the browser API is unavailable
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/unifi-voucher-site#49
No description provided.