Url

URL Builder

Methods for creating and updating a GPALUrl object that carries a URL string and optional pre-navigation storage actions.

Methods for creating and updating a GPALUrl object that carries a URL string and optional pre-navigation storage actions.

GPAL.Url() creates a new GPALUrl. ForUrl sets or changes the target URL on an existing GPALUrl instance. GPALUrl supports implicit conversion from string - passing a plain string where a GPALUrl is expected works but emits a one-time warning about equality limitations. Use GPAL.Url() and ForUrl() when you need to reuse or compare URL objects. ToGPALObject returns the IGPALUrl interface.

TIP

GPAL.Browser.GoTo("https://example.com") works because of implicit string-to-GPALUrl conversion. However, two GPALUrl objects created from the same string are not equal by default. Create a single GPALUrl instance and reuse it when you need equality comparisons.

Examples

GPAL Fluent: High-level fluent C# API

//For simple navigation, the implicit string conversion is fine. Use GPAL.Url().ForUrl() when you need to attach pre-navigation storage actions (cookies, localStorage cleanup) to the URL object.

// Simple URL (implicit conversion from string) GPAL.Browser.GoTo("https://example.com"); // Explicit GPALUrl for reuse var homeUrl = GPAL.Url .ForUrl("https://example.com") .ToGPALObject(); GPAL.Browser .GoTo(homeUrl) .GoTo("https://example.com/about") .GoTo(homeUrl); // reuse the same object