Non-browser-window GET or POST with session? (web service)

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Non-browser-window GET or POST with session? (web service)

Postby HarmlessDave » Fri Jul 11, 2014 2:15 pm

Is there support for making non-browser-window internet calls using the session and user-agent of the CEF browser?

With the IE web control, it shares state with WinInet, so you can have a browser window authenticated with a server, then make a WinInet call to a web service on that same server and have it already be authenticated.

If not, I suppose it would work to copy all cookies and set the same user-agent. Which raises a different question: how do you *get* the user-agent? All the threads I've found are about setting your own agent, not finding out exactly what agent CEF is currently sending.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Non-browser-window GET or POST with session? (web servic

Postby magreenblatt » Fri Jul 11, 2014 3:01 pm

HarmlessDave wrote:Is there support for making non-browser-window internet calls using the session and user-agent of the CEF browser?.

Yes, see https://code.google.com/p/chromiumembed ... t_Requests.

how do you *get* the user-agent?

There is no C++ function but you can get it via the navigator.userAgent JavaScript property.
magreenblatt
Site Admin
 
Posts: 12384
Joined: Fri May 29, 2009 6:57 pm

Re: Non-browser-window GET or POST with session? (web servic

Postby HarmlessDave » Fri Jul 11, 2014 4:39 pm

Perfect, thanks!

That page answered several other "how do I...?" questions too. I've been working with the IE web control for years now but have just started looking into how to do things in CEF.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 25 guests