I would like to change the referer. help.
Posted: Sat Jun 01, 2024 5:35 pm
Chromium1.LoadRequest(TempRequest) > When making a POST request
Redirects are connected automatically.
About 3 redirection URLs will appear. Select the specific URL you want.
You will see about 3 redirect URLs. Use the specific URL you want as Chromium1BeforeResourceLoad
if (Pos('https://www.briskbard.com/forum/', Request.Url) > 0) then
I would like to change the referer.
procedure TForm1.Chromium1BeforeResourceLoad(Sender: TObject;
const Browser: ICefBrowser; const Frame: ICefFrame; const Request: ICefRequest;
const Callback: ICefRequestCallback; out Result: TCefReturnValue);
var
TempOldMap, TempNewMap: ICefStringMultimap;
i: NativeUInt;
key, value: ustring;
begin
if (Pos('https://www.briskbard.com/forum/', Request.Url) > 0) then //This is an example.
begin
try
TempNewMap := TCefStringMultimapOwn.Create;
TempOldMap := TCefStringMultimapOwn.Create;
request.GetHeaderMap(TempOldMap);
i := 0;
while (i < TempOldMap.Size) do
begin
key := TempOldMap.Key;
value := TempOldMap.Value;
if key <> 'referer' then
begin
TempNewMap.Append(key, value);
end;
inc(i);
end;
TempNewMap.Append('referer', 'https://google.com');
request.SetHeaderMap(TempNewMap);
finally
TempNewMap := nil;
TempOldMap := nil;
end;
end;
This doesn't work.
You can try it yourself. Change is difficult.
I would like to change the specific URL referrer for the redirected part.
Redirects are connected automatically.
About 3 redirection URLs will appear. Select the specific URL you want.
You will see about 3 redirect URLs. Use the specific URL you want as Chromium1BeforeResourceLoad
if (Pos('https://www.briskbard.com/forum/', Request.Url) > 0) then
I would like to change the referer.
procedure TForm1.Chromium1BeforeResourceLoad(Sender: TObject;
const Browser: ICefBrowser; const Frame: ICefFrame; const Request: ICefRequest;
const Callback: ICefRequestCallback; out Result: TCefReturnValue);
var
TempOldMap, TempNewMap: ICefStringMultimap;
i: NativeUInt;
key, value: ustring;
begin
if (Pos('https://www.briskbard.com/forum/', Request.Url) > 0) then //This is an example.
begin
try
TempNewMap := TCefStringMultimapOwn.Create;
TempOldMap := TCefStringMultimapOwn.Create;
request.GetHeaderMap(TempOldMap);
i := 0;
while (i < TempOldMap.Size) do
begin
key := TempOldMap.Key;
value := TempOldMap.Value;
if key <> 'referer' then
begin
TempNewMap.Append(key, value);
end;
inc(i);
end;
TempNewMap.Append('referer', 'https://google.com');
request.SetHeaderMap(TempNewMap);
finally
TempNewMap := nil;
TempOldMap := nil;
end;
end;
This doesn't work.
You can try it yourself. Change is difficult.
I would like to change the specific URL referrer for the redirected part.