How to click the link after using the system browser to open? #1898
Unanswered
icewizardry
asked this question in
Q&A
Replies: 1 comment
-
Here are two ways for your reference:
document.body.addEventListener("click", function () {
var target = event.target || event.srcElement;
var url = target.getAttribute("href");
if (target.nodeName.toLocaleLowerCase() === "a") {
window.runtime.BrowserOpenURL(url);
}
});
// link.vue
<template>
<span class="openlink" @click="onClickhandle">
<slot></slot>
</span>
</template>
<script>
export default {
name: "Link",
props: {
href: String,
},
setup(props) {
const onClickhandle = () => {
window.runtime.BrowserOpenURL(props.href);
};
return {
onClickhandle,
};
},
};
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is not friendly to open a new window in Wails, so I hope to use the system's own browser instead. How to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions