docs: static String domainOf(String url) {
      int start = -1;
      if (url.startsWith("//")) {
        start = 2;
      } else {
        start = url.indexOf("://");
        if (start >= 0) { start += 3; }
      }
      if (start < 0) { return null; }
      for (int i = 0; i < start - 3; ++i) {
        switch (url.charAt(i)) {
        case '/': case '?': case '#': return null;
        default: break;
        }
      }
      int end = url.length();
      for (int i = start; i < end; ++i) {
        switch (url.charAt(i)) {
        case '/': case '?': case '#': end = i; break;
        default: break;
        }
      }
      if (start < end) {
        return url.substring(start, end);
      } else {
        return null;
      }
    }