Skip to content

feat(extra-natives-five): Add COPY_TEXT_TO_CLIPBOARD#4004

Open
Doxoh wants to merge 4 commits into
citizenfx:masterfrom
Doxoh:master
Open

feat(extra-natives-five): Add COPY_TEXT_TO_CLIPBOARD#4004
Doxoh wants to merge 4 commits into
citizenfx:masterfrom
Doxoh:master

Conversation

@Doxoh
Copy link
Copy Markdown

@Doxoh Doxoh commented May 24, 2026

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

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label May 24, 2026
@Doxoh
Copy link
Copy Markdown
Author

Doxoh commented May 24, 2026

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.

@ook3D
Copy link
Copy Markdown
Contributor

ook3D commented May 24, 2026

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

@Gogsi
Copy link
Copy Markdown
Contributor

Gogsi commented May 24, 2026

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

@Doxoh
Copy link
Copy Markdown
Author

Doxoh commented May 24, 2026

yeah I know, thanks. Local its working :)
Was an Information for this pr :)

@divocbn
Copy link
Copy Markdown
Contributor

divocbn commented May 24, 2026

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 :/

@lLukDreams
Copy link
Copy Markdown

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?

@AngeloneISL
Copy link
Copy Markdown

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

@FabianTerhorst
Copy link
Copy Markdown
Contributor

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.

@divocbn
Copy link
Copy Markdown
Contributor

divocbn commented May 25, 2026

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?

@Doxoh
Copy link
Copy Markdown
Author

Doxoh commented May 25, 2026

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:
image

@yorick2002
Copy link
Copy Markdown
Contributor

What is the purpose of this native at all? I cant think of a use-case

@AvarianKnight
Copy link
Copy Markdown
Contributor

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.

@AvarianKnight
Copy link
Copy Markdown
Contributor

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:

image

I don't think this properly addresses the issue, something similar to how voice permission is requested in CEF would make more sense.

@AvarianKnight
Copy link
Copy Markdown
Contributor

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.

@yorick2002
Copy link
Copy Markdown
Contributor

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 👍

@Doxoh
Copy link
Copy Markdown
Author

Doxoh commented May 25, 2026

yeah, thats the reason why we want it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants