Einzelnen Beitrag anzeigen

marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#7

Re: [TWebBrowser] Alle StyleSheets auflisten

  Alt 9. Aug 2006, 20:48
Hallo Daniel,

Zitat von Daniel G:
Für mich ist es wichtig, dass ich alle Stylesheets bekomme, ...
probiere es so:

Delphi-Quellcode:
procedure ExtractStyleSheets(sc: IHTMLStyleSheetsCollection; s: TStrings);
var
  i: Integer;
  v: OleVariant;
  u: iUnknown;
  ss: IHTMLStyleSheet;
begin
  with sc do
    for i := 0 to Pred(length) do
    begin
      v := i;
      u := item(v);
      if Succeeded(u.QueryInterface(IID_IHTMLStyleSheet, ss)) then
        if ss.href = ''
          then ExtractStyleSheets(ss.imports, s)
          else s.Add(ss.href);
    end;
end;
Grüße vom marabu
  Mit Zitat antworten Zitat