Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Change browser size

celitojr
Posts: 10
Joined: Fri May 06, 2022 2:05 pm

Re: Change browser size

Post by celitojr »

dilfich wrote: Wed Nov 27, 2024 4:42 am OSRBrowser

GetScreenInfo - transmits the size of the monitor (desktop)
GetViewRect - transmits the size of the browser

You can change it on the go, when the page loads again, the site will receive new permission data.
I tried your approach, as described in the other comment, but without success. However, combining it with what I had already done, it was useful to me. I'm still testing it here, but it seems to have worked. Thanks for now.
celitojr
Posts: 10
Joined: Fri May 06, 2022 2:05 pm

Re: Change browser size

Post by celitojr »

salvadordf wrote: Sat Nov 30, 2024 10:27 am I just uploaded a new version of CEF4Delphi with some fixes to the ConsoleBrowser2 demo.

See that ConsoleBrowser2 has some disabled code that it's used to test the new UpdateBrowserSize function :
https://github.com/salvadordf/CEF4Delphi/blob/6badc8f3bd460f06bae7f6a32f69ba6d58bfb8b0/demos/Delphi_VCL/ConsoleBrowser2/uEncapsulatedBrowser.pas#L200
Thanks salvadordf. I tried your suggestion but it didn't work either.
Anyway, I applied the changes you made to TCEFBrowserBitmap to my project (I'm not using the latest version of the framework) and made some adjustments to TCEFBrowserThread as per your demo. That wasn't enough but it helped me. I combined this with the suggestion given by dilfich. I'm still testing it but it seems to be OK now. Although I still don't feel confident that I'm doing it the right way (the framework is new to me).
For now, I think we can close this discussion. If anything happens I'll write back here. I still have some issues to resolve but I'll post them in another thread.
Thanks everyone for your help.
Post Reply