changed enable to enabled
authorRiccardo Pelizzi <r.pelizzi@gmail.com>
Mon, 23 Jan 2012 13:20:26 -0500
changeset 39 f950386b1e592fd75f3086e81336c361d02256d8
parent 38 f09a80187e7aeb8a9d2e007e991945a7ce6eec12
child 40 92d980375b5b59aefe03213b973a22b3b121615d
push id23
push userr.pelizzi@gmail.com
push dateTue, 24 Jan 2012 04:20:38 +0000
changed enable to enabled
xssfilter
--- a/xssfilter
+++ b/xssfilter
@@ -1221,17 +1221,17 @@ new file mode 100644
 +
 +nsXSSFilter::~nsXSSFilter()
 +{ }
 +
 +
 +void
 +nsXSSFilter::InitializeStatics()
 +{
-+  Preferences::AddBoolVarCache(&sXSSEnabled, "security.xssfilter.enable");
++  Preferences::AddBoolVarCache(&sXSSEnabled, "security.xssfilter.enabled");
 +  Preferences::AddBoolVarCache(&sReportOnly, "security.xssfilter.reportOnly");
 +  Preferences::AddBoolVarCache(&sBlockMode, "security.xssfilter.blockMode");
 +#ifdef PR_LOGGING
 +  if (!gXssPRLog)
 +    gXssPRLog = PR_NewLogModule("XSS");
 +#endif
 +  LOG_XSS("Initialized Statics for XSS Filter");
 +}
@@ -5148,49 +5148,50 @@ diff --git a/docshell/resources/content/
      </div>
  
      <!-- PAGE CONTAINER (for styling purposes only) -->
      <div id="errorPageContainer">
      
 diff --git a/docshell/test/navigation/navigate.html b/docshell/test/navigation/navigate.html
 --- a/docshell/test/navigation/navigate.html
 +++ b/docshell/test/navigation/navigate.html
-@@ -1,14 +1,21 @@
+@@ -1,14 +1,22 @@
  <html>
  <head>
      <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
      <script src="NavigationUtils.js"></script>
      <script>
      function navigate() {
 +        // some tests using this page will trigger an xss violation
 +        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 +        var prefService = Components.classes["@mozilla.org/preferences-service;1"]
 +	.getService(Components.interfaces.nsIPrefService);
-+        var cspBranch = prefService.getBranch("security.xssfilter.");
-+        cspBranch.setBoolPref("enabled", false);
++        var xssBranch = prefService.getBranch("security.xssfilter.");
++        originalValue = xssBranch.getBoolPref("enabled");
++        xssBranch.setBoolPref("enabled", false);
 +
          var arguments = window.location.hash.substring(1).split(",");
          var target = arguments[0];
          var mechanism = arguments[1];
  
          switch(mechanism) {
          case "location":
            navigateByLocation(eval(target));
            break;
-@@ -17,16 +24,19 @@
+@@ -17,16 +25,19 @@
            break;
          case "form":
            navigateByForm(target);
            break;
          case "hyperlink":
            navigateByHyperlink(target);
            break;
          }
 +
-+        cspBranch.setBoolPref("enabled", true);
++        xssBranch.setBoolPref("enabled", originalValue);
 +
      }
      </script>
  </head>
  <body onload="navigate();">
  <script>
  var arguments = window.location.hash.substring(1).split(",");
  var target = arguments[0];
@@ -5851,17 +5852,17 @@ diff --git a/modules/libpref/src/init/al
  pref("security.checkloaduri", true);
  pref("security.xpconnect.plugin.unrestricted", true);
  // security-sensitive dialogs should delay button enabling. In milliseconds.
  pref("security.dialog_enable_delay", 2000);
  
  pref("security.csp.enable", true);
  pref("security.csp.debug", false);
  
-+pref("security.xssfilter.enable", true);
++pref("security.xssfilter.enabled", true);
 +pref("security.xssfilter.reportOnly", false);
 +pref("security.xssfilter.blockMode", false);
 +pref("security.xssfilter.displayWarning", true);
 +
  // Modifier key prefs: default to Windows settings,
  // menu access key = alt, accelerator key = control.
  // Use 17 for Ctrl, 18 for Alt, 224 for Meta, 0 for none. Mac settings in macprefs.js
  pref("ui.key.accelKey", 17);