Add filter for full request url in network tab

This CL adds a new url: filter to the network tab that filters
on the full URL, including the protocol information (e.g. https://)
in the search query.

Note on default filtering: Originally this CL modified the default
filtering by using the full request url, instead of the current
implementation which relies on the request path and name. Since this
change might have confused power-users and a more thorough rework
of the filtering is planned, the decision was made to add an additional
url: filter instead.

Bug: 1104188
Change-Id: Ibddd26eca7fb56eb9d08277df72c0da3acbb53a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318146
Commit-Queue: Sigurd Schneider <[email protected]>
Reviewed-by: Sigurd Schneider <[email protected]>
diff --git a/front_end/network/NetworkLogView.js b/front_end/network/NetworkLogView.js
index f3ed36b..c53b2c6 100644
--- a/front_end/network/NetworkLogView.js
+++ b/front_end/network/NetworkLogView.js
@@ -494,6 +494,16 @@
   }
 
   /**
+   * @param {string} value
+   * @param {!SDK.NetworkRequest.NetworkRequest} request
+   * @return {boolean}
+   */
+  static _requestUrlFilter(value, request) {
+    const regex = new RegExp(value.escapeForRegExp(), 'i');
+    return regex.test(request.url());
+  }
+
+  /**
    * @param {number} windowStart
    * @param {number} windowEnd
    * @param {!SDK.NetworkRequest.NetworkRequest} request
@@ -1314,6 +1324,7 @@
     this._suggestionBuilder.addItem(FilterType.Scheme, '' + request.scheme);
     this._suggestionBuilder.addItem(FilterType.StatusCode, '' + request.statusCode);
     this._suggestionBuilder.addItem(FilterType.ResourceType, request.resourceType().name());
+    this._suggestionBuilder.addItem(FilterType.Url, request.securityOrigin());
 
     const priority = request.priority();
     if (priority) {
@@ -1737,6 +1748,9 @@
 
       case FilterType.ResourceType:
         return NetworkLogView._resourceTypeFilter.bind(null, value);
+
+      case FilterType.Url:
+        return NetworkLogView._requestUrlFilter.bind(null, value);
     }
     return null;
   }
@@ -2197,7 +2211,8 @@
   CookieName: 'cookie-name',
   CookiePath: 'cookie-path',
   CookieValue: 'cookie-value',
-  StatusCode: 'status-code'
+  StatusCode: 'status-code',
+  Url: 'url'
 };
 
 /** @enum {string} */