If I understand, this is about handling "CloseBrowser" calls, before the "OnBrowserCreated" event?salvadordf wrote: Sat Mar 20, 2021 2:06 pm I'll move some of the TLazChromium code to TChromiumCore as soon as I have time.![]()
(if not, ignore the below)
Any idea how to do that in MultiBrowser mode?
There may be more than one browser, that is in creation. How to know which one to close?
It would be possible to have a field in TBrowserInfo to indicate that it is a dummy entry for a browser in creation.
Then that could be added, right before the call to create the browser.
But with more that one browser in creation, there is no way to say in which order they receive their call to TChromiumCore.doOnAfterCreated.
(i.e. who knows, an OSR browser may be created faster than a none OSR? If not now, then maybe in future).
So how would TChromiumCore.doOnAfterCreated know which "in creation TBrowserInfo" to update?
Browser in creation do not have an id, but with an "in creation TBrowserInfo" they would be accessible via BrowserByIndex.
That means the code calling CreateBrowser can store BrowserCount as the new index.
But that index only stays valid, if TChromiumCore.doOnAfterCreated can find the correct entry.
=======
Without the access by index, the user can only select fully created browsers. (Because the current BrowserId will always be set to one of them).
So the user can only call "CloseBrowser" for a "browser in creation" if there are no (or no more) fully created browsers.
So having access by index, would be nice.
Any ideas?