Bug 1365887 - Access resource:// urls r?mak draft
authortfeserver <tfeserver@gmail.com>
Thu, 18 May 2017 20:06:46 +0200
changeset 580529 448cbbc8f435
parent 577862 0f4df67c5f16
child 629333 41036bade3de
push id59606
push userbmo:tfeserver@gmail.com
push dateThu, 18 May 2017 18:06:57 +0000
reviewersmak
bugs1365887
milestone55.0a1
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 }) ]
+  });
 });