Skip to content
Snippets Groups Projects
Commit e1517318 authored by Monroe Linden's avatar Monroe Linden
Browse files

Fix for EXT-6615 (SL webkit no longer reports "Second Life" in the HTTP_USER_AGENT)

The issue here is that initBrowserWindow() was doing the wrong thing if it got called after the set_user_agent message was received.

Made the handler for the set_user_agent message save the string in a member variable (mUserAgent).

Initialize mUserAgent to the default string in the MediaPluginWebKit constructor.

initBrowserWindow() now sets the user agent string from mUserAgent instead of from a literal.
parent eeeca917
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,7 @@ class MediaPluginWebKit : ...@@ -89,6 +89,7 @@ class MediaPluginWebKit :
std::string mProfileDir; std::string mProfileDir;
std::string mHostLanguage; std::string mHostLanguage;
std::string mUserAgent;
bool mCookiesEnabled; bool mCookiesEnabled;
bool mJavascriptEnabled; bool mJavascriptEnabled;
bool mPluginsEnabled; bool mPluginsEnabled;
...@@ -300,7 +301,7 @@ class MediaPluginWebKit : ...@@ -300,7 +301,7 @@ class MediaPluginWebKit :
LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this ); LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this );
// append details to agent string // append details to agent string
LLQtWebKit::getInstance()->setBrowserAgentId( "LLPluginMedia Web Browser" ); LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
#if !LL_QTWEBKIT_USES_PIXMAPS #if !LL_QTWEBKIT_USES_PIXMAPS
// don't flip bitmap // don't flip bitmap
...@@ -688,6 +689,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ ...@@ -688,6 +689,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_
mHostLanguage = "en"; // default to english mHostLanguage = "en"; // default to english
mJavascriptEnabled = true; // default to on mJavascriptEnabled = true; // default to on
mPluginsEnabled = true; // default to on mPluginsEnabled = true; // default to on
mUserAgent = "LLPluginMedia Web Browser";
} }
MediaPluginWebKit::~MediaPluginWebKit() MediaPluginWebKit::~MediaPluginWebKit()
...@@ -1103,8 +1105,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) ...@@ -1103,8 +1105,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
} }
else if(message_name == "set_user_agent") else if(message_name == "set_user_agent")
{ {
std::string user_agent = message_in.getValue("user_agent"); mUserAgent = message_in.getValue("user_agent");
LLQtWebKit::getInstance()->setBrowserAgentId( user_agent ); LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
} }
else if(message_name == "init_history") else if(message_name == "init_history")
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment