Skip to content

openUrl

Navigates the current browser tab to the given URL. When the page is embedded inside an iframe, the navigation breaks out by targeting _top.

Importing

ts
import { openUrl } from '@basmilius/utils';

Usage

ts
import { openUrl } from '@basmilius/utils';

openUrl('https://example.com');

Parameters

NameTypeDescription
urlstringThe URL to navigate to.

Returns

void — navigation is triggered synchronously.

Type signature

ts
declare function openUrl(url: string): void;

See also