How to get the hyperlink when mouse hover(CEF3 API)?

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.

How to get the hyperlink when mouse hover(CEF3 API)?

Postby Jobcrazy » Thu Nov 21, 2013 3:38 am

How to get a text hyperlink or an image hyperlink when mouse hover ?

It seems that CefDOMEventListener is not a good idea,though it works.
Jobcrazy
Newbie
 
Posts: 2
Joined: Thu Nov 21, 2013 2:46 am

Re: How to get the hyperlink when mouse hover(CEF3 API)?

Postby magreenblatt » Thu Nov 21, 2013 10:23 am

You can use JavaScript to retrieve the DOM element under the mouse position.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to get the hyperlink when mouse hover(CEF3 API)?

Postby Jobcrazy » Fri Nov 22, 2013 1:49 am

magreenblatt wrote:You can use JavaScript to retrieve the DOM element under the mouse position.


When I hover these links in chrome, there will be a link showed in the "status bar"

Is there an api that can receive this message in cef3?(someone tell me there is a message named "ViewHostMsg_UpdateTargetURL")

Thanks.
Jobcrazy
Newbie
 
Posts: 2
Joined: Thu Nov 21, 2013 2:46 am

Re: How to get the hyperlink when mouse hover(CEF3 API)?

Postby Czarek » Fri Nov 22, 2013 5:00 am

Jobcrazy wrote:When I hover these links in chrome, there will be a link showed in the "status bar"

Is there an api that can receive this message in cef3?(someone tell me there is a message named "ViewHostMsg_UpdateTargetURL")


There is the CefDisplayHandler.OnTooltip() callback, but it is never called, see issue 783:
https://code.google.com/p/chromiumembed ... ail?id=783
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: How to get the hyperlink when mouse hover(CEF3 API)?

Postby plq » Thu Dec 02, 2021 5:22 am

Sorry to resurrect an old thread -- this is mostly for people who land on this via a search engine.

On recent versions of cef (I'm on 96) CefDisplayHandler::OnStatusMessage receives the hovered link contents. It could receive other stuff as well so some filtering might be needed from the user-code side but other than that it seems to work.
plq
Techie
 
Posts: 11
Joined: Mon Oct 25, 2021 7:21 am


Return to Support Forum

Who is online

Users browsing this forum: finder2 and 192 guests