WebBrowser
Provides static methods to interact with and retrieve information about the current web browser environment. It includes functionality to get the current URL, hostname, query parameters, and to navigate to a new URL. Useful for handling browser-specific operations and URL manipulations.
static url(): string
A string representing the complete URL of the current web page.
Example:
console.log(WebBrowser.url());
static hostname(): string
Returns the hostname of the current URL. The hostname is the domain name portion of the URL.
Example:
console.log(WebBrowser.hostname());
static queryParams(): any
Returns the query parameters of the current URL as a JSON object.
Example:
const params = WebBrowser.queryParams();
console.log(params);
static navigateToURL(url: string): void
Opens the specified URL in a new browser tab. This method is used to navigate to a different web page by creating a new tab or window in the browser.
Example:
WebBrowser.navigateToURL('https://example.com');