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.

OSR Browser question

Post Reply
Briskitte Bardot
Posts: 6
Joined: Mon Sep 14, 2020 6:04 am

OSR Browser question

Post by Briskitte Bardot »

Hi,
I've been looking at the SimpleOSRBrowser demo, and don't fully understand it.
The demo uses the same TChromium component as MiniBrowser, and it displays the websites on screen. What is it that makes it OSR?
Can the visible browser be used to login and browse to a specific webpage, and then "clone" that page in OSR mode with a different resolution? If I for example, would like to render a webpage at a resolution of 2000x3000, which is bigger than my screen.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: OSR Browser question

Post by salvadordf »

Briskitte Bardot wrote: Mon Sep 14, 2020 6:21 pm Hi,
I've been looking at the SimpleOSRBrowser demo, and don't fully understand it.
The demo uses the same TChromium component as MiniBrowser, and it displays the websites on screen. What is it that makes it OSR?
The OSR demos have a totally different way to show the web contents. Those demos get the raw bitmap data in the TChromium.OnPaint event and the application shows that data in a custom panel.

A browser in OSR mode also uses some methods and events to handle the screen properties, mouse events, keyboard events, etc.
Briskitte Bardot wrote: Mon Sep 14, 2020 6:21 pm Can the visible browser be used to login and browse to a specific webpage, and then "clone" that page in OSR mode with a different resolution? If I for example, would like to render a webpage at a resolution of 2000x3000, which is bigger than my screen.
As I commented before, your application would have to use a TChromium event to inform the browser about the screen properties : size, scale, etc.
https://github.com/salvadordf/CEF4Delph ... r.pas#L432

Read this for more information about the events used in OSR mode :
https://magpcss.org/ceforum/apidocs3/pr ... ndler.html
Briskitte Bardot
Posts: 6
Joined: Mon Sep 14, 2020 6:04 am

Re: OSR Browser question

Post by Briskitte Bardot »

Thank you very much for pointing me in the right direction. :)
One mistake I made was not noticing that the OSR demo used a TBufferPanel instead of a TCefWindowParent. Now I know how to proceed, with both this and the question I had in another thread about reloading a canvas.
I don't promise I won't be back with other questions though. ;)
Post Reply