code: function (urlStr) {
          /*
          * This function executes the code in the following sequence for early return avoiding the costly regex matches.
          * To avoid most of the memory consuming code.
          * 1. It check whether the match string is <all_urls> in that case, it return immediately without any further
          *    processing.
          * 2. Checks whether the matchPattern follows the rules, https://developer.chrome.com/extensions/match_patterns,
          *    If not then, dont process it.
          * 3. Check for the protocol, as it is a normal array check.
          * 4. Checks the host, as it doesn't involve regex match and has only string comparisons.
          * 5. Finally, checks for the path, which actually involves the Regex matching, the slow process.
          */
          // If the matchPattern is <all_urls> then there is no need for any validations.
          if (this.pattern === MATCH_ALL_URLS) {
              return true;
          }
  
          var url,
              matchRegexObject = this._matchPatternObject;
  
          // Empty matchRegexObject represents the match is INVALID match
          if (_.isEmpty(matchRegexObject)) {
              return false;
          }
  
          try {
              url = new Url(urlStr);
          }
          catch (e) {
              return false;
          }
  
          return (this.testProtocol(url.protocol) &&
              this.testHost(url.getHost()) &&
              this.testPort(url.port, url.protocol) &&
              this.testPath(url.getPath()));
      }
docs: Tests the url string with the match pattern provided.
  Follows the https://developer.chrome.com/extensions/match_patterns pattern for pattern validation and matching
  
  @param {String=} urlStr The url string for which the proxy match needs to be done.
  @returns {Boolean=}