Add access to user agent for wxWebView

Allow setting a custom user agent for a webview.
Also allow access to the current user agent.
This commit is contained in:
Tobias Taschner
2021-03-16 14:18:52 +01:00
committed by Tobias Taschner
parent d1efcc374b
commit 97e469c255
4 changed files with 57 additions and 3 deletions

View File

@@ -889,6 +889,28 @@ public:
*/
virtual bool IsAccessToDevToolsEnabled() const;
/**
Specify a custom user agent string for the web view.
Returns @true the user agent could be set.
If your first request should already use the custom user agent
please use two step creation and call SetUserAgent() before Create().
@note This is not implemented for IE. For Edge SetUserAgent()
MUST be called before Create().
@since 3.1.5
*/
virtual bool SetUserAgent(const wxString& userAgent);
/**
Returns the current user agent string for the web view.
@since 3.1.5
*/
virtual wxString GetUserAgent() const;
/**
@name History
*/