Bug 1365887 - Access resource:// urls r=mak
authortfeserver <tfeserver@gmail.com>
Thu, 18 May 2017 20:06:46 +0200
changeset 359185 74890c4c6bc3
parent 359184 939f52993a6b
child 359186 1eac66ddfb73
push id43005
push usermak77@bonardo.net
push dateFri, 19 May 2017 11:17:01 +0000
treeherderautoland@74890c4c6bc3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1365887
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1365887 - Access resource:// urls r=mak MozReview-Commit-ID: GfXVvxLEZpK
toolkit/components/places/UnifiedComplete.js
toolkit/components/places/tests/unifiedcomplete/test_visit_url.js
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -1594,17 +1594,17 @@ Search.prototype = {
     if (!fixupInfo.fixedURI || fixupInfo.keywordAsSent)
       return false;
 
     let uri = fixupInfo.fixedURI;
     // Check the host, as "http:///" is a valid nsIURI, but not useful to us.
     // But, some schemes are expected to have no host. So we check just against
     // schemes we know should have a host. This allows new schemes to be
     // implemented without us accidentally blocking access to them.
-    let hostExpected = new Set(["http", "https", "ftp", "chrome", "resource"]);
+    let hostExpected = new Set(["http", "https", "ftp", "chrome"]);
     if (hostExpected.has(uri.scheme) && !uri.host)
       return false;
 
     // getFixupURIInfo() escaped the URI, so it may not be pretty.  Embed the
     // escaped URL in the action URI since that URL should be "canonical".  But
     // pass the pretty, unescaped URL as the match comment, since it's likely
     // to be displayed to the user, and in any case the front-end should not
     // rely on it being canonical.
--- a/toolkit/components/places/tests/unifiedcomplete/test_visit_url.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_visit_url.js
@@ -178,9 +178,23 @@ add_task(async function() {
   });
 
   do_print("numerical operations that look like urls should search");
   await check_autocomplete({
     search: "123.12/12.1",
     searchParam: "enable-actions",
     matches: [ makeSearchMatch("123.12/12.1", { heuristic: true }) ]
   });
+
+  do_print("access resource:///modules");
+  await check_autocomplete({
+      search: "resource:///modules",
+    searchParam: "enable-actions",
+    matches: [ makeVisitMatch("resource:///modules", "resource:///modules", { heuristic: true }) ]
+  });
+
+  do_print("access resource://app/modules");
+  await check_autocomplete({
+      search: "resource://app/modules",
+    searchParam: "enable-actions",
+    matches: [ makeVisitMatch("resource://app/modules", "resource://app/modules", { heuristic: true }) ]
+  });
 });