Library for working with clipboard from Unity Webgl build.
Requires a version of unity that supports path query parameter for git packages (Unity 2021.3 or later). You can add a reference https://github.com/arty-F/UniWebGlClipboard.git?path=Assets/UniWebGlClipboard
to Package Manager.
Download the latest .unitypackage
file from releases page and import downloaded package into unity.
Sending text to clipboard:
WebglClipboard.SendToClipboard("you text");
Getting text from clipboard:
WebglClipboard.ReadFromClipboard(OnClipboardReaded);
...
void OnClipboardReaded(string clipboard)
{
var youText = clipboard;
}