TAdvWebbrowser and touch display

i using a TAdvWebbrowser on a computer with touch display.
The TAdvWebbrowser has loaded a PDF document.
My Program needs to know, if the user is still working with the browser (scrolling, clicking).
But the events onClick etc. doesn't work if i using a touch display. Also the functions
" mouse.CursorPos.x" or "GetCursorPos" didn't work as long i working within the browser area.
What can i do to get a event or the mouse position within the browser area?



The browser consumes all events. It's currently not redirected to the wrapper control, so the events are not triggered. To handle the events at browser level, you'll have to create a JavaScript bridge and capture the mouse events there, then send a message to the wrapper control.

This is an example to register a bridge, and to communicate with the wrapper below is an example.

To register mouse events in JavaScript:

All these events are connected to a control inside a html document. But i have loaded a PDF document using LoadFile().

At first I thought I could work around it by embedding the PDF in an HTML document, but even if i load the pdf into an iFrame, it didn't work. That's because: iFrame<>PdfViewer.

  <iframe onclick="myFunction()" src="test.pdf" width="100%" height="400px" id="pdfbox" >
    function myFunction() {
      var obj = window.chrome.webview.hostObjects.sync.MyBridge;
      if (obj) {
        obj.ObjectMessage = "Hello World";

You could convert the PDF to base64 first with TAdvUtils.FileToBase64 and

s := 'data:application/pdf;base64,' + TAdvUtils.FileToBase64(MyPDF);

Then include that string in the HTML/iFrame