function CookieVisitorProc(
const name, value, domain, path: ustring;
secure, httponly, hasExpires: Boolean;
const creation, lastAccess, expires: TDateTime;
count, total: Integer;
out deleteCookie: Boolean): Boolean;
var
TempCookie : TCookie;
begin
deleteCookie := false;
TempCookie.
name :=
name;
TempCookie.value := value;
TempCookie.domain := domain;
TempCookie.path := path;
TempCookie.secure := secure;
TempCookie.httponly := httponly;
TempCookie.creation := creation;
TempCookie.last_access := lastAccess;
TempCookie.has_expires := hasExpires;
TempCookie.expires := expires;
Form26.AddCookieInfo(TempCookie);
if (count = pred(total))
then
begin
if (TForm26 <>
nil)
and Form26.HandleAllocated
then
PostMessage(Form26.Handle, MINIBROWSER_SHOWCOOKIES, 0, 0);
Result := False;
end
else
Result := True;
end;
procedure TForm26.AddCookieInfo(
const aCookie : TCookie);
begin
// This should be protected by a mutex.
// FText := FText + aCookie.name + ' : ' + aCookie.value + #13 + #10;
FText := FText + aCookie.
name + '
: ' + aCookie.value + '
;';
end;
procedure TForm26.BrowserCreatedMsg(
var aMessage : TMessage);
begin
EdgeBrowser1.navigate('
http://google.co.id');
AmbilCooki;
end;
procedure TForm26.AmbilCooki;
var
cookiemanag : ICefCookieManager;
begin
cookiemanag := TCefCookieManagerRef.Global(
nil); <-- Wenn ich den Fehler unten einmal ausklammer, erhalte ich hier zur Laufzeit immer eine
Exception, dass hierauf nicht zugegriffen werden kann
cookiemanag.VisitAllCookies(FVisitor); <-- Fehler
MemoCookies.Text := FText;
end;