Link substitution
Posted: Fri Jan 25, 2019 4:05 pm
How can I improve?
Doing this now...
Replace https://www.site.com/img/black.png on https://www.my_site.com/img_bak/now.png
This is true or can be as the otherwise or easier?
Doing this now...
Replace https://www.site.com/img/black.png on https://www.my_site.com/img_bak/now.png
Code: Select all
procedure TChr.BeforeResourceLoad.............
var
u: TUrlParts;
begin
if (Pos( '/img/black.png', request.Url) <> 0) then begin
if CefParseUrl(request.Url, u)then begin
u.scheme:= 'https';
u.host := 'www.my_site.com';
u.origin := 'https://my_site.com/';
u.path := '/img_bak/now.png';
u.query := '';
request.Url := CefCreateUrl(u);
end;
end;
end;