Bug 1427726 - remove support for remote JAR files, r?michal draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 07 Feb 2018 13:54:39 +0000
changeset 780415 482b3eb780f22d1c2913f2e2ee050e5960851d7e
parent 780414 28a1468b3b08d74ab0d70ed2ffc8dee1a33917d5
child 780416 21c79896aaf7b27eab2e6e42ce7b897256a8d357
push id105989
push userbmo:gijskruitbosch+bugs@gmail.com
push dateWed, 11 Apr 2018 11:22:19 +0000
reviewersmichal
bugs1427726
milestone61.0a1
Bug 1427726 - remove support for remote JAR files, r?michal MozReview-Commit-ID: H7aaTmj3FI1
docshell/test/mochitest.ini
docshell/test/test_bug369814.html
dom/base/test/file_bug804395.jar
dom/base/test/mochitest.ini
dom/base/test/test_bug804395.html
dom/html/test/bug392567.jar
dom/html/test/bug392567.jar^headers^
dom/html/test/mochitest.ini
dom/html/test/test_bug392567.html
dom/security/test/cors/mochitest.ini
dom/security/test/cors/test_CrossSiteXHR_origin.html
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARChannel.h
modules/libjar/test/mochitest/bug1173171.zip
modules/libjar/test/mochitest/bug1173171.zip^headers^
modules/libjar/test/mochitest/bug403331.zip
modules/libjar/test/mochitest/bug403331.zip^headers^
modules/libjar/test/mochitest/mochitest.ini
modules/libjar/test/mochitest/openredirect.sjs
modules/libjar/test/mochitest/test_bug1034143_mapped.html
modules/libjar/test/mochitest/test_bug1173171.html
modules/libjar/test/mochitest/test_bug403331.html
modules/libjar/test/unit/test_bug407303.js
modules/libjar/test/unit/xpcshell.ini
modules/libpref/init/all.js
--- a/docshell/test/mochitest.ini
+++ b/docshell/test/mochitest.ini
@@ -1,27 +1,24 @@
 [DEFAULT]
 support-files =
   bug123696-subframe.html
-  bug369814.jar
-  bug369814.zip
   bug404548-subframe.html
   bug404548-subframe_window.html
   bug413310-post.sjs
   bug413310-subframe.html
   bug529119-window.html
   bug570341_recordevents.html
   bug668513_redirect.html
   bug668513_redirect.html^headers^
   bug691547_frame.html
   dummy_page.html
   file_anchor_scroll_after_document_open.html
   file_bfcache_plus_hash_1.html
   file_bfcache_plus_hash_2.html
-  file_bug369814.html
   file_bug385434_1.html
   file_bug385434_2.html
   file_bug385434_3.html
   file_bug475636.sjs
   file_bug509055.html
   file_bug540462.html
   file_bug580069_1.html
   file_bug580069_2.sjs
@@ -52,17 +49,16 @@ support-files =
   historyframes.html
   start_historyframe.html
   url1_historyframe.html
   url2_historyframe.html
 
 [test_anchor_scroll_after_document_open.html]
 [test_bfcache_plus_hash.html]
 [test_bug123696.html]
-[test_bug369814.html]
 [test_bug384014.html]
 [test_bug385434.html]
 [test_bug387979.html]
 [test_bug402210.html]
 [test_bug404548.html]
 [test_bug413310.html]
 skip-if = true
 # Disabled for too many intermittent failures (bug 719186)
deleted file mode 100644
--- a/docshell/test/test_bug369814.html
+++ /dev/null
@@ -1,211 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=369814
--->
-<head>
-  <title>Test for Bug 369814</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=384014">Mozilla Bug 369814</a>
-
-<p>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Tests for Bug 369814 **/
-
-SimpleTest.waitForExplicitFinish();
-
-// Because child scripts won't be able to run to tell us they're done,
-// we need to just wait for them.  Wait this many event loop spins before
-// checking the results.
-const gLoadEventLoopCount = 100;
-
-var gCurrentTest;
-var gTargetWindow;
-var gNumPokes;
-var gTestFrame;
-
-/**
- * Called by documents loaded from jar files to indicate that they can access
- * this document.
- */
-function poke(description) {
-  ok(false, gCurrentTest['name'] + ": got unexpected poke: " + description);
-  gNumPokes++;
-}
-
-function loadEvent(window, callback)
-{
-  var fn = function() {
-    window.removeEventListener("load", fn);
-    callback();
-  };
-  window.addEventListener("load", fn);
-}
-
-function loadTestTarget(callback)
-{
-  gTargetWindow = window.open("http://mochi.test:8888", "bug369814target");
-  loadEvent(gTargetWindow, callback);
-}
-
-function closeTestTarget()
-{
-  gTargetWindow.close();
-  gTargetWindow = null;
-}
-
-function loadErrorTest(test)
-{
-  // Give the frame a chance to fail at loading.
-  // How do detect failure to load?  Error pages don't fire load
-  // events.  But we can load another page before the error page and
-  // then use its unload handler to know when the error page is just
-  // about loaded; at that point a single trip through the event loop
-  // should do the trick.
-  loadEvent(gTestFrame, function() {
-      gTestFrame.src = test['url'];
-    });
-  gTestFrame.unloading = function() {
-    gTestFrame.unloading = null;
-    // Go out to the event loop once so that unload processing finishes and
-    // the new document is set up.
-    setTimeout(function() {
-      // XXX: There doesn't seem to be a reliable check for "got an error,"
-      // but reaching in to an error document will throw an exception
-      var errorPage;
-      try {
-        var item = gTestFrame.contentDocument.getElementById(gCurrentTest['data-iframe']);
-        errorPage = false;
-      } catch (e) {
-        errorPage = true;
-      }
-      ok(errorPage, gCurrentTest["name"] + ": should block a suspicious JAR load.");
-
-      finishTest();
-    }, 0);
-  }
-  var unloadDetector = "file_bug369814.html";
-  gTestFrame.src = unloadDetector;
-}
-
-function iframeTest(test) {
-  gTestFrame.src = test['url'];
-  loadEvent(gTestFrame, function() {
-      finishTest();
-    });
-}
-
-
-function hitEventLoop(func, times) {
-  if (times > 0) {
-    SimpleTest.executeSoon(function() { hitEventLoop(func, times-1); });
-  } else {
-    SimpleTest.executeSoon(func);
-  }
-}
-
-function refreshTest(test) {
-  gTestFrame.src = test['url'];
-  loadEvent(gTestFrame, function() {
-      // Wait for the frame to try and refresh
-      // XXX: a "blocked redirect" signal would be needed to get rid of
-      // this timeout.
-      hitEventLoop(function() {
-          finishTest();
-        }, gLoadEventLoopCount);
-    });
-}
-
-function anchorTest(test) {
-  loadTestTarget(function() {
-      gTestFrame.src = test['url'];
-      loadEvent(gTestFrame, function() {
-        sendMouseEvent({type:'click'}, 'target', gTestFrame.contentWindow);
-        sendMouseEvent({type:'click'}, 'notarget', gTestFrame.contentWindow);
-
-        // Give the clicks a chance to load
-        hitEventLoop(function() {
-            closeTestTarget();
-            finishTest();
-          }, gLoadEventLoopCount);
-        });
-    });
-}
-
-var gTests = [
-  { "name" : "iframes.html loaded from non-jar type, pref disabled",
-    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/iframes.html",
-    "pref" : false,
-    "pokes" : { },
-    "func" : loadErrorTest,
-  },
-  { "name" : "refresh.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/refresh.html",
-    "pref" : true,
-    "pokes" : { },
-    "func" : refreshTest,
-  },
-  { "name" : "iframes.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/iframes.html",
-    "pref" : true,
-    "pokes" : { },
-    "func" : iframeTest,
-  },
-  { "name" : "anchors.html loaded from non-jar type, pref enabled",
-    "url" : "jar:http://mochi.test:8888/tests/docshell/test/bug369814.zip!/anchors.html",
-    "pref" : true,
-    "pokes" : { },
-    "func" : anchorTest,
-  },
-];
-
-var gNextTest = 0;
-
-function runNextTest()
-{
-  if (gNextTest < gTests.length) {
-    gCurrentTest = gTests[gNextTest++];
-    gNumPokes = 0;
-
-    SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false],
-                                       ["network.jar.open-unsafe-types", gCurrentTest['pref']]]}, function() {
-
-      // Create a new frame each time, so our restictions on loads in a
-      // jar:-loaded iframe don't interfere with the test.
-      if (gTestFrame) {
-        document.body.removeChild(gTestFrame);
-      }
-      gTestFrame = document.createElement("iframe");
-      document.body.insertBefore(gTestFrame, $("test"));
-
-      gCurrentTest['func'](gCurrentTest);
-    });
-  } else {
-    SimpleTest.finish();
-  }
-}
-
-function finishTest()
-{
-  SpecialPowers.pushPrefEnv({"set": [["network.jar.open-unsafe-types", false]]}, function() {
-    if (gNumPokes == 0) {
-      ok(true, gCurrentTest["name"] + ": no unexpected pokes");
-    }
-
-    runNextTest();
-  });
-}
-
-addLoadEvent(runNextTest);
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
index f8359f65faee81b5d42e51f07d69ac307a714e76..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -116,17 +116,16 @@ support-files =
   file_bug707142_bom.json
   file_bug707142_utf-16.json
   file_bug708620-2.html
   file_bug708620.html
   file_bug753278.html
   file_bug769117.html
   file_bug782342.txt
   file_bug787778.sjs
-  file_bug804395.jar
   file_bug869432.eventsource
   file_bug869432.eventsource^headers^
   file_bug907892.html
   file_bug945152.jar
   file_bug1274806.html
   file_domwindowutils_animation.html
   file_general_document.html
   file_history_document_open.html
@@ -540,17 +539,16 @@ skip-if = toolkit == 'android' #bug 6870
 [test_bug750096.html]
 [test_bug753278.html]
 [test_bug761120.html]
 [test_bug769117.html]
 [test_bug782342.html]
 [test_bug787778.html]
 [test_bug789315.html]
 [test_bug789856.html]
-[test_bug804395.html]
 [test_bug809003.html]
 [test_bug810494.html]
 [test_bug811701.html]
 [test_bug811701.xhtml]
 [test_bug813919.html]
 [test_bug814576.html]
 [test_bug819051.html]
 [test_bug820909.html]
deleted file mode 100644
--- a/dom/base/test/test_bug804395.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=804395
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 804395</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=804395">Mozilla Bug 804395</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-function test200() {
-  var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
-  xhr.open('GET', 'jar:http://example.org/tests/dom/base/test/file_bug804395.jar!/foo.bar', true);
-  xhr.onreadystatechange = function() {
-    if (xhr.readyState == 4) {
-      ok(xhr.status == 200, "Existing file must have Status 200!");
-      runTests();
-    }
-  }
-  xhr.send(null);
-}
-
-function test404() {
-  var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
-  xhr.open('GET', 'jar:http://example.org/tests/dom/base/test/file_bug804395.jar!/foo.do_not_exist', true);
-  xhr.onreadystatechange = function() {
-    if (xhr.readyState == 4) {
-      ok(xhr.status == 404, "Non existing file must have Status 404!");
-      runTests();
-    }
-  }
-  xhr.send(null);
-}
-
-function test0() {
-  var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
-  xhr.open('GET', 'jar:http://example.org/tests/dom/base/test/file_bug804395.jar!/foo.bar', true);
-  ok(xhr.status == 0, "Not Sent request must have status 0");
-  runTests();
-}
-
-var tests = [ test200, test404, test0 ];
-function runTests() {
-  if (!tests.length) {
-    SimpleTest.finish();
-    return;
-  }
-
-  var test = tests.shift();
-  test();
-}
-
-/** Test for Bug 804395 **/
-SimpleTest.waitForExplicitFinish();
-
-addLoadEvent(function() {
-  SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTests);
-  });
-});
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
index bca06515dff7db0f6898f792c05b2ba1741066f3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/html/test/bug392567.jar^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Content-Type: application/java-archive
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -14,18 +14,16 @@ support-files =
   bug242709_load.html
   bug277724_iframe1.html
   bug277724_iframe2.xhtml
   bug277890_iframe.html
   bug277890_load.html
   bug340800_iframe.txt
   bug369370-popup.png
   bug372098-link-target.html
-  bug392567.jar
-  bug392567.jar^headers^
   bug441930_iframe.html
   bug445004-inner.html
   bug445004-inner.js
   bug445004-outer-abs.html
   bug445004-outer-rel.html
   bug445004-outer-write.html
   bug446483-iframe.html
   bug448564-echo.sjs
@@ -246,17 +244,16 @@ skip-if = toolkit == 'android' #TIMED_OU
 [test_bug386728.html]
 [test_bug386996.html]
 [test_bug388558.html]
 [test_bug388746.html]
 [test_bug388794.html]
 [test_bug389797.html]
 [test_bug390975.html]
 [test_bug391994.html]
-[test_bug392567.html]
 [test_bug394700.html]
 [test_bug395107.html]
 [test_bug401160.xhtml]
 [test_bug405242.html]
 [test_bug406596.html]
 [test_bug417760.html]
 [test_bug421640.html]
 [test_bug424698.html]
deleted file mode 100644
--- a/dom/html/test/test_bug392567.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=392567
--->
-<head>
-  <title>Test for Bug 392567</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=392567">Mozilla Bug 392567</a>
-<p id="display"><iframe name="testFrame" id="testFrame" style="visibility: hidden;"></iframe></p>
-<div id="content" style="display: none">
-  <form name="testForm" target="testFrame">
-    <input type="text" name="key" />
-  </form>
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 392567 **/
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
-  if (window.location.search.match(/\?key=value/)) {
-    return;
-  }
-
-  var dataUrl = "http://mochi.test:8888/tests/dom/html/test/bug392567.jar";
-  var jarUrl = "jar:" + dataUrl + "!/index.html";
-  var httpUrl = location.href.replace(/\.html.*/, "_404");
-  var previousDir = location.href.replace(/test\/[^\/]*$/, "");
-  var documentURL = location.href.replace(/\.html.*/, "\.html");
-
-  var form = document.forms.testForm;
-  var frame = frames.testFrame;
-  document.getElementById("testFrame").onload = processTestResult;
-
-  // List of tests to run, each test consists of form action URL and expected result URL
-  var tests = [
-    [jarUrl, jarUrl + "?$PARAMS"],
-    [jarUrl + "?jarTest1=jarTest2", jarUrl + "?$PARAMS"],
-    [jarUrl + "?jarTest3=jarTest4#jarTest5", jarUrl + "?$PARAMS#jarTest5"],
-    [httpUrl, httpUrl + "?$PARAMS"],
-    [httpUrl + "?httpTest1=httpTest2", httpUrl + "?$PARAMS"],
-    [httpUrl + "?httpTest3=httpTest4#httpTest5", httpUrl + "?$PARAMS#httpTest5"],
-    ["", documentURL + "?$PARAMS"],
-    [" ", documentURL + "?$PARAMS"],
-    ["../", previousDir + "?$PARAMS"],
-  ];
-
-  var currentTest = -1;
-
-  runNextTest();
-
-  function runNextTest() {
-    currentTest++;
-    if (currentTest >= tests.length) {
-      SimpleTest.finish();
-      return;
-    }
-
-    form.setAttribute("action", tests[currentTest][0]);
-    form.key.value = "value" + currentTest;
-    form.submit();
-  }
-
-  function processTestResult() {
-    var expected = tests[currentTest][1].replace(/\$PARAMS/, "key=value" + currentTest);
-    is(frame.location.href, expected, "Submitting to " + tests[currentTest][0]);
-
-    setTimeout(runNextTest, 0);
-  }
-}
-
-addLoadEvent(function() {
-   SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, runTests);
-});
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/security/test/cors/mochitest.ini
+++ b/dom/security/test/cors/mochitest.ini
@@ -1,11 +1,10 @@
 [DEFAULT]
 support-files =
   file_CrossSiteXHR_cache_server.sjs
   file_CrossSiteXHR_inner.html
-  file_CrossSiteXHR_inner.jar
   file_CrossSiteXHR_inner_data.sjs
   file_CrossSiteXHR_server.sjs
 
 [test_CrossSiteXHR.html]
 [test_CrossSiteXHR_cache.html]
 [test_CrossSiteXHR_origin.html]
--- a/dom/security/test/cors/test_CrossSiteXHR_origin.html
+++ b/dom/security/test/cors/test_CrossSiteXHR_origin.html
@@ -34,19 +34,16 @@ var origins =
    },
    { server: 'http://ex\xe4mple.test',
      origin: 'http://xn--exmple-cua.test'
    },
    { server: 'http://xn--exmple-cua.test' },
    { server: 'http://\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1.\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae',
      origin: 'http://xn--hxajbheg2az3al.xn--jxalpdlp'
    },
-   { origin: 'http://example.org',
-     file: 'jar:http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.jar!/file_CrossSiteXHR_inner.html'
-   },
    { origin: 'null',
      file: 'http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs'
    },
    ];
 
    //['https://example.com:443'],
    //['https://sub1.test1.example.com:443'],
 
@@ -157,16 +154,14 @@ function* runTest() {
          "wrong events in test for " + allowOrigin);
     }
   }
 
   SimpleTest.finish();
 }
 
 addLoadEvent(function() {
-  SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, function() {
-    gen.next();
-  });
+  gen.next();
 });
 </script>
 </pre>
 </body>
 </html>
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -189,29 +189,25 @@ nsJARInputThunk::IsNonBlocking(bool *non
 
 //-----------------------------------------------------------------------------
 // nsJARChannel
 //-----------------------------------------------------------------------------
 
 
 nsJARChannel::nsJARChannel()
     : mOpened(false)
-    , mContentDisposition(0)
     , mContentLength(-1)
     , mLoadFlags(LOAD_NORMAL)
     , mStatus(NS_OK)
     , mIsPending(false)
     , mEnableOMT(true)
     , mPendingEvent()
     , mIsUnsafe(true)
-    , mBlockRemoteFiles(false)
 {
     LOG(("nsJARChannel::nsJARChannel [this=%p]\n", this));
-    mBlockRemoteFiles = Preferences::GetBool("network.jar.block-remote-files", false);
-
     // hold an owning reference to the jar handler
     mJarHandler = gJarHandler;
 }
 
 nsJARChannel::~nsJARChannel()
 {
     LOG(("nsJARChannel::~nsJARChannel [this=%p]\n", this));
     NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mLoadInfo",
@@ -263,50 +259,44 @@ nsJARChannel::Init(nsIURI *uri)
     return rv;
 }
 
 nsresult
 nsJARChannel::CreateJarInput(nsIZipReaderCache *jarCache, nsJARInputThunk **resultInput)
 {
     LOG(("nsJARChannel::CreateJarInput [this=%p]\n", this));
     MOZ_ASSERT(resultInput);
-    MOZ_ASSERT(mJarFile || mTempMem);
+    MOZ_ASSERT(mJarFile);
 
     // important to pass a clone of the file since the nsIFile impl is not
     // necessarily MT-safe
     nsCOMPtr<nsIFile> clonedFile;
     nsresult rv = NS_OK;
     if (mJarFile) {
         rv = mJarFile->Clone(getter_AddRefs(clonedFile));
         if (NS_FAILED(rv))
             return rv;
     }
 
     nsCOMPtr<nsIZipReader> reader;
     if (mPreCachedJarReader) {
         reader = mPreCachedJarReader;
     } else if (jarCache) {
-        MOZ_ASSERT(mJarFile);
         if (mInnerJarEntry.IsEmpty())
             rv = jarCache->GetZip(clonedFile, getter_AddRefs(reader));
         else
             rv = jarCache->GetInnerZip(clonedFile, mInnerJarEntry,
                                        getter_AddRefs(reader));
     } else {
         // create an uncached jar reader
         nsCOMPtr<nsIZipReader> outerReader = do_CreateInstance(kZipReaderCID, &rv);
         if (NS_FAILED(rv))
             return rv;
 
-        if (mJarFile) {
-            rv = outerReader->Open(clonedFile);
-        } else {
-            rv = outerReader->OpenMemory(mTempMem->Elements(),
-                                         mTempMem->Length());
-        }
+        rv = outerReader->Open(clonedFile);
         if (NS_FAILED(rv))
             return rv;
 
         if (mInnerJarEntry.IsEmpty())
             reader = outerReader;
         else {
             reader = do_CreateInstance(kZipReaderCID, &rv);
             if (NS_FAILED(rv))
@@ -894,21 +884,17 @@ nsJARChannel::SetContentCharset(const ns
 {
     mContentCharset = aContentCharset;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentDisposition(uint32_t *aContentDisposition)
 {
-    if (mContentDispositionHeader.IsEmpty())
-        return NS_ERROR_NOT_AVAILABLE;
-
-    *aContentDisposition = mContentDisposition;
-    return NS_OK;
+    return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 nsJARChannel::SetContentDisposition(uint32_t aContentDisposition)
 {
     return NS_ERROR_NOT_AVAILABLE;
 }
 
@@ -922,21 +908,17 @@ NS_IMETHODIMP
 nsJARChannel::SetContentDispositionFilename(const nsAString &aContentDispositionFilename)
 {
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentDispositionHeader(nsACString &aContentDispositionHeader)
 {
-    if (mContentDispositionHeader.IsEmpty())
-        return NS_ERROR_NOT_AVAILABLE;
-
-    aContentDispositionHeader = mContentDispositionHeader;
-    return NS_OK;
+    return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentLength(int64_t *result)
 {
     *result = mContentLength;
     return NS_OK;
 }
@@ -959,19 +941,19 @@ nsJARChannel::Open(nsIInputStream **stre
 
     mJarFile = nullptr;
     mIsUnsafe = true;
 
     nsresult rv = LookupFile();
     if (NS_FAILED(rv))
         return rv;
 
-    // If mJarInput was not set by LookupFile, the JAR is a remote jar.
+    // If mJarFile was not set by LookupFile, we can't open a channel.
     if (!mJarFile) {
-        NS_NOTREACHED("need sync downloader");
+        NS_NOTREACHED("only file-backed jars are supported");
         return NS_ERROR_NOT_IMPLEMENTED;
     }
 
     RefPtr<nsJARInputThunk> input;
     rv = CreateJarInput(gJarHandler->JarCache(), getter_AddRefs(input));
     if (NS_FAILED(rv))
         return rv;
 
@@ -998,125 +980,70 @@ nsJARChannel::AsyncOpen(nsIStreamListene
     LOG(("nsJARChannel::AsyncOpen [this=%p]\n", this));
     MOZ_ASSERT(!mLoadInfo ||
                mLoadInfo->GetSecurityMode() == 0 ||
                mLoadInfo->GetInitialSecurityCheckDone() ||
                (mLoadInfo->GetSecurityMode() == nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
                 nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
                "security flags in loadInfo but asyncOpen2() not called");
 
-    LOG(("nsJARChannel::AsyncOpen [this=%p]\n", this));
-
     NS_ENSURE_ARG_POINTER(listener);
     NS_ENSURE_TRUE(!mOpened, NS_ERROR_IN_PROGRESS);
     NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
 
     mJarFile = nullptr;
     mIsUnsafe = true;
 
     // Initialize mProgressSink
     NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, mProgressSink);
 
     mListener = listener;
     mListenerContext = ctx;
     mIsPending = true;
 
     nsresult rv = LookupFile();
+    if (NS_FAILED(rv) || !mJarFile) {
+        // Not a local file...
+        mIsPending = false;
+        mListenerContext = nullptr;
+        mListener = nullptr;
+        mCallbacks = nullptr;
+        mProgressSink = nullptr;
+        return mJarFile ? rv : NS_ERROR_UNSAFE_CONTENT_TYPE;
+    }
+
+    rv = OpenLocalFile();
     if (NS_FAILED(rv)) {
         mIsPending = false;
         mListenerContext = nullptr;
         mListener = nullptr;
         mCallbacks = nullptr;
         mProgressSink = nullptr;
         return rv;
     }
 
-    nsCOMPtr<nsIChannel> channel;
-
-    if (!mJarFile) {
-        // Not a local file...
-
-        // Check preferences to see if all remote jar support should be disabled
-        if (mBlockRemoteFiles) {
-            mIsUnsafe = true;
-            mIsPending = false;
-            mListenerContext = nullptr;
-            mListener = nullptr;
-            mCallbacks = nullptr;
-            mProgressSink = nullptr;
-            return NS_ERROR_UNSAFE_CONTENT_TYPE;
-        }
+    return NS_OK;
+}
 
-        // kick off an async download of the base URI...
-        nsCOMPtr<nsIStreamListener> downloader = new MemoryDownloader(this);
-        uint32_t loadFlags =
-            mLoadFlags & ~(LOAD_DOCUMENT_URI | LOAD_CALL_CONTENT_SNIFFERS);
-        rv = NS_NewChannelInternal(getter_AddRefs(channel),
-                                   mJarBaseURI,
-                                   mLoadInfo,
-                                   nullptr, // PerformanceStorage
-                                   mLoadGroup,
-                                   mCallbacks,
-                                   loadFlags);
-        if (NS_FAILED(rv)) {
-            mIsPending = false;
-            mListenerContext = nullptr;
-            mListener = nullptr;
-            mCallbacks = nullptr;
-            mProgressSink = nullptr;
-            return rv;
-        }
-        if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-            rv = channel->AsyncOpen2(downloader);
-        }
-        else {
-            rv = channel->AsyncOpen(downloader, nullptr);
-        }
-
-    }
-    else {
-        rv = OpenLocalFile();
-        if (NS_SUCCEEDED(rv)) {
-            return NS_OK;
-        }
-    }
-
+NS_IMETHODIMP
+nsJARChannel::AsyncOpen2(nsIStreamListener *aListener)
+{
+    LOG(("nsJARChannel::AsyncOpen2 [this=%p]\n", this));
+    nsCOMPtr<nsIStreamListener> listener = aListener;
+    nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
     if (NS_FAILED(rv)) {
         mIsPending = false;
         mListenerContext = nullptr;
         mListener = nullptr;
         mCallbacks = nullptr;
         mProgressSink = nullptr;
         return rv;
     }
 
-    if (mLoadGroup)
-        mLoadGroup->AddRequest(this, nullptr);
-
-    mOpened = true;
-    LOG(("nsJARChannel::AsyncOpen [this=%p] 8\n", this));
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsJARChannel::AsyncOpen2(nsIStreamListener *aListener)
-{
-    LOG(("nsJARChannel::AsyncOpen2 [this=%p]\n", this));
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-      mIsPending = false;
-      mListenerContext = nullptr;
-      mListener = nullptr;
-      mCallbacks = nullptr;
-      mProgressSink = nullptr;
-      return rv;
-  }
-
-  return AsyncOpen(listener, nullptr);
+    return AsyncOpen(listener, nullptr);
 }
 
 //-----------------------------------------------------------------------------
 // nsIJARChannel
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 nsJARChannel::GetIsUnsafe(bool *isUnsafe)
 {
@@ -1206,126 +1133,16 @@ nsJARChannel::GetZipEntry(nsIZipEntry **
     rv = gJarHandler->JarCache()->GetZip(mJarFile, getter_AddRefs(reader));
     if (NS_FAILED(rv))
         return rv;
 
     return reader->GetEntry(mJarEntry, aZipEntry);
 }
 
 //-----------------------------------------------------------------------------
-// mozilla::net::MemoryDownloader::IObserver
-//-----------------------------------------------------------------------------
-
-void
-nsJARChannel::OnDownloadComplete(MemoryDownloader* aDownloader,
-                                 nsIRequest    *request,
-                                 nsISupports   *context,
-                                 nsresult       status,
-                                 MemoryDownloader::Data aData)
-{
-    nsresult rv;
-
-    nsCOMPtr<nsIChannel> channel(do_QueryInterface(request));
-    if (channel) {
-        uint32_t loadFlags;
-        channel->GetLoadFlags(&loadFlags);
-        if (loadFlags & LOAD_REPLACE) {
-            // Update our URI to reflect any redirects that happen during
-            // the HTTP request.
-            if (!mOriginalURI) {
-                SetOriginalURI(mJarURI);
-            }
-
-            nsCOMPtr<nsIURI> innerURI;
-            rv = channel->GetURI(getter_AddRefs(innerURI));
-            if (NS_SUCCEEDED(rv)) {
-                nsCOMPtr<nsIJARURI> newURI;
-                rv = mJarURI->CloneWithJARFile(innerURI,
-                                               getter_AddRefs(newURI));
-                if (NS_SUCCEEDED(rv)) {
-                    mJarURI = newURI;
-                }
-            }
-            if (NS_SUCCEEDED(status)) {
-                status = rv;
-            }
-        }
-    }
-
-    if (NS_SUCCEEDED(status) && channel) {
-        // In case the load info object has changed during a redirect,
-        // grab it from the target channel.
-        channel->GetLoadInfo(getter_AddRefs(mLoadInfo));
-        // Grab the security info from our base channel
-        channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
-
-        nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
-        if (httpChannel) {
-            // We only want to run scripts if the server really intended to
-            // send us a JAR file.  Check the server-supplied content type for
-            // a JAR type.
-            nsAutoCString header;
-            Unused << httpChannel->GetResponseHeader(
-              NS_LITERAL_CSTRING("Content-Type"), header);
-            nsAutoCString contentType;
-            nsAutoCString charset;
-            NS_ParseResponseContentType(header, contentType, charset);
-            nsAutoCString channelContentType;
-            channel->GetContentType(channelContentType);
-            mIsUnsafe = !(contentType.Equals(channelContentType) &&
-                          (contentType.EqualsLiteral("application/java-archive") ||
-                           contentType.EqualsLiteral("application/x-jar")));
-        } else {
-            nsCOMPtr<nsIJARChannel> innerJARChannel(do_QueryInterface(channel));
-            if (innerJARChannel) {
-                mIsUnsafe = innerJARChannel->GetIsUnsafe();
-            }
-        }
-
-        channel->GetContentDispositionHeader(mContentDispositionHeader);
-        mContentDisposition = NS_GetContentDispositionFromHeader(mContentDispositionHeader, this);
-    }
-
-    // This is a defense-in-depth check for the preferences to see if all remote jar
-    // support should be disabled. This check may not be needed.
-    MOZ_RELEASE_ASSERT(!mBlockRemoteFiles);
-
-    if (NS_SUCCEEDED(status) && mIsUnsafe &&
-        !Preferences::GetBool("network.jar.open-unsafe-types", false)) {
-        status = NS_ERROR_UNSAFE_CONTENT_TYPE;
-    }
-
-    if (NS_SUCCEEDED(status)) {
-        // Refuse to unpack view-source: jars even if open-unsafe-types is set.
-        nsCOMPtr<nsIViewSourceChannel> viewSource = do_QueryInterface(channel);
-        if (viewSource) {
-            status = NS_ERROR_UNSAFE_CONTENT_TYPE;
-        }
-    }
-
-    if (NS_SUCCEEDED(status)) {
-        mTempMem = Move(aData);
-
-        RefPtr<nsJARInputThunk> input;
-        rv = CreateJarInput(nullptr, getter_AddRefs(input));
-        if (NS_SUCCEEDED(rv)) {
-            // create input stream pump
-            rv = NS_NewInputStreamPump(getter_AddRefs(mPump), input.forget());
-            if (NS_SUCCEEDED(rv))
-                rv = mPump->AsyncRead(this, nullptr);
-        }
-        status = rv;
-    }
-
-    if (NS_FAILED(status)) {
-        NotifyError(status);
-    }
-}
-
-//-----------------------------------------------------------------------------
 // nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsJARChannel::OnStartRequest(nsIRequest *req, nsISupports *ctx)
 {
     LOG(("nsJARChannel::OnStartRequest [this=%p %s]\n", this, mSpec.get()));
 
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -28,17 +28,16 @@
 
 class nsJARInputThunk;
 class nsJARProtocolHandler;
 class nsInputStreamPump;
 
 //-----------------------------------------------------------------------------
 
 class nsJARChannel final : public nsIJARChannel
-                         , public mozilla::net::MemoryDownloader::IObserver
                          , public nsIStreamListener
                          , public nsIThreadRetargetableRequest
                          , public nsIThreadRetargetableStreamListener
                          , public nsHashPropertyBag
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIREQUEST
@@ -61,22 +60,16 @@ private:
     nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
     nsresult LookupFile();
     nsresult OpenLocalFile();
     nsresult ContinueOpenLocalFile(nsJARInputThunk* aInput, bool aIsSyncCall);
     nsresult OnOpenLocalFileComplete(nsresult aResult, bool aIsSyncCall);
     nsresult CheckPendingEvents();
     void NotifyError(nsresult aError);
     void FireOnProgress(uint64_t aProgress);
-    virtual void OnDownloadComplete(mozilla::net::MemoryDownloader* aDownloader,
-                                    nsIRequest* aRequest,
-                                    nsISupports* aCtxt,
-                                    nsresult aStatus,
-                                    mozilla::net::MemoryDownloader::Data aData)
-        override;
 
     nsCString                       mSpec;
 
     bool                            mOpened;
 
     RefPtr<nsJARProtocolHandler>    mJarHandler;
     nsCOMPtr<nsIJARURI>             mJarURI;
     nsCOMPtr<nsIURI>                mOriginalURI;
@@ -85,46 +78,38 @@ private:
     nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
     nsCOMPtr<nsISupports>           mSecurityInfo;
     nsCOMPtr<nsIProgressEventSink>  mProgressSink;
     nsCOMPtr<nsILoadGroup>          mLoadGroup;
     nsCOMPtr<nsIStreamListener>     mListener;
     nsCOMPtr<nsISupports>           mListenerContext;
     nsCString                       mContentType;
     nsCString                       mContentCharset;
-    nsCString                       mContentDispositionHeader;
-    /* mContentDisposition is uninitialized if mContentDispositionHeader is
-     * empty */
-    uint32_t                        mContentDisposition;
     int64_t                         mContentLength;
     uint32_t                        mLoadFlags;
     nsresult                        mStatus;
     bool                            mIsPending; // the AsyncOpen is in progress.
 
     bool                            mEnableOMT;
     // |Cancel()|, |Suspend()|, and |Resume()| might be called during AsyncOpen.
     struct {
         bool isCanceled;
         uint32_t suspendCount;
     }                               mPendingEvent;
 
     bool                            mIsUnsafe;
 
-    mozilla::net::MemoryDownloader::Data mTempMem;
     nsCOMPtr<nsIInputStreamPump>    mPump;
     // mRequest is only non-null during OnStartRequest, so we'll have a pointer
     // to the request if we get called back via RetargetDeliveryTo.
     nsCOMPtr<nsIRequest>            mRequest;
     nsCOMPtr<nsIFile>               mJarFile;
     nsCOMPtr<nsIFile>               mJarFileOverride;
     nsCOMPtr<nsIZipReader>          mPreCachedJarReader;
     nsCOMPtr<nsIURI>                mJarBaseURI;
     nsCString                       mJarEntry;
     nsCString                       mInnerJarEntry;
 
     // use StreamTransportService as background thread
     nsCOMPtr<nsIEventTarget>        mWorker;
-
-    // True if this channel should not download any remote files.
-    bool                            mBlockRemoteFiles;
 };
 
 #endif // nsJARChannel_h__
rename from modules/libjar/test/mochitest/bug403331.zip
rename to modules/libjar/test/mochitest/bug1173171.zip
rename from modules/libjar/test/mochitest/bug403331.zip^headers^
rename to modules/libjar/test/mochitest/bug1173171.zip^headers^
--- a/modules/libjar/test/mochitest/mochitest.ini
+++ b/modules/libjar/test/mochitest/mochitest.ini
@@ -1,11 +1,5 @@
-[DEFAULT]
+
+[test_bug1173171.html]
 support-files =
-  bug403331.zip
-  bug403331.zip^headers^
-  openredirect.sjs
-  !/dom/base/test/file_bug945152.jar
-
-[test_bug403331.html]
-[test_bug1034143_mapped.html]
-run-if = os == 'linux'
-[test_bug1173171.html]
\ No newline at end of file
+  bug1173171.zip
+  bug1173171.zip^headers^
\ No newline at end of file
deleted file mode 100644
--- a/modules/libjar/test/mochitest/openredirect.sjs
+++ /dev/null
@@ -1,5 +0,0 @@
-function handleRequest(request, response)
-{
-  response.setStatusLine(request.httpVersion, 301, "Moved Permanently");
-  response.setHeader("Location", request.queryString, false);
-}
deleted file mode 100644
--- a/modules/libjar/test/mochitest/test_bug1034143_mapped.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1034143
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 945152</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1034143">Mozilla Bug 1034143</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript">
-// Ensure that XMLHttpRequest's memory-mapping code can handle a case
-// where the nsIJARChannel's jarFile property is null, but which is
-// otherwise eligible for bug 945152's memory-mapping optimization.
-
-function runTest() {
-  const jarURL = "jar:http://example.org/tests/dom/base/test/file_bug945152.jar!/data_1.txt";
-  let xhr = new XMLHttpRequest({ mozAnon: true, mozSystem: true });
-  xhr.open("GET", jarURL);
-  xhr.onerror = function onerror(e) {
-    ok(false, "JAR XHR failed: " + e.status);
-    SimpleTest.finish();
-  };
-  xhr.onload = function onload(e) {
-    ok(xhr.status == 200, "Status is 200");
-    let ct = xhr.getResponseHeader("Content-Type");
-    ok(!ct.includes("mem-mapped"), "Data is not memory-mapped");
-    SimpleTest.finish();
-  };
-  xhr.responseType = 'arraybuffer';
-  xhr.send();
-}
-
-SimpleTest.waitForExplicitFinish();
-
-addLoadEvent(function() {
-  SpecialPowers.pushPrefEnv({"set": [["dom.mapped_arraybuffer.enabled", true], 
-                                     ["network.jar.block-remote-files", false]]}, function() {
-    SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], runTest);
-  });
-});
-</script>
-</pre>
-</body>
-</html>
--- a/modules/libjar/test/mochitest/test_bug1173171.html
+++ b/modules/libjar/test/mochitest/test_bug1173171.html
@@ -13,25 +13,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 <iframe id="testFrame"></iframe>
 
 <pre id="test">
 <script class="testbody" type="application/javascript">
 
 /** Test for Bug 1173171 **/
 
-// __setPref(key, value)__.
-// Set a pref value asynchronously, returning a prmoise that resolves
-// when it succeeds.
-let pushPref = function (key, value) {
-  return new Promise(function(resolve, reject) {
-    SpecialPowers.pushPrefEnv({"set": [[key, value]]}, resolve);
-  });
-};
-
 // __xhr(method, url, responseType__.
 // A simple async XMLHttpRequest call.
 // Returns a promise with the response.
 let xhr = function (method, url, responseType) {
   return new Promise(function (resolve, reject) {
     let xhr = new XMLHttpRequest();
     xhr.open(method, url, true);
     xhr.onload = function () {
@@ -44,21 +35,18 @@ let xhr = function (method, url, respons
     xhr.send();
   });
 };
 
 let jarURL = "jar:http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
 
 // Test behavior when blocking is deactivated and activated.
 add_task(async function() {
-  for (let shouldBlock of [false, true]) {
-    await pushPref("network.jar.block-remote-files", shouldBlock);
-    let response = await xhr("GET", jarURL, "document");
-    ok(shouldBlock === (response === null),
-       "Remote jars should be blocked if and only if the 'network.jar.block-remote-files' pref is active.");
-  }
+  let shouldBlock = true;
+  let response = await xhr("GET", jarURL, "document");
+  is(response, null, "Remote jars should be blocked.");
 });
 
 </script>
 </pre>
 
 </body>
 </html>
deleted file mode 100644
--- a/modules/libjar/test/mochitest/test_bug403331.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=403331
--->
-<head>
-  <title>Test for Bug 403331</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<iframe id="testFrame"></iframe>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 403331 **/
-
-SimpleTest.waitForExplicitFinish();
-
-function runTest() {
-  var testFrame = document.getElementById('testFrame');
-
-  // Try a redirected load from another domain to this one.
-
-  testFrame.onload = function() {
-    // If properly redirected, we'll be able to access elements in the loaded
-    // document.
-    var item = testFrame.contentDocument.getElementById('testitem');
-    is(item.textContent, "testcontents", "Should be able to access the child document");
-
-    SimpleTest.finish();
-  }
-
-  testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html";
-}
-
-addLoadEvent(function() {
-  SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, runTest);
-});
-
-</script>
-</pre>
-
-</body>
-</html>
deleted file mode 100644
--- a/modules/libjar/test/unit/test_bug407303.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Regression test for bug 407303 - A failed channel should not be checked
-// for an unsafe content type.
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-
-// XXX: NS_ERROR_UNKNOWN_HOST is not in Components.results
-const NS_ERROR_UNKNOWN_HOST = 0x804B001E;
-
-var listener = {
-  QueryInterface: function(iid) {
-    if (iid.equals(Ci.nsISupports) ||
-        iid.equals(Ci.nsIRequestObserver))
-      return this;
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  },
-
-  onStartRequest: function(request, context) {
-  },
-
-  onDataAvailable: function(request, context, stream, offset, count) {
-    do_throw("shouldn't get data!");
-  },
-
-  onStopRequest: function(request, context, status) {
-    Assert.equal(status, NS_ERROR_UNKNOWN_HOST);
-    do_test_finished();
-  }
-};
-
-function run_test() {
-  Services.prefs.setBoolPref("network.jar.block-remote-files", false);
-  var channel = NetUtil.newChannel({
-    uri: "jar:http://test.invalid/test.jar!/index.html",
-    loadUsingSystemPrincipal: true}
-  );
-  channel.asyncOpen2(listener);
-  do_test_pending();
-}
--- a/modules/libjar/test/unit/xpcshell.ini
+++ b/modules/libjar/test/unit/xpcshell.ini
@@ -20,17 +20,16 @@ support-files =
 
 [test_jarchannel.js]
 skip-if = os == "mac"
 [test_bug278262.js]
 [test_bug333423.js]
 [test_bug336691.js]
 [test_bug370103.js]
 [test_bug379841.js]
-[test_bug407303.js]
 [test_bug453254.js]
 [test_bug458158.js]
 [test_bug589292.js]
 [test_bug597702.js]
 [test_bug637286.js]
 [test_bug658093.js]
 [test_corrupt_536911.js]
 [test_corrupt_541828.js]
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1890,23 +1890,16 @@ pref("network.websocket.allowInsecureFro
 pref("network.websocket.delay-failed-reconnects", true);
 
 // </ws>
 
 // Server-Sent Events
 // Equal to the DEFAULT_RECONNECTION_TIME_VALUE value in nsEventSource.cpp
 pref("dom.server-events.default-reconnection-time", 5000); // in milliseconds
 
-// If false, remote JAR files that are served with a content type other than
-// application/java-archive or application/x-jar will not be opened
-// by the jar channel.
-pref("network.jar.open-unsafe-types", false);
-// If true, loading remote JAR files using the jar: protocol will be prevented.
-pref("network.jar.block-remote-files", true);
-
 // This preference, if true, causes all UTF-8 domain names to be normalized to
 // punycode.  The intention is to allow UTF-8 domain names as input, but never
 // generate them from punycode.
 pref("network.IDN_show_punycode", false);
 
 // If "network.IDN.use_whitelist" is set to true, TLDs with
 // "network.IDN.whitelist.tld" explicitly set to true are treated as
 // IDN-safe. Otherwise, they're treated as unsafe and punycode will be used