diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc
index f3144b1bfd9671..c645ee8187725e 100644
--- a/chrome_frame/chrome_frame_npapi.cc
+++ b/chrome_frame/chrome_frame_npapi.cc
@@ -55,6 +55,7 @@ const NPUTF8* ChromeFrameNPAPI::plugin_property_identifier_names_[] = {
"onprivatemessage",
"usechromenetwork",
"onclose",
+ "sessionid",
};
const NPUTF8* ChromeFrameNPAPI::plugin_method_identifier_names_[] = {
@@ -667,6 +668,14 @@ bool ChromeFrameNPAPI::GetProperty(NPIdentifier name,
plugin_property_identifiers_[PLUGIN_PROPERTY_USECHROMENETWORK]) {
BOOLEAN_TO_NPVARIANT(automation_client_->use_chrome_network(), *variant);
return true;
+ } else if (name == plugin_property_identifiers_[PLUGIN_PROPERTY_SESSIONID]) {
+ if (!is_privileged_) {
+ DLOG(WARNING) << "Attempt to read sessionid property while not "
+ "privileged";
+ } else {
+ INT32_TO_NPVARIANT(automation_client_->GetSessionId(), *variant);
+ return true;
+ }
}
return false;
diff --git a/chrome_frame/chrome_frame_npapi.h b/chrome_frame/chrome_frame_npapi.h
index d60609076ab31a..f05185cb0d24a6 100644
--- a/chrome_frame/chrome_frame_npapi.h
+++ b/chrome_frame/chrome_frame_npapi.h
@@ -47,6 +47,7 @@ class ChromeFrameNPAPI
PLUGIN_PROPERTY_ONPRIVATEMESSAGE,
PLUGIN_PROPERTY_USECHROMENETWORK,
PLUGIN_PROPERTY_ONCLOSE,
+ PLUGIN_PROPERTY_SESSIONID,
PLUGIN_PROPERTY_COUNT // must be last
} PluginPropertyId;
diff --git a/chrome_frame/ff_30_privilege_check.cc b/chrome_frame/ff_30_privilege_check.cc
index cecd4a0040c114..7031bd5d1b9aea 100644
--- a/chrome_frame/ff_30_privilege_check.cc
+++ b/chrome_frame/ff_30_privilege_check.cc
@@ -22,6 +22,7 @@
#include "chrome_frame/scoped_ns_ptr_win.h"
#include "chrome_frame/ns_associate_iid_win.h"
#include "chrome_frame/np_utils.h"
+#include "chrome_frame/utils.h"
#include "googleurl/src/gurl.h"
ASSOCIATE_IID(NS_ISERVICEMANAGER_IID_STR, nsIServiceManager);
@@ -29,6 +30,21 @@ ASSOCIATE_IID(NS_ISERVICEMANAGER_IID_STR, nsIServiceManager);
// Returns true iff we're being instantiated into a document
// that has the system principal's privileges
bool IsFireFoxPrivilegedInvocation(NPP instance) {
+ // For testing purposes, check the registry to see if the privilege mode
+ // is being forced to a certain value. If this property does not exist, the
+ // mode should be verified normally. If this property does exist, its value
+ // is interpreted as follows:
+ //
+ // 0: force privilege mode off
+ // 1: force privilege mode on
+ // any other value: do normal verification
+ int privilege_mode = GetConfigInt(2, kEnableFirefoxPrivilegeMode);
+ if (privilege_mode == 0) {
+ return false;
+ } else if (privilege_mode == 1) {
+ return true;
+ }
+
// Make sure that we are running in Firefox before checking for privilege.
const char* user_agent = npapi::UserAgent(instance);
if (strstr(user_agent, "Firefox") == NULL)
diff --git a/chrome_frame/test/data/sessionid.html b/chrome_frame/test/data/sessionid.html
new file mode 100644
index 00000000000000..14e84bc995fe29
--- /dev/null
+++ b/chrome_frame/test/data/sessionid.html
@@ -0,0 +1,39 @@
+
+
+