Storing to clipboard from a script

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
alkas
Hobby Astronomer
Hobby Astronomer
Posts: 17
Joined: 2020-07-30, 09:44

Storing to clipboard from a script

Unread post by alkas » 2023-12-23, 11:00

Operating system: Win 10
Browser version: just updated to the last one 32.5.2 and tested again
32-bit or 64-bit browser?: 64
Problem URL: https://community.cacert.org/clientcert/
Browser theme (if not default): I guess none
Installed add-ons: Swarth 1.1.0
Installed plugins: (about:plugins): Adobe Acrobat 23.6.20380.0; Java Platform SE 8 U381 11.381.2.9; VLC Web Plugin 3.0.3.0

If possible, please include the output of help->troubleshooting information (as text):
**PASTE troubleshooting information here**
After script generates a pair of RSA keys, the button should be pressed to copy the cert req to the clipboard.
But nothing happens and the script stucks.

User avatar
Pentium4User
Board Warrior
Board Warrior
Posts: 1138
Joined: 2019-04-24, 09:38

Re: Storing to clipboard from a script

Unread post by Pentium4User » 2023-12-23, 11:28

The profile picture shows my Maico EC30 E ceiling fan.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Storing to clipboard from a script

Unread post by Moonchild » 2023-12-23, 12:20

You should use document.execCommand("copy") as has always been the case for copying to clipboard thus far. Navigator.clipboard is a new interface (since the old way of doing the exact same thing wasn't good enough according to the powers-that-be...) we haven't implemented yet (but it'll be there soon) Issue #2361 (UXP)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite