mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 (#1228)
* chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 * actually apply the rules lol * rebuild --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
@@ -5,27 +5,27 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
// open <a href="..."> links with the API
|
||||
function openLinks() {
|
||||
function openLinks(): void {
|
||||
document.querySelector("body")?.addEventListener("click", function (e) {
|
||||
let target = e.target as HTMLElement;
|
||||
let target: HTMLElement | null = e.target as HTMLElement;
|
||||
while (target != null) {
|
||||
if (target.matches("a")) {
|
||||
const t = target as HTMLAnchorElement;
|
||||
if (
|
||||
t.href &&
|
||||
t.href !== "" &&
|
||||
["http://", "https://", "mailto:", "tel:"].some((v) =>
|
||||
t.href.startsWith(v),
|
||||
) &&
|
||||
t.target === "_blank"
|
||||
) {
|
||||
invoke("plugin:shell|open", {
|
||||
void invoke("plugin:shell|open", {
|
||||
path: t.href,
|
||||
});
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
}
|
||||
target = target.parentElement as HTMLElement;
|
||||
target = target.parentElement;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user