更新逻辑

This commit is contained in:
Tw93
2022-11-15 19:54:11 +08:00
parent b6d71531b3
commit 6be202bbc7
2 changed files with 14 additions and 2 deletions

View File

@@ -128,10 +128,11 @@ window.addEventListener('DOMContentLoaded', (_event) => {
document.addEventListener('click', (e) => {
const origin = e.target.closest('a');
const href = origin.href;
if (href) {
if (origin && origin.href) {
origin.target = '_self';
//额外处理下 twitter 的外跳,对于其他需要外跳的可以改这里成对应域名
const href = origin.href;
if(location.host === "twitter.com" && href.indexOf("twitter.com")===-1){
e.preventDefault();
window.ipc.postMessage(`open_browser:${href}`);