@@ -785,17 +785,17 @@ public Frame frame(String name) {
785785
786786 @ Override
787787 public Frame frameByUrl (String glob ) {
788- return frameFor (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , glob ));
788+ return frameFor (UrlMatcher . forGlob ( browserContext . baseUrl , glob , this .connection .localUtils , false ));
789789 }
790790
791791 @ Override
792792 public Frame frameByUrl (Pattern pattern ) {
793- return frameFor (new UrlMatcher (this . connection . localUtils , pattern ));
793+ return frameFor (new UrlMatcher (pattern ));
794794 }
795795
796796 @ Override
797797 public Frame frameByUrl (Predicate <String > predicate ) {
798- return frameFor (new UrlMatcher (this . connection . localUtils , predicate ));
798+ return frameFor (new UrlMatcher (predicate ));
799799 }
800800
801801 @ Override
@@ -1105,17 +1105,17 @@ private Response reloadImpl(ReloadOptions options) {
11051105
11061106 @ Override
11071107 public void route (String url , Consumer <Route > handler , RouteOptions options ) {
1108- route (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , url ), handler , options );
1108+ route (UrlMatcher . forGlob ( browserContext . baseUrl , url , this .connection .localUtils , false ), handler , options );
11091109 }
11101110
11111111 @ Override
11121112 public void route (Pattern url , Consumer <Route > handler , RouteOptions options ) {
1113- route (new UrlMatcher (this . connection . localUtils , url ), handler , options );
1113+ route (new UrlMatcher (url ), handler , options );
11141114 }
11151115
11161116 @ Override
11171117 public void route (Predicate <String > url , Consumer <Route > handler , RouteOptions options ) {
1118- route (new UrlMatcher (this . connection . localUtils , url ), handler , options );
1118+ route (new UrlMatcher (url ), handler , options );
11191119 }
11201120
11211121 @ Override
@@ -1127,7 +1127,7 @@ public void routeFromHAR(Path har, RouteFromHAROptions options) {
11271127 browserContext .recordIntoHar (this , har , convertType (options , BrowserContext .RouteFromHAROptions .class ));
11281128 return ;
11291129 }
1130- UrlMatcher matcher = UrlMatcher .forOneOf (this . connection . localUtils , browserContext .baseUrl , options .url );
1130+ UrlMatcher matcher = UrlMatcher .forOneOf (browserContext .baseUrl , options .url , this . connection . localUtils , false );
11311131 HARRouter harRouter = new HARRouter (connection .localUtils , har , options .notFound );
11321132 onClose (context -> harRouter .dispose ());
11331133 route (matcher , route -> harRouter .handle (route ), null );
@@ -1142,17 +1142,17 @@ private void route(UrlMatcher matcher, Consumer<Route> handler, RouteOptions opt
11421142
11431143 @ Override
11441144 public void routeWebSocket (String url , Consumer <WebSocketRoute > handler ) {
1145- routeWebSocketImpl (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , url ), handler );
1145+ routeWebSocketImpl (UrlMatcher . forGlob ( browserContext . baseUrl , url , this .connection .localUtils , true ), handler );
11461146 }
11471147
11481148 @ Override
11491149 public void routeWebSocket (Pattern pattern , Consumer <WebSocketRoute > handler ) {
1150- routeWebSocketImpl (new UrlMatcher (this . connection . localUtils , pattern ), handler );
1150+ routeWebSocketImpl (new UrlMatcher (pattern ), handler );
11511151 }
11521152
11531153 @ Override
11541154 public void routeWebSocket (Predicate <String > predicate , Consumer <WebSocketRoute > handler ) {
1155- routeWebSocketImpl (new UrlMatcher (this . connection . localUtils , predicate ), handler );
1155+ routeWebSocketImpl (new UrlMatcher (predicate ), handler );
11561156 }
11571157
11581158 private void routeWebSocketImpl (UrlMatcher matcher , Consumer <WebSocketRoute > handler ) {
@@ -1365,17 +1365,17 @@ public void unrouteAll() {
13651365
13661366 @ Override
13671367 public void unroute (String url , Consumer <Route > handler ) {
1368- unroute (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , url ), handler );
1368+ unroute (UrlMatcher . forGlob ( browserContext . baseUrl , url , this .connection .localUtils , false ), handler );
13691369 }
13701370
13711371 @ Override
13721372 public void unroute (Pattern url , Consumer <Route > handler ) {
1373- unroute (new UrlMatcher (this . connection . localUtils , url ), handler );
1373+ unroute (new UrlMatcher (url ), handler );
13741374 }
13751375
13761376 @ Override
13771377 public void unroute (Predicate <String > url , Consumer <Route > handler ) {
1378- unroute (new UrlMatcher (this . connection . localUtils , url ), handler );
1378+ unroute (new UrlMatcher (url ), handler );
13791379 }
13801380
13811381 private void unroute (UrlMatcher matcher , Consumer <Route > handler ) {
@@ -1508,12 +1508,12 @@ public T get() {
15081508
15091509 @ Override
15101510 public Request waitForRequest (String urlGlob , WaitForRequestOptions options , Runnable code ) {
1511- return waitForRequest (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , urlGlob ), null , options , code );
1511+ return waitForRequest (UrlMatcher . forGlob ( browserContext . baseUrl , urlGlob , this .connection .localUtils , false ), null , options , code );
15121512 }
15131513
15141514 @ Override
15151515 public Request waitForRequest (Pattern urlPattern , WaitForRequestOptions options , Runnable code ) {
1516- return waitForRequest (new UrlMatcher (this . connection . localUtils , urlPattern ), null , options , code );
1516+ return waitForRequest (new UrlMatcher (urlPattern ), null , options , code );
15171517 }
15181518
15191519 @ Override
@@ -1553,12 +1553,12 @@ private Request waitForRequestFinishedImpl(WaitForRequestFinishedOptions options
15531553
15541554 @ Override
15551555 public Response waitForResponse (String urlGlob , WaitForResponseOptions options , Runnable code ) {
1556- return waitForResponse (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , urlGlob ), null , options , code );
1556+ return waitForResponse (UrlMatcher . forGlob ( browserContext . baseUrl , urlGlob , this .connection .localUtils , false ), null , options , code );
15571557 }
15581558
15591559 @ Override
15601560 public Response waitForResponse (Pattern urlPattern , WaitForResponseOptions options , Runnable code ) {
1561- return waitForResponse (new UrlMatcher (this . connection . localUtils , urlPattern ), null , options , code );
1561+ return waitForResponse (new UrlMatcher (urlPattern ), null , options , code );
15621562 }
15631563
15641564 @ Override
@@ -1606,17 +1606,17 @@ public void waitForTimeout(double timeout) {
16061606
16071607 @ Override
16081608 public void waitForURL (String url , WaitForURLOptions options ) {
1609- waitForURL (new UrlMatcher ( this .connection .localUtils , browserContext . baseUrl , url ), options );
1609+ waitForURL (UrlMatcher . forGlob ( browserContext . baseUrl , url , this .connection .localUtils , false ), options );
16101610 }
16111611
16121612 @ Override
16131613 public void waitForURL (Pattern url , WaitForURLOptions options ) {
1614- waitForURL (new UrlMatcher (this . connection . localUtils , url ), options );
1614+ waitForURL (new UrlMatcher (url ), options );
16151615 }
16161616
16171617 @ Override
16181618 public void waitForURL (Predicate <String > url , WaitForURLOptions options ) {
1619- waitForURL (new UrlMatcher (this . connection . localUtils , url ), options );
1619+ waitForURL (new UrlMatcher (url ), options );
16201620 }
16211621
16221622 private void waitForURL (UrlMatcher matcher , WaitForURLOptions options ) {
0 commit comments