the website I have to deal with uses pop-ups. In the demos I looked into, pop-ups are simply disabled:
Code: Select all
Procedure TMainForm.Chromium1BeforePopup(....);
Result := (targetDisposition in [WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW]);
When the user later on closes a popup, I get a Chromium1Close followed (!!) by a Chromium1BeforeClose. In the demos, these events are handled like this;
Code: Select all
Procedure TMainForm.Chromium1Close(...);
PostMessage(Handle, CEF_DESTROY, 0, 0);
aAction := cbaDelay;
and
Procedure TMainForm.Chromium1BeforeClose(...);
CEFSentinel1.Start;
What I did to help myself was this:
Code: Select all
Procedure TMainForm.Chromium1Close(...);
If browser=Chromium1.Browser then
Begin
aAction := cbaDelay;
PostMessage(Handle, CEF_DESTROY, 0, 0);
End
Else
aAction := cbaClose;
and
Procedure TMainForm.Chromium1BeforeClose(...);
If browser=Chromium1.Browser then
CEFSentinel1.Start;
My question is: How do I have to correctly handle pop-ups and not mess the rest of my program?
Thank you very much for any idea on this!
Lu