fixed superpowers bug
authorRiccardo Pelizzi <r.pelizzi@gmail.com>
Mon, 23 Jan 2012 23:20:30 -0500
changeset 41 6ab9e7c4d646bd0e1d1f90eedb99061f0e174052
parent 40 92d980375b5b59aefe03213b973a22b3b121615d
child 42 0b9377ea878bf6998a912cd94c5a6c351cf57aac
push id23
push userr.pelizzi@gmail.com
push dateTue, 24 Jan 2012 04:20:38 +0000
fixed superpowers bug
xssfilter
--- a/xssfilter
+++ b/xssfilter
@@ -5148,50 +5148,55 @@ 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,22 @@
+@@ -1,14 +1,27 @@
  <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
++
++    function setXss(value) {        
 +        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 +        var prefService = Components.classes["@mozilla.org/preferences-service;1"]
-+	.getService(Components.interfaces.nsIPrefService);
++	  .getService(Components.interfaces.nsIPrefService);
 +        var xssBranch = prefService.getBranch("security.xssfilter.");
 +        originalValue = xssBranch.getBoolPref("enabled");
-+        xssBranch.setBoolPref("enabled", false);
++        xssBranch.setBoolPref("enabled", value);
++    }
++
+     function navigate() {
++        // some tests using this page will trigger an xss violation
++        setXss(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 +25,19 @@
+@@ -17,16 +30,19 @@
            break;
          case "form":
            navigateByForm(target);
            break;
          case "hyperlink":
            navigateByHyperlink(target);
            break;
          }
 +
-+        xssBranch.setBoolPref("enabled", originalValue);
++        setXss(true);
 +
      }
      </script>
  </head>
  <body onload="navigate();">
  <script>
  var arguments = window.location.hash.substring(1).split(",");
  var target = arguments[0];