Both (some links don't work, onBeforeBrowse is not called for some links).
I will try to put together illustrative example(s) without sharing sensitive or 3rd party content.
Bullets on what I'm doing:
- I create CefApp, Client and Browser
- CEF Browser is loaded with email HTML content from a local file using createBrowser()
- I have overridden onBeforeBrowse():
- if the URL passed is a local email file it will display in the CEF browser JFrame - and onBeforeBrowse returns false
- if the URL is HTTP it is passed to the system browser - and onBeforeBrowse returns true
- CEF Browser is displayed in a JFrame - emails render perfectly
- Links behave visually as expected - cursor changes, link highlights etc. per the email HTML code
- Clicking on links in displayed emails I see 2 behaviors:
- onBeforeBrowse() is called, link URL is passed in correctly, opens in the system browser
- OR, onBeforeBrowse() is not called when a link is clicked (nothing happens visually or at my app level)
- The behaviors are not "random", for example:
- underlined text links in the body of an Apple subscription confirmation email don't call onBeforeBrowse, but underlined text links at the end of the page do
- none of the links in daily digest emails from LinkedIn result in call to onBeforeBrowse()
- the "button" links in AT&T survey emails don't call onBeforeBrowse(), but the underlined text links do
As stated in my original post, if I open the local email HTML files directly with the system browser, all links work correctly.
Since the links behave visually as expected (cursor changes etc.) it appears CEF understands the link is a valid link?
Could it be that the mouse click is not detected under certain HTML conditions? That seems a little far fetched?
Thanks -
Mark