Page 1 of 1

Difference between running scripts in CEF4Delphi and Chrome

Posted: Sun Feb 18, 2024 12:20 pm
by thefunkyjoint
I have a situation here where i need to achieve a simple task : fill a textarea with the content below :

Testing%20With%20Spaces

Exactly this way, with %20 instead of spaces.

For instance, in www.google.com, we have the textarea used to enter a search. If i go on Devtools in Google Chrome and run the script below :

Code: Select all

document.getElementsByTagName('textarea')[0].value = 'Testing%20With%20Spaces';
The Google search text box will be filled exactly as intended :

https://ibb.co/0YZvgQR

BUT, if i run the exact same code using CEF4Delphi, the same search text box will be filled in a different way, replacing the %20 by space :

https://ibb.co/tQ0gtdt

What i should do to CEF4Delphi work exactly like Chrome in this case ?

Re: Difference between running scripts in CEF4Delphi and Chrome

Posted: Mon Feb 19, 2024 7:48 am
by salvadordf
Try encoding the % chars again like this :
Testing%2520With%2520Spaces
Read this article for more details :
https://www.w3schools.com/tags/ref_urlencode.asp?_sm_au_=iVVDMg0TSmrMV6Dm

Re: Difference between running scripts in CEF4Delphi and Chrome

Posted: Mon Feb 19, 2024 4:52 pm
by thefunkyjoint
Worked, thanks a lot ! :D