MenuHandler don't get the URL of image in background

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

MenuHandler don't get the URL of image in background

Postby valhentai » Wed Apr 20, 2016 4:36 am

I have a problem in CefSharp but I have been redirected here because the problem come from CEF.

When I open a context menu on an image wich is not in a <img> tag but is displayed using CSS background-image, inside the OnBeforeContextMenu and RunContextMenu fonctions, HasImageContent property of IContextMenuParams ( CefContextMenuParams in CEF) is true but the SourceUrl property is empty.

I could get the url using some javascript by climbing the html tree and checking each item if a background image is set but it would be ugly code with async call. It would be easier if the ImageUrl was directly given by IContextMenuParams.

I am using the nuget package CefSharp.WPF 47.0.3 in Windows 8.1
valhentai
Newbie
 
Posts: 4
Joined: Wed Apr 20, 2016 4:04 am

Re: MenuHandler don't get the URL of image in background

Postby magreenblatt » Wed Apr 20, 2016 10:24 am

This CEF API is a thin wrapper around the Chromium implementation. So, the functionality would need to be added in Chromium.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: MenuHandler don't get the URL of image in background

Postby valhentai » Thu Apr 21, 2016 2:24 am

I want to submit this bug on the Chromium forum but I don't know the underlying API call made to Chromium.
If I give them the same information as in my first post, will it be enough to find the involved code in Chromium?
valhentai
Newbie
 
Posts: 4
Joined: Wed Apr 20, 2016 4:04 am

Re: MenuHandler don't get the URL of image in background

Postby magreenblatt » Thu Apr 21, 2016 8:07 am

The Chromium object is ContextMenuParams: https://code.google.com/p/chromium/code ... pe=cs&l=56. The member you're interested in is |src_url|. Note that the comments seem to implicitly imply that only certain tags are supported.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 10 guests