TFrameViewer, and TFrameBrowser components
property OnBlankWindowRequest: TWindowRequestEvent;
The OnBlankWindowRequest event occurs when the URL Target attribute is either "_blank" or has a window name not defined elsewhere in the HTML document. The user should then open a new window for the URL. An easy way to do this is to launch a second instance of the program.
This event handler opens a new instance of the program and passes it the URL.
procedure TForm1.WindowRequest(Sender: TObject; const Target,
URL: string);
var
S, Dest: string[255];
I: integer;
PC: array[0..255] of char;
begin
S := URL;
I := Pos('#', S);
if I >= 1 then
begin
Dest := System.Copy(S, I, 255); {local destination}
S := System.Copy(S, 1, I-1); {the file name}
end
else
Dest := ''; {no local destination}
S := FrameViewer.HTMLExpandFileName(S);
if FileExists(S) then
WinExec(StrPCopy(PC, ParamStr(0)+' '+S+Dest), sw_Show);
end;