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.

Update to CEF 75.0.7

User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 75.0.7

Post by salvadordf »

Now that I think of it... I should restore the GlobalCEFApp.DeleteCookies property and delete the "Cookies" and "Cookies-journal" files when CEF is initialized.

GlobalCEFApp.DeleteCache should delete the other cache files.
thefunkyjoint
Posts: 459
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 75.0.7

Post by thefunkyjoint »

It seems there is some bug on this new version related to cache / cookies...

When i test to log in on Facebook, after i type my user and password, it returns to the blank login page, like i did not typed my login info. And after that , when i navigate to Facebook again, i'm logged... All this weird stuff did not happened before.

It's easy to reproduce :

1 - Navigate to www.facebook.com
2 - Enter your email / password and submit
3 - Facebook will go back to the login page.
4 - Navigate again to www.facebook.com

Maybe i'm missing something ?
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 75.0.7

Post by salvadordf »

My mistake. :oops:

Wrong default values for one of the new classes. I'll upload the fix with a few other improvements tomorrow.
thefunkyjoint
Posts: 459
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 75.0.7

Post by thefunkyjoint »

Great, looking forward to this ;)

Thanks
snoop
Posts: 75
Joined: Mon Jul 10, 2017 12:06 pm

Re: Update to CEF 75.0.7

Post by snoop »

hello! something is wrong with proxies.
authorization doesn't work. it gives 407 error - "407 Proxy Authentication Required Access to requested resource disallowed by administrator or you need valid username/password to use this resource"
I did not change anything in code, everything worked before
rgdawson
Posts: 22
Joined: Tue Apr 10, 2018 11:05 pm

Re: Update to CEF 75.0.7

Post by rgdawson »

salvadordf wrote: Mon Jun 17, 2019 7:37 pm
rgdawson wrote: Mon Jun 17, 2019 5:22 pm Uh oh. In my app cookies are (were) persistent, but the cache is memory (not persistent). I take it this means I can't do it that way anymore?
I guess you could store the cache in a temporal directory and delete some of its files before initializing CEF in the browser process.

I could be wrong but I think that the files called "Cookies" and "Cookies-journal" store the cookies in the cache directory.

If you delete all the other files inside that directory your application should behave as if the cache was not persistent.
Your idea works fine. At first I was dismayed at how long it took to delete all the cache file (~3 seconds), so I got to wondering how CEF4Delphi could do the same thing instantly and have all the files out of the way by the time CEF starts up. So I looked at CEF4Delphi code and found a routine called "RenameAndDeleteDir". It renames the folder first (instantly out of the way), then deletes all the files asynchronously in a thread. That is so clever! So I learned a new trick. Thanks!
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 75.0.7

Post by salvadordf »

snoop wrote: Wed Jun 19, 2019 1:19 am hello! something is wrong with proxies.
authorization doesn't work. it gives 407 error - "407 Proxy Authentication Required Access to requested resource disallowed by administrator or you need valid username/password to use this resource"
I did not change anything in code, everything worked before
I tested several HTTP, SOCKS4 and SOCKS5 free proxies with the MiniBrowser demo and all of them worked correctly.
None of those proxies needed a username and a password but the CEF4Delphi code that updates the proxy preferences has not changed lately.

Chromium doesn't support SOCKS5 proxies that require authentication. If you were trying to use a SOCKS5 proxy that requires a username and a password you will not be able to use it.
snoop
Posts: 75
Joined: Mon Jul 10, 2017 12:06 pm

Re: Update to CEF 75.0.7

Post by snoop »

salvadordf wrote: Wed Jun 19, 2019 3:09 pm
snoop wrote: Wed Jun 19, 2019 1:19 am hello! something is wrong with proxies.
authorization doesn't work. it gives 407 error - "407 Proxy Authentication Required Access to requested resource disallowed by administrator or you need valid username/password to use this resource"
I did not change anything in code, everything worked before
I tested several HTTP, SOCKS4 and SOCKS5 free proxies with the MiniBrowser demo and all of them worked correctly.
None of those proxies needed a username and a password but the CEF4Delphi code that updates the proxy preferences has not changed lately.

Chromium doesn't support SOCKS5 proxies that require authentication. If you were trying to use a SOCKS5 proxy that requires a username and a password you will not be able to use it.
no, I use http proxies with authentication. it worked before (both proxies and my project). If you remember, similar bug was in one of previous updates. Then you found out that you made something wrong in initialization or something like that.
So make deep check with HTTP with auth proxies
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 75.0.7

Post by salvadordf »

I tested some websites with HTTP authentication and it works.
TChromium uses the same event to get the username and password for proxies and for websites with HTTP authentication.

Please, set a breakpoint here :
https://github.com/salvadordf/CEF4Delph ... .pas#L3642
Run your application and try to use your proxy server.

Delphi should stop at that breakpoint and it should execute the callback.cont(FProxyUsername, FProxyPassword) line to send your username and password.

If you have any issue please try adding this code line before the GlobalCEFApp.StartMainProcess call in the DPR file and test your app again :

Code: Select all

GlobalCEFApp.DisableFeatures := 'NetworkService';
snoop
Posts: 75
Joined: Mon Jul 10, 2017 12:06 pm

Re: Update to CEF 75.0.7

Post by snoop »

Hello, Savlador
Thank you, disabling this helped:
GlobalCEFApp.DisableFeatures := 'NetworkService';
Post Reply