Fix SetClipboardText for web (#3257)

This commit is contained in:
ubkp 2023-08-26 09:40:30 -03:00 committed by GitHub
parent 8f228626a2
commit 4fa66f2635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2150,7 +2150,7 @@ void SetClipboardText(const char *text)
#if defined(PLATFORM_WEB)
// Security check to (partially) avoid malicious code
if (strchr(text, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided Clipboard could be potentially malicious, avoid [\'] character");
else emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text));
else EM_ASM( { navigator.clipboard.writeText(UTF8ToString($0)); }, text);
#endif
}