mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-10 20:32:21 +08:00
fix(security): restrict external URL opening
Close: 7800
This commit is contained in:
@@ -18,7 +18,6 @@ import {
|
||||
MenuItem,
|
||||
Typography,
|
||||
} from '@mui/material'
|
||||
import { open } from '@tauri-apps/plugin-shell'
|
||||
import { useLockFn } from 'ahooks'
|
||||
import dayjs from 'dayjs'
|
||||
import {
|
||||
@@ -47,6 +46,7 @@ import { showNotice } from '@/services/notice-service'
|
||||
import { useLoadingCache, useSetLoadingCache } from '@/services/states'
|
||||
import type { TranslationKey } from '@/types/generated/i18n-keys'
|
||||
import { debugLog } from '@/utils/debug'
|
||||
import { openExternalUrl } from '@/utils/open-external-url'
|
||||
import parseTraffic from '@/utils/parse-traffic'
|
||||
|
||||
import { ProfileBox } from './profile-box'
|
||||
@@ -316,7 +316,8 @@ const ProfileItemBase = (props: ProfileItemProps) => {
|
||||
|
||||
const onOpenHome = () => {
|
||||
setAnchorEl(null)
|
||||
open(itemData.home ?? '')
|
||||
if (!itemData.home) return
|
||||
void openExternalUrl(itemData.home).catch(showNotice.error)
|
||||
}
|
||||
|
||||
const onEditInfo = () => {
|
||||
|
||||
Reference in New Issue
Block a user