fix: check href null

This commit is contained in:
YuKun Liu committed 2022-01-18 23:15:39 +08:00
1 parent 8089023a6c
commit 327f901548
1 file changed
+7 -5
+7 -5
View File
@@ -364,12 +364,14 @@ class Interpreter {
if (event.type == "click") {
event.preventDefault();
if (should_prevent_default !== `onclick`) {
console.log(event.target.getAttribute("href"));
if(element.tagName == "A") {
rpc.call("browser_open", {
mounted_dom_id: parseInt(real_id),
href: event.target.getAttribute("href")
})
const href = event.target.getAttribute("href")
if (href !== "" || href !== null) {
rpc.call("browser_open", {
mounted_dom_id: parseInt(real_id),
href: event.target.getAttribute("href")
});
}
}
}
}