From e1517318c58d6796b5566d5cf96c02474fd7376e Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 29 Mar 2010 18:36:47 -0700 Subject: 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. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/media_plugins/webkit') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 85d6b2f5ff..436e077e9b 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -89,6 +89,7 @@ private: std::string mProfileDir; std::string mHostLanguage; + std::string mUserAgent; bool mCookiesEnabled; bool mJavascriptEnabled; bool mPluginsEnabled; @@ -300,7 +301,7 @@ private: LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this ); // append details to agent string - LLQtWebKit::getInstance()->setBrowserAgentId( "LLPluginMedia Web Browser" ); + LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); #if !LL_QTWEBKIT_USES_PIXMAPS // don't flip bitmap @@ -688,6 +689,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ mHostLanguage = "en"; // default to english mJavascriptEnabled = true; // default to on mPluginsEnabled = true; // default to on + mUserAgent = "LLPluginMedia Web Browser"; } MediaPluginWebKit::~MediaPluginWebKit() @@ -1103,8 +1105,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) } else if(message_name == "set_user_agent") { - std::string user_agent = message_in.getValue("user_agent"); - LLQtWebKit::getInstance()->setBrowserAgentId( user_agent ); + mUserAgent = message_in.getValue("user_agent"); + LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); } else if(message_name == "init_history") { -- cgit v1.2.3