[Solved] Access URL under mouse cursor?

Having problems with building or using the JCEF Java binding? Ask your questions here.

[Solved] Access URL under mouse cursor?

Postby markhen » Thu May 16, 2024 7:26 pm

I am successfully using JCEF to display HTML email contents. I'd like to access the URL under the mouse cursor (without clicking on the link). I've seen references to doing this using CefDisplayHandler::OnStatusMessage but I think this may refer only to CEF? Can I get the hovered URL in JCEF?
Last edited by markhen on Mon May 20, 2024 4:49 pm, edited 1 time in total.
markhen
Newbie
 
Posts: 8
Joined: Fri Jan 20, 2023 6:49 pm

Re: Access URL under mouse cursor?

Postby markhen » Fri May 17, 2024 5:09 pm

Ok, I have a method that will work (with some additional parsing)

Code: Select all
public class MyDisplayHandler extends CefDisplayHandlerAdapter {
    @Override
    public void onStatusMessage(CefBrowser browser, String value) {
        // Handle the status message received from the browser
        System.out.println(">>>>>>>>> Received status message: " + value);
    }
}

.....

    client = cefApp.createClient();        // Create an instance of CEF Client
    client.addDisplayHandler(new MyDisplayHandler());


When running various messages may be output (including blank messages), but URLs under the mouse are also output (via the println in this example).
markhen
Newbie
 
Posts: 8
Joined: Fri Jan 20, 2023 6:49 pm


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 79 guests