there is a procedure that worked in an earlier version of CEF4Delphi that stopped working in that version.
the code passes a customized header with login and password data.
that the page takes from the header and automates the entry on the page.
Request := TCefRequestRef.New;
Request.Url := 'https://reds.cfconnect.com/user/acao/W9';
Request.Method := 'GET';
sUsuario := "loginFlex:password123"
Header := TCefStringMultimapOwn.Create;
Header.Append('Authorization', 'Flexmobile ' + sUsuario);
Header.Append('ShowToolbar', 'false');
Request.SetHeaderMap(Header);
oFormWeb.UrlRequest := Request;
xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
procedure TForm.BrowserCreatedMsg(var aMessage: TMessage);
begin
CEFWindowParent1.UpdateSize;
if UrlString <> EmptyStr then
wb.LoadURL(UrlString)
else
wb.Browser.MainFrame.LoadRequest(UrlRequest);
end;
But in the last version it stopped working
Has it changed the way to do this? or is it some mistake?
Best regards
Lenin
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.
CEF4 is not getting header value
CEF4 is not getting header value
CEF4 is not getting header value
I have a code that worked on a previous version of CEFDelphi and stopped working with updating the component to the latest version.
in the version it worked:
- libcef.dll version : 3.3396.1777.0
in the last version it is not working:
- libcef.dll version : 83.3.11.0
the code passed a login and password value to a custom header.
It takes values from the website header to authenticate.
But it's not working anymore.
Request := TCefRequestRef.New;
Request.Url := https://reds.connect.com:8081/user/acao/W9;
Request.Method := 'GET';
Header := TCefStringMultimapOwn.Create;
Header.Append('Authorization', 'Flexmobile ' + "Login123:password123");
Header.Append('ShowToolbar', 'false');
Request.SetHeaderMap(Header);
oFormWeb.UrlRequest := Request;
xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
public
procedure TfrmVisualizaMapa.BrowserCreatedMsg(var aMessage: TMessage);
begin
CEFWindowParent1.UpdateSize;
if UrlString <> EmptyStr then
wb.LoadURL(UrlString)
else
wb.Browser.MainFrame.LoadRequest(UrlRequest);
end;
Best Regards
Lenin
I have a code that worked on a previous version of CEFDelphi and stopped working with updating the component to the latest version.
in the version it worked:
- libcef.dll version : 3.3396.1777.0
in the last version it is not working:
- libcef.dll version : 83.3.11.0
the code passed a login and password value to a custom header.
It takes values from the website header to authenticate.
But it's not working anymore.
Request := TCefRequestRef.New;
Request.Url := https://reds.connect.com:8081/user/acao/W9;
Request.Method := 'GET';
Header := TCefStringMultimapOwn.Create;
Header.Append('Authorization', 'Flexmobile ' + "Login123:password123");
Header.Append('ShowToolbar', 'false');
Request.SetHeaderMap(Header);
oFormWeb.UrlRequest := Request;
xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx
protected
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEFBROWSER_CREATED;
public
procedure TfrmVisualizaMapa.BrowserCreatedMsg(var aMessage: TMessage);
begin
CEFWindowParent1.UpdateSize;
if UrlString <> EmptyStr then
wb.LoadURL(UrlString)
else
wb.Browser.MainFrame.LoadRequest(UrlRequest);
end;
Best Regards
Lenin
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: CEF4 is not getting header value
Hi
The LoadRequest procedure fails unless you first navigate to the request origin using some other mechanism (LoadURL, link click, etc).
You may see this error :
Here you have an example :
https://github.com/salvadordf/CEF4Delph ... r.pas#L438
The LoadRequest procedure fails unless you first navigate to the request origin using some other mechanism (LoadURL, link click, etc).
You may see this error :
If all you need is to add some custom HTTP headers consider using the TChromium.OnBeforeResourceLoad event or using the TChromium.CustomHeaderName and TChromium.CustomHeaderValue properties."bad IPC message" reason INVALID_INITIATOR_ORIGIN (213)
Here you have an example :
https://github.com/salvadordf/CEF4Delph ... r.pas#L438
Re: CEF4 is not getting header value
I used it and it worked well.
TChromium.CustomHeaderName
and TChromium.CustomHeaderValue.
Thank you
TChromium.CustomHeaderName
and TChromium.CustomHeaderValue.
Thank you