Bug 794520 - Replace string.contains with string.endsWith in formatValue. r=dao
authorJared Wein <jwein@mozilla.com>
Wed, 26 Sep 2012 10:14:56 -0700
changeset 108158 be63bddab58b180d875089af902f5aacdd7216d9
parent 108157 ff22c54142371c4e34f06d975df7f4494072f448
child 108159 b13571ca268d80be7ef1b4a6e279a15fdd37f280
push id23539
push userryanvm@gmail.com
push dateWed, 26 Sep 2012 22:55:55 +0000
treeherderautoland@ec079fd92224 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs794520
milestone18.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 794520 - Replace string.contains with string.endsWith in formatValue. r=dao
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -177,17 +177,17 @@
 
           let [, preDomain, domain] = matchedURL;
           let baseDomain = domain;
           let subDomain = "";
           // getBaseDomainFromHost doesn't recognize IPv6 literals in brackets as IPs (bug 667159)
           if (domain[0] != "[") {
             try {
               baseDomain = Services.eTLD.getBaseDomainFromHost(domain);
-              if (!domain.contains(baseDomain)) {
+              if (!domain.endsWith(baseDomain)) {
                 // getBaseDomainFromHost converts its resultant to ACE.
                 let IDNService = Cc["@mozilla.org/network/idn-service;1"]
                                  .getService(Ci.nsIIDNService);
                 baseDomain = IDNService.convertACEtoUTF8(baseDomain);
               }
             } catch (e) {}
           }
           if (baseDomain != domain) {