Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Link substitution

Post Reply
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Link substitution

Post by dilfich »

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

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;
This is true or can be as the otherwise or easier?
User avatar
salvadordf
Posts: 4047
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Link substitution

Post by salvadordf »

Your code seems OK to me.
Post Reply