In the LoadModuleMessage, send the application supplied URL rather than the plugin's view of the URL.
This fixes the devmode tab title to display 'NewWebApp' or equivalent instead of 'hosted'.
http://code.google.com/p/google-web-toolkit/issues/detail?id=5908
Review at http://gwt-code-reviews.appspot.com/1318801
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9616 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/plugins/npapi/ScriptableInstance.cpp b/plugins/npapi/ScriptableInstance.cpp
index 1e74d4d..7acbeee 100644
--- a/plugins/npapi/ScriptableInstance.cpp
+++ b/plugins/npapi/ScriptableInstance.cpp
@@ -352,8 +352,15 @@
result->type = NPVariantType_Void;
return;
}
- //ignore args[0]. Get the URL from window.location.href instead.
+
+ // application provided URL string used for user facing things like the
+ // devmode tab title
+ const NPString appUrl = args[0].value.stringValue;
+ const string appUrlStr = convertToString(appUrl);
+
+ // window.location.href provided URL. (used for security)
const string urlStr = getLocationHref();
+
const NPString sessionKey = args[1].value.stringValue;
const NPString hostAddr = args[2].value.stringValue;
const NPString moduleName = args[3].value.stringValue;
@@ -405,7 +412,7 @@
string tabKeyStr = computeTabIdentity();
string sessionKeyStr = convertToString(sessionKey);
Debug::log(Debug::Debugging) << " connected, sending loadModule" << Debug::flush;
- connected = LoadModuleMessage::send(*_channel, urlStr, tabKeyStr, sessionKeyStr,
+ connected = LoadModuleMessage::send(*_channel, appUrlStr, tabKeyStr, sessionKeyStr,
moduleNameStr, userAgent, this);
BOOLEAN_TO_NPVARIANT(connected, *result);
result->type = NPVariantType_Bool;