Autor Beitrag
Nowo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 108



BeitragVerfasst: Do 11.06.09 01:39 
Hallo Delphi-Forum
In meinem Delphi Webbrowser würde ich gerne den Useragent wechseln,
will heißen als was der WebBrowser sich ausgiebt.

Bei Firefox gibts dafür in der about:config den schönen Eintrag: "general.useragent.override"

Wie definiere ich den denn im Delphi Webbrowser ?



Nowo

_________________
Grüße Nowo


Zuletzt bearbeitet von Nowo am Do 11.06.09 12:15, insgesamt 1-mal bearbeitet
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 11.06.09 05:07 
Hallo

Eine Möglichkeit wäre das setzen des Useragents mittels UrlMkSetSessionOption:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
uses
  URLMon;

procedure SetUserAgent(const UserAgent: String):
begin
  UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, PChar(UserAgent), Length(UserAgent), 0);
end;


Eine andere: u.a. IDispatch implementieren und im Invoke bei DISPID_AMBIENT_USERAGENT den Useragent setzen (Siehe EmbeddedWB od. EwbCore von bsalsa.com)
Nowo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 108



BeitragVerfasst: Do 11.06.09 12:03 
Merci mon ami

_________________
Grüße Nowo