2
I know it is possible to capture the FIREFOX URL using Ddeclient, but someone else has already used it to get the source code of the open page ?
Follow the code to capture the title:
procedure TForm1.GetCurrentURL(var sURL: String; var sTitle: String; var sSource: String);
var
DDEClient : TDDEClientConv;
s : String;
begin
s := '';
try
DDEClient := TDDEClientConv.Create(self);
with DDEClient do
begin
if SetLink('IExplore','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle');
sSource := 'Source: IE';
end
else
if SetLink('Netscape','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle');
sSource := 'Source: IE';
end
else
if SetLink('Mosaic','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle');
sSource := 'Source: Mosaic';
end
else
if SetLink('Chrome','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle');
sSource := 'Source: Netscape 6';
end
else
if SetLink('Mozilla','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle');
sSource := 'Source: Mozilla';
end
else
if SetLink('Firefox','WWW_GetWindowInfo') then
begin
s := RequestData('0xFFFFFFFF, sURL, sTitle, sSource');
sSource := 'Source: FireFox';
end;
end;
if s <> '' then
begin
Delete(s, 1, 1);
sURL := 'URL: ' +Copy(s, 1, pos('","',s)-1);
Delete(s, 1, Pos('","', s)+2);
sTitle := 'Title: ' +Copy(s, 1, Pos('"', s) - 1);
end;
exit;
except
MessageDlg('URL attempt failed!',mtError,[mbOK],0);
end;
end;
To Use:
procedure TForm1.Button1Click(Sender: TObject);
var
sURL, sTitle, sSource: String;
begin
GetCurrentURL(sURL, sTitle, sSource);
Memo1.Lines.Add(sURL);
Memo1.Lines.Add(sTitle);
Memo1.Lines.Add(sSource);
end;
boy, stop using DDE ;)
– EMBarbosa
@Embarbosa, still I did not find the solution to capture the firefox source by Delphi rsrsrs..
– user7605
The way the question was asked seemed like you are wanting to "spy" on what the user is doing while browsing. I think it’ll be hard for anyone to want to help you. However, you could use a component like Twebbrowser to have the user navigate through your application. The case would be different...
– EMBarbosa
It’s not this @Embarbosa, if it was for this, would use several software ready to sell the internet and would not waste time with this, is that I’m making an advertising system, and only managed to make work in IE, FIREFOX could not. Just that. I updated the answer, see.
– user7605