Bug 1708125 - Remove some remaining FTP references from the tree r=necko-reviewers,dragana,Gijs
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 31 May 2021 13:08:12 +0000
changeset 653976 3a28eb911d86e50652ae38cf45c53dc41485a075
parent 653975 de40c72ddc80133fd7a98fb92293dc8aec7cc9c2
child 653977 d8c5d9c5149f06c1a402b5d3d810f344ee3b5227
push id2623
push userffxbld-merge
push dateMon, 02 Aug 2021 14:47:51 +0000
treeherdermozilla-release@8500ce65f7c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnecko-reviewers, dragana, Gijs
bugs1708125
milestone90.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 1708125 - Remove some remaining FTP references from the tree r=necko-reviewers,dragana,Gijs Differential Revision: https://phabricator.services.mozilla.com/D114067
browser/app/macbuild/Contents/Info.plist.in
browser/base/content/pageinfo/pageInfo.js
browser/components/urlbar/UrlbarProviderAutofill.jsm
browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js
browser/components/urlbar/tests/unit/test_trimming.js
docshell/base/URIFixup.jsm
dom/base/Document.h
dom/security/ReferrerInfo.cpp
dom/security/ReferrerInfo.h
netwerk/locales/en-US/necko.properties
toolkit/components/downloads/test/unit/common_test_Download.js
--- a/browser/app/macbuild/Contents/Info.plist.in
+++ b/browser/app/macbuild/Contents/Info.plist.in
@@ -199,24 +199,16 @@
 			<string>https URL</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
 				<string>https</string>
 			</array>
 		</dict>
 		<dict>
 			<key>CFBundleURLName</key>
-			<string>ftp URL</string>
-			<key>CFBundleURLSchemes</key>
-			<array>
-				<string>ftp</string>
-			</array>
-		</dict>
-		<dict>
-			<key>CFBundleURLName</key>
 			<string>file URL</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
 				<string>file</string>
 			</array>
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -1125,11 +1125,11 @@ function selectImage() {
     }
   }
 }
 
 function checkProtocol(img) {
   var url = img[COL_IMAGE_ADDRESS];
   return (
     /^data:image\//i.test(url) ||
-    /^(https?|ftp|file|about|chrome|resource):/.test(url)
+    /^(https?|file|about|chrome|resource):/.test(url)
   );
 }
--- a/browser/components/urlbar/UrlbarProviderAutofill.jsm
+++ b/browser/components/urlbar/UrlbarProviderAutofill.jsm
@@ -214,17 +214,16 @@ const QUERY_URL_PREFIX_BOOKMARK = urlQue
 );
 
 const kProtocolsWithIcons = [
   "chrome:",
   "moz-extension:",
   "about:",
   "http:",
   "https:",
-  "ftp:",
 ];
 function iconHelper(url) {
   if (typeof url == "string") {
     return kProtocolsWithIcons.some(p => url.startsWith(p))
       ? "page-icon:" + url
       : UrlbarUtils.ICON.DEFAULT;
   }
   if (url && url instanceof URL && kProtocolsWithIcons.includes(url.protocol)) {
--- a/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js
+++ b/browser/components/urlbar/tests/unit/test_avoid_stripping_to_empty_tokens.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 testEngine_setup();
 
 add_task(async function test_protocol_trimming() {
-  for (let prot of ["http", "https", "ftp"]) {
+  for (let prot of ["http", "https"]) {
     let visit = {
       // Include the protocol in the query string to ensure we get matches (see bug 1059395)
       uri: Services.io.newURI(
         prot +
           "://www.mozilla.org/test/?q=" +
           prot +
           encodeURIComponent("://") +
           "www.foo"
--- a/browser/components/urlbar/tests/unit/test_trimming.js
+++ b/browser/components/urlbar/tests/unit/test_trimming.js
@@ -142,62 +142,16 @@ add_task(async function test_untrimmed_w
         title: "www.mozilla.org/test/",
         heuristic: true,
       }),
     ],
   });
   await cleanupPlaces();
 });
 
-add_task(async function test_untrimmed_ftp() {
-  info("Searching for untrimmed ftp:// entry");
-  await PlacesTestUtils.addVisits({
-    uri: Services.io.newURI("ftp://mozilla.org/test/"),
-  });
-  let context = createContext("mo", { isPrivate: false });
-  await check_results({
-    context,
-    autofilled: "mozilla.org/",
-    completed: "ftp://mozilla.org/",
-    matches: [
-      makeVisitResult(context, {
-        uri: "ftp://mozilla.org/",
-        title: "ftp://mozilla.org",
-        heuristic: true,
-      }),
-      makeVisitResult(context, {
-        uri: "ftp://mozilla.org/test/",
-        title: "test visit for ftp://mozilla.org/test/",
-      }),
-    ],
-  });
-  await cleanupPlaces();
-});
-
-add_task(async function test_untrimmed_ftp_path() {
-  info("Searching for untrimmed ftp:// entry with path");
-  await PlacesTestUtils.addVisits({
-    uri: Services.io.newURI("ftp://mozilla.org/test/"),
-  });
-  let context = createContext("mozilla.org/t", { isPrivate: false });
-  await check_results({
-    context,
-    autofilled: "mozilla.org/test/",
-    completed: "ftp://mozilla.org/test/",
-    matches: [
-      makeVisitResult(context, {
-        uri: "ftp://mozilla.org/test/",
-        title: "ftp://mozilla.org/test/",
-        heuristic: true,
-      }),
-    ],
-  });
-  await cleanupPlaces();
-});
-
 add_task(async function test_escaped_chars() {
   info("Searching for URL with characters that are normally escaped");
   await PlacesTestUtils.addVisits({
     uri: Services.io.newURI("https://www.mozilla.org/啊-test"),
   });
   let context = createContext("https://www.mozilla.org/啊-test", {
     isPrivate: false,
   });
--- a/docshell/base/URIFixup.jsm
+++ b/docshell/base/URIFixup.jsm
@@ -84,17 +84,17 @@ XPCOMUtils.defineLazyPreferenceGetter(
 const {
   FIXUP_FLAG_NONE,
   FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP,
   FIXUP_FLAGS_MAKE_ALTERNATE_URI,
   FIXUP_FLAG_PRIVATE_CONTEXT,
   FIXUP_FLAG_FIX_SCHEME_TYPOS,
 } = Ci.nsIURIFixup;
 
-const COMMON_PROTOCOLS = ["http", "https", "ftp", "file"];
+const COMMON_PROTOCOLS = ["http", "https", "file"];
 
 // Regex used to identify user:password tokens in url strings.
 // This is not a strict valid characters check, because we try to fixup this
 // part of the url too.
 XPCOMUtils.defineLazyGetter(
   this,
   "userPasswordRegex",
   () => /^([a-z+.-]+:\/{0,3})*([^\/@]+@).+/i
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -2508,17 +2508,16 @@ class Document : public nsINode,
       return true;
     }
 
     // If we are a document "whose URL's scheme is not a network scheme."
     // NB: Explicitly allow file: URIs to store cookies.
 
     return !NodePrincipal()->SchemeIs("http") &&
            !NodePrincipal()->SchemeIs("https") &&
-           !NodePrincipal()->SchemeIs("ftp") &&
            !NodePrincipal()->SchemeIs("file");
   }
 
   bool IsLoadedAsData() { return mLoadedAsData; }
 
   void SetAddedToMemoryReportAsDataDocument() {
     mAddedToMemoryReportingAsDataDocument = true;
   }
--- a/dom/security/ReferrerInfo.cpp
+++ b/dom/security/ReferrerInfo.cpp
@@ -252,18 +252,17 @@ bool ReferrerInfo::IsReferrerSchemeAllow
   NS_ENSURE_TRUE(aReferrer, false);
 
   nsAutoCString scheme;
   nsresult rv = aReferrer->GetScheme(scheme);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
-  return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http") ||
-         scheme.EqualsIgnoreCase("ftp");
+  return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http");
 }
 
 /* static */
 bool ReferrerInfo::ShouldResponseInheritReferrerInfo(nsIChannel* aChannel) {
   if (!aChannel) {
     return false;
   }
 
@@ -1194,17 +1193,17 @@ nsresult ReferrerInfo::ComputeReferrer(n
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (!isUserReferrerSendingAllowed) {
     return NS_OK;
   }
 
-  // Enforce Referrer allowlist, only http, https, ftp scheme are allowed
+  // Enforce Referrer allowlist, only http, https scheme are allowed
   if (!IsReferrerSchemeAllowed(mOriginalReferrer)) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIURI> uri;
   rv = aChannel->GetURI(getter_AddRefs(uri));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
--- a/dom/security/ReferrerInfo.h
+++ b/dom/security/ReferrerInfo.h
@@ -149,17 +149,17 @@ class ReferrerInfo : public nsIReferrerI
    *
    * @param aDocument the document to init referrerInfo object.
    */
   static already_AddRefed<nsIReferrerInfo> CreateForSVGResources(
       Document* aDocument);
 
   /**
    * Check whether the given referrer's scheme is allowed to be computed and
-   * sent. The allowlist schemes are: http, https, ftp.
+   * sent. The allowlist schemes are: http, https.
    */
   static bool IsReferrerSchemeAllowed(nsIURI* aReferrer);
 
   /*
    * The Referrer Policy should be inherited for nested browsing contexts that
    * are not created from responses. Such as: srcdoc, data, blob.
    */
   static bool ShouldResponseInheritReferrerInfo(nsIChannel* aChannel);
@@ -363,17 +363,17 @@ class ReferrerInfo : public nsIReferrerI
   friend class mozilla::net::nsHttpChannel;
   friend class mozilla::dom::Document;
   /*
    * Check whether if unset referrer policy is overrided by default or not
    */
   bool IsPolicyOverrided() { return mOverridePolicyByDefault; }
 
   /*
-   *  Get origin string from a given valid referrer URI (http, https, ftp)
+   *  Get origin string from a given valid referrer URI (http, https)
    *
    *  @aReferrer - the full referrer URI
    *  @aResult - the resulting aReferrer in string format.
    */
   nsresult GetOriginFromReferrerURI(nsIURI* aReferrer,
                                     nsACString& aResult) const;
 
   /*
--- a/netwerk/locales/en-US/necko.properties
+++ b/netwerk/locales/en-US/necko.properties
@@ -9,19 +9,16 @@ 6=Transferring data from %1$S…
 7=Connecting to %1$S…
 8=Read %1$S
 9=Wrote %1$S
 10=Waiting for %1$S…
 11=Looked up %1$S…
 12=Performing a TLS handshake to %1$S…
 13=The TLS handshake finished for %1$S…
 
-27=Beginning FTP transaction…
-28=Finished FTP transaction
-
 RepostFormData=This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?
 
 # Directory listing strings
 DirTitle=Index of %1$S
 DirGoUp=Up to higher level directory
 ShowHidden=Show hidden objects
 DirColName=Name
 DirColSize=Size
--- a/toolkit/components/downloads/test/unit/common_test_Download.js
+++ b/toolkit/components/downloads/test/unit/common_test_Download.js
@@ -424,27 +424,16 @@ add_task(async function test_windows_zon
       expectedZoneId:
         "[ZoneTransfer]\r\nZoneId=3\r\n" +
         "ReferrerUrl=http://example.com/\r\n" +
         "HostUrl=" +
         httpSourceUrl +
         "\r\n",
     },
     {
-      options: {
-        referrerInfo: createReferrerInfo("ftp://user:pass@example.com/"),
-      },
-      expectedZoneId:
-        "[ZoneTransfer]\r\nZoneId=3\r\n" +
-        "ReferrerUrl=ftp://example.com/\r\n" +
-        "HostUrl=" +
-        httpSourceUrl +
-        "\r\n",
-    },
-    {
       options: { isPrivate: true },
       expectedZoneId: "[ZoneTransfer]\r\nZoneId=3\r\n",
     },
     {
       options: {
         referrerInfo: createReferrerInfo(TEST_REFERRER_URL),
         isPrivate: true,
       },