salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.2k stars 365 forks source link

Width & Height of rendered HTML #444

Closed hafedh-trimeche closed 1 year ago

hafedh-trimeche commented 1 year ago

Hello,

Please how to extract full Width & Height of the rendered HTML?

Best regards.

salvadordf commented 1 year ago

Hi,

You need to execute JavaScript to get those values and then send them to Delphi using a console message or registering a JavaScript extension. See the DOMVisitor and JSExtension demos.

These are some search results for "how to get page size in javascript" : https://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window https://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript https://stackoverflow.com/questions/58099664/how-to-get-full-page-height-with-javascript