mtasa-blue
mtasa-blue copied to clipboard
Copying text from CEF Browser shows Chinese characters in console
Describe the bug
https://github.com/user-attachments/assets/9bbcfe8e-f12c-42eb-a402-87ad302884e3
(if you paste it normally to somewhere else, it works fine)
Steps to reproduce
Start this resource cefbug.zip
Version
Multi Theft Auto v1.6-release-22684
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.
Old bug yes
use this
JS :
document.addEventListener("copy", function (event) {
event.preventDefault();
let selectedText = window.getSelection().toString();
if (selectedText) {
mta.triggerEvent("Copy", selectedText);
}
});
LUA (C-SIDE) :
addEvent("Copy",true)
addEventHandler("Copy",root,fucntion(text)
setClipboard(text)
end)