Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Difference between running scripts in CEF4Delphi and Chrome

Post Reply
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Difference between running scripts in CEF4Delphi and Chrome

Post 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 ?
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Difference between running scripts in CEF4Delphi and Chrome

Post 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
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Difference between running scripts in CEF4Delphi and Chrome

Post by thefunkyjoint »

Worked, thanks a lot ! :D
Post Reply