Oh oh! To use the frames, you simple have to do this:
Code:
procedure TForm2.WebBrowser1NewWindow3(ASender: TObject; var ppDisp: IDispatch;
var Cancel: WordBool; dwFlags: Cardinal; const bstrUrlContext,
bstrUrl: WideString);
var
s: string;
begin
// cancel new window operation
Cancel := True;
WebBrowser1.Navigate(bstrURL, '', 'hmcontent');
end;
Just specify the frame name and it will "just work" without all the extra loading I was doing before.
Code:
begin // remove any slashes from the front
while (aURL <> '') and (aURL[1] = '/') do
Delete(aURL, 1, 1);
// remove any slashes from the back
while (aURL <> '') and (aURL[Length(aURL)] = '/') do
Delete(aURL, Length(aURL), 1);
// check for index.html/
if aURL.Contains('index.html/') then
begin
// remove from url
aURL := aURL.Replace('index.html/', '');
end;
// if empty its the room else endpoint is a file
if aURL.IsEmpty then
aURL := 'index.html';
// get mime type of file
aMIMEType := FindMimeType(aURL);
// load the file
WriteOutFile(GenFilename(aURL));
end;
Now, on to javascript issues. Oh, I tried the emulation and some other stuff, not working so far. Grrrr!
Bookmarks