Do JS Range functions (caretRangeFromPoint()) work with JCEF

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

Do JS Range functions (caretRangeFromPoint()) work with JCEF

Postby MariaSh » Thu Dec 01, 2022 7:18 am

Hi,

Firstly, thanks for the useful comments on this community forum.

I need to get places (indexes) where the line breaks occurred in a plain html web page. I figured, that one way is to find them through js using Chromium + JCEF. In normal mode my js works, but in headless mode it can not get caretRangeFromPoint() and also all js range functions, are not working. (It still can get getClientRects())

(I found, that there was a bug with caretRangeFromPoint() when user-select: none; but this is not the problem in my case)

Is this expected behavior in headless mode?

I'm using in detailed MainFrame, but only with JS and Load handlers (and Chromium + JCEF in headless mode on UBUNTO.)

Thank you in advance
MariaSh
Newbie
 
Posts: 2
Joined: Thu Dec 01, 2022 7:11 am

Re: Do JS Range functions (caretRangeFromPoint()) work with

Postby Phylanx » Fri Dec 02, 2022 2:02 am

Alternativly you can get the HTML via cefBrowser.viewSource and getSource (i guess) into a Java String and have a look on the content there.
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: Do JS Range functions (caretRangeFromPoint()) work with

Postby MariaSh » Fri Dec 02, 2022 2:37 am

Thank you Phylanx, but I meant, that I need places, where browser decides to make a new line in the text of a web page. Excuse me, for not being clear and thank you again
MariaSh
Newbie
 
Posts: 2
Joined: Thu Dec 01, 2022 7:11 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 14 guests