All files / src/lib openUrl.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12      3x 2x 2x 2x   1x      
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 Max Boksem. See NOTICE for additional terms under GPLv3 section 7.
 
export const openUrl = async (url: string): Promise<void> => {
	try {
		const opener = await import("@tauri-apps/plugin-opener");
		await opener.openUrl(url);
	} catch {
		window.open(url, "_blank");
	}
};