feat(extra-natives-five): Add COPY_TEXT_TO_CLIPBOARD
Goal of this PR
The possiblity to copy text into the clipboard of the player.
How is this PR achieving the goal
By adding the native COPY_TEXT_TO_CLIPBOARD
This PR applies to the following area(s)
FiveM
Successfully tested on
Latest game build: 3258 but works for all
Platforms: Windows
Checklist
- [x] Code compiles and has been tested successfully.
- [x] Code explains itself well and/or is documented.
- [x] My commit message explains what the changes do and what they are for.
- [x] No extra compilation warnings are added by these changes.
Check failed because of Error downloading object: vendor/libnode/bin/libnode22.dll (e03bef1): Smudge error: Error downloading vendor/libnode/bin/libnode22.dll (e03bef17df5371aa2947bbf43e94d6e615c137a163c76749075cb02239a04c6f): batch response: This repository exceeded its LFS budget. The account responsible for the budget should increase it to restore access.
Check failed because of
Error downloading object: vendor/libnode/bin/libnode22.dll (e03bef1): Smudge error: Error downloading vendor/libnode/bin/libnode22.dll (e03bef17df5371aa2947bbf43e94d6e615c137a163c76749075cb02239a04c6f): batch response: This repository exceeded its LFS budget. The account responsible for the budget should increase it to restore access.
just ignore the checks, they've been broken for a while, the libnode binaries still need to be migrated to a cdn
for now you can do
set GIT_LFS_SKIP_SMUDGE=1
git clone https://github.com/citizenfx/fivem.git
This will close the repo without the LFS files. Then you need to download these manually from https://github.com/citizenfx/libnode/releases/tag/v22.22.0 and place them in the vendor/libnode/bin folder
yeah I know, thanks. Local its working :) Was an Information for this pr :)
Hi, to also give some feedback in terms of security: I know, this native could be very useful, tho malicious server could abuse it and constantly overwrite the users clipboard like a wallet clipper for example :/
Hi, to also give some feedback in terms of security: I know, this native could be very useful, tho malicious server could abuse it and constantly overwrite the users clipboard like a wallet clipper for example :/
what if this is not silent and fivem displays a small warning that it was overwritten or so?
To anyone who thinks this can be used in a malicious way
This thing already exists with Javascript so nothing actually changes except having a shorter way of copying something to the Client's clipboard
To anyone who thinks this can be used in a malicious way
This thing already exists with Javascript so nothing actually changes except having a shorter way of copying something to the Client's clipboard
With the difference that the pages request a clipboard permission. Adding this without a dedicated clipboard permission would involve more risk.
what if this is not silent and fivem displays a small warning that it was overwritten or so?
Sounds to me like a good idea, basically the same as the url confirmation modal that radium made, @FabianTerhorst what do you think about it?
I found a better way.
The server need to set sv_requiredClipboardPermission 1 in server.cfg.
Then by connecting to server, the client ask prechecks like this.
The User get a mask to accept it or not:
What is the purpose of this native at all? I cant think of a use-case
Hi, to also give some feedback in terms of security:
I know, this native could be very useful, tho malicious server could abuse it and constantly overwrite the users clipboard like a wallet clipper for example :/
They can already do this via CEF, having it permission gates would make sense though.
I found a better way.
The server need to set
sv_requiredClipboardPermission 1in server.cfg.Then by connecting to server, the client ask prechecks like this.
The User get a mask to accept it or not:
![]()
I don't think this properly addresses the issue, something similar to how voice permission is requested in CEF would make more sense.
What is the purpose of this native at all? I cant think of a use-case
I can think of multiple, mainly dev tools. Currently if I want to copy coordinates I have to go through cef, with this I could just copy to clipboard and not need anything extra.
What is the purpose of this native at all? I cant think of a use-case
I can think of multiple, mainly dev tools. Currently if I want to copy coordinates I have to go through cef, with this I could just copy to clipboard and not need anything extra.
Oh yeah thats true forgot about that 👍
yeah, thats the reason why we want it
Looks useful ❤️
@radium-cfx what do u think about this?