openUrl
Opens an http: / https: URL in the user's default browser. The Fluxlay host calls tauri-plugin-opener on the wallpaper's behalf, which routes to the system default handler (Chrome, Safari, Edge, etc.).
Import
import { openUrl } from "@fluxlay/react";Signature
function openUrl(url: string): Promise<void>;Usage
import { openUrl } from "@fluxlay/react";
function ExternalLink({ href, children }: { href: string; children: React.ReactNode }) {
return (
<button type="button" onClick={() => void openUrl(href)}>
{children}
</button>
);
}Why this exists
Wallpaper webviews are sandboxed: there is no way to navigate the OS shell from the page, and <a target="_blank"> links are blocked by the wallpaper window's frame policy. openUrl is the only sanctioned way to make in-wallpaper links clickable.
Notes
- Only
http:andhttps:schemes are accepted. Anything else (file:,javascript:, custom protocols) is rejected with HTTP 400. - The promise resolves once the host has dispatched the URL to the OS. It does not wait for the browser to actually finish loading the page.
openUrldoes not require anetwork:declaration. It launches the OS browser, which then makes its own request — the wallpaper webview is not involved in the fetch.