diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index d081109acc57e3298b1a2940e1f58962e7f56064..5a208ece71fa778b82b40a4415f6f03db5fc1603 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -842,6 +842,14 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled)
 	sendMessage(message);
 }
 
+
+void LLPluginClassMedia::enableMediaPluginDebugging( bool enable )
+{
+	LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "enable_media_plugin_debugging");
+	message.setValueBoolean( "enable", enable );
+	sendMessage( message );
+}
+
 void LLPluginClassMedia::setTarget(const std::string &target)
 {
 	mTarget = target;
@@ -1066,6 +1074,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
 			mAuthURL = message.getValue("url");
 			mAuthRealm = message.getValue("realm");
 			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST);
+		}		
+		else if(message_name == "debug_message")
+		{
+			mDebugMessageText = message.getValue("message_text");
+			mDebugMessageLevel = message.getValue("message_level");
+			mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_DEBUG_MESSAGE);
 		}
 		else
 		{
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index e7f303275e92fa1f6632a5465210b25c61f6fd46..84a3dbed6d3f465a036cca0bc44dc4d1814d01ec 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -118,6 +118,9 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 
 	void scrollEvent(int x, int y, MASK modifiers);
 
+	// enable/disable media plugin debugging messages and info spam
+	void enableMediaPluginDebugging( bool enable );
+
 	// Javascript <-> viewer events
 	void jsEnableObject( bool enable );
 	void jsAgentLocationEvent( double x, double y, double z );
@@ -243,6 +246,10 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 
 	// This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE
 	std::string getClickUUID() const { return mClickUUID; };
+
+	// These are valid during MEDIA_EVENT_DEBUG_MESSAGE
+	std::string getDebugMessageText() const { return mDebugMessageText; };
+	std::string getDebugMessageLevel() const { return mDebugMessageLevel; };
 
 	// This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
 	S32 getStatusCode() const { return mStatusCode; };
@@ -395,6 +402,8 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 	std::string		mClickNavType;
 	std::string		mClickTarget;
 	std::string		mClickUUID;
+	std::string		mDebugMessageText;
+	std::string		mDebugMessageLevel;
 	S32				mGeometryX;
 	S32				mGeometryY;
 	S32				mGeometryWidth;
diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h
index 5a4fb1ce906f8872a19604d62d307e0671ec0dee..2f3edba7f368d5488ce02d892e7b45730a6ce345 100644
--- a/indra/llplugin/llpluginclassmediaowner.h
+++ b/indra/llplugin/llpluginclassmediaowner.h
@@ -64,6 +64,8 @@ class LLPluginClassMediaOwner
 
 		MEDIA_EVENT_AUTH_REQUEST,			// The plugin wants to display an auth dialog
 
+		MEDIA_EVENT_DEBUG_MESSAGE,			// plugin sending back debug information for host to process
+
 		MEDIA_EVENT_LINK_HOVERED			// Got a "link hovered" event from the plugin
 		
 	} EMediaEvent;
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 96f642f2a04f2341b02ee7d210533c57e9abb042..b87af85bcf930f804559e15e964db18490d21661 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -90,6 +90,7 @@ class MediaPluginWebKit :
 	bool mCookiesEnabled;
 	bool mJavascriptEnabled;
 	bool mPluginsEnabled;
+	bool mEnableMediaPluginDebugging;
 
 	enum
 	{
@@ -119,6 +120,17 @@ class MediaPluginWebKit :
 	
 	VolumeCatcher mVolumeCatcher;
 
+	void postDebugMessage( const std::string& msg )
+	{
+		if ( mEnableMediaPluginDebugging )
+		{
+			LLPluginMessage debug_message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "debug_message");
+			debug_message.setValue("message_text", "Media> " + msg);
+			debug_message.setValue("message_level", "info");
+			sendMessage(debug_message);
+		}
+	}
+	
 	void setInitState(int state)
 	{
 //		std::cerr << "changing init state to " << state << std::endl;
@@ -252,6 +264,9 @@ class MediaPluginWebKit :
 		std::string component_dir = application_dir;
 #endif
 
+		// debug spam sent to viewer and displayed in the log as usual
+		postDebugMessage( "Component dir set to: " + component_dir );
+
 		// window handle - needed on Windows and must be app window.
 #if LL_WINDOWS
 		char window_title[ MAX_PATH ];
@@ -266,10 +281,16 @@ class MediaPluginWebKit :
 		if ( result )
 		{
 			mInitState = INIT_STATE_INITIALIZED;
-			
+
+			// debug spam sent to viewer and displayed in the log as usual
+			postDebugMessage( "browser initialized okay" );
+
 			return true;
 		};
 
+		// debug spam sent to viewer and displayed in the log as usual
+		postDebugMessage( "browser nOT initialized." );
+
 		return false;
 	};
 
@@ -292,20 +313,30 @@ class MediaPluginWebKit :
 		if(!mHostLanguage.empty())
 		{
 			LLQtWebKit::getInstance()->setHostLanguage(mHostLanguage);
+			postDebugMessage( "Setting language to " + mHostLanguage );
 		}
 
 		// turn on/off cookies based on what host app tells us
 		LLQtWebKit::getInstance()->enableCookies( mCookiesEnabled );
-
+		
 		// turn on/off plugins based on what host app tells us
 		LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled );
 
 		// turn on/off Javascript based on what host app tells us
 		LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled );
-		
+
+		std::stringstream str;
+		str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled;
+		postDebugMessage( str.str() );
+
 		// create single browser window
 		mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight, mTarget);
 
+		str.str("");
+		str.clear();
+		str << "Setting browser window size to " << mWidth << " x " << mHeight;
+		postDebugMessage( str.str() );
+
 		// tell LLQtWebKit about the size of the browser window
 		LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight );
 
@@ -314,6 +345,7 @@ class MediaPluginWebKit :
 
 		// append details to agent string
 		LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
+		postDebugMessage( "Updating user agent with " + mUserAgent );
 		
 #if !LL_QTWEBKIT_USES_PIXMAPS
 		// don't flip bitmap
@@ -410,7 +442,10 @@ class MediaPluginWebKit :
 			message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
 			message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
 			sendMessage(message);
-		
+
+			// debug spam sent to viewer and displayed in the log as usual
+			postDebugMessage( "Navigate begin event at: " + event.getEventUri() );
+
 			setStatus(STATUS_LOADING);
 		}
 
@@ -452,6 +487,8 @@ class MediaPluginWebKit :
 			setInitState(INIT_STATE_NAVIGATE_COMPLETE);
 		}
 
+		// debug spam sent to viewer and displayed in the log as usual
+		postDebugMessage( "Navigate complete event at: " + event.getEventUri() );
 	}
 
 	////////////////////////////////////////////////////////////////////////////////
@@ -824,6 +861,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_
 	mHostLanguage = "en";		// default to english
 	mJavascriptEnabled = true;	// default to on
 	mPluginsEnabled = true;		// default to on
+	mEnableMediaPluginDebugging = false;
 	mUserAgent = "LLPluginMedia Web Browser";
 }
 
@@ -1167,6 +1205,12 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			{
 				authResponse(message_in);
 			}
+			else
+			if(message_name == "enable_media_plugin_debugging")
+			{
+				mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" );
+			}
+
 			else
 			if(message_name == "js_enable_object")
 			{
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 33541b559b1cfef7eb6caf65956cdeab6b8fb4bc..c47a0d5912e6b6256fc11e77271fbe24205e4550 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5437,6 +5437,17 @@
       <key>Value</key>
       <real>60.0</real>
     </map>
+  <key>MediaPluginDebugging</key>
+  <map>
+    <key>Comment</key>
+    <string>Turn on debugging messages that may help diagnosing media issues (WARNING: May reduce performance).</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
   <key>MediaControlFadeTime</key>
   <map>
     <key>Comment</key>
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 1eb786f433d873008c1f34e628c7bec12fb0c0e7..90267c173c4703e0e910e9258569231a6c7b6779 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -1065,6 +1065,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
 			mHoverTextChanged = true;
 		};
 		break;
+
+		case MEDIA_EVENT_DEBUG_MESSAGE:
+		{
+			LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL; 
+		};
+		break;
 	};
 
 	// chain all events to any potential observers of this object.
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 384f7cd61d32423c005156e7f87b54db3fc6a332..31b22119cbcf60a8f5377bf53badeb8353755b73 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1776,6 +1776,7 @@ void LLViewerMediaImpl::createMediaSource()
 			LL_WARNS("Media") << "Failed to initialize media for mime type " << mMimeType << LL_ENDL;
 		}
 	}
+
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -1880,7 +1881,10 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			// collect 'javascript enabled' setting from prefs and send to embedded browser
 			bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
 			media_source->setJavascriptEnabled( javascript_enabled );
-			
+		
+			bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
+			media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled );
+
 			media_source->setTarget(target);
 			
 			const std::string plugin_dir = gDirUtilp->getLLPluginDir();