SaveImageAs context menu options

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

SaveImageAs context menu options

Postby keshav » Sun Feb 10, 2013 1:35 am

How to have save image as context menu option. I know u can have the option in context menu, but how am I suppose to give the image url to the downloadManager

Regards

Keshav
keshav
Mentor
 
Posts: 82
Joined: Mon Jan 16, 2012 11:33 pm

Re: SaveImageAs context menu options

Postby keshav » Mon Feb 11, 2013 2:59 am

Some one please help me with this, this one is difficult to solve. I am trying to understand how chrome does it, but their context menu code is massive and complicated, especial for something simple like a context menu.
keshav
Mentor
 
Posts: 82
Joined: Mon Jan 16, 2012 11:33 pm

Re: SaveImageAs context menu options

Postby magreenblatt » Mon Feb 11, 2013 10:35 am

You can use CefURLRequest (or CefWebURLRequest depending on your CEF version) to download the image using the URL.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: SaveImageAs context menu options

Postby amitkanfer » Mon Dec 01, 2014 11:50 am

Marshall,
2 questions...
1. From the documentation i understand that CefURLRequest is "context-less", so how will CEF handle images in secured sites that require cookies? (facebook for example)
2. Doesn't CEF already have the image "in hand"? it's displayed on the screen... why download it again?

Thanks alot,
Amit
amitkanfer
Techie
 
Posts: 31
Joined: Mon Jul 21, 2014 4:10 am

Re: SaveImageAs context menu options

Postby magreenblatt » Mon Dec 01, 2014 12:21 pm

amitkanfer wrote:1. From the documentation i understand that CefURLRequest is "context-less", so how will CEF handle images in secured sites that require cookies? (facebook for example)

If you call CefRequest::SetFlags(UR_FLAG_ALLOW_CACHED_CREDENTIALS) before calling CefURLRequest::Create it will use cookies from the global cookie store.
amitkanfer wrote:2. Doesn't CEF already have the image "in hand"? it's displayed on the screen... why download it again?

There is no API currently for retrieving data from the cache. Also, not all images are cached (it depends on response headers, etc).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 95 guests