Skip to content

Commit af0b52c

Browse files
committed
fix(url): potential XSS vulnerabilities
1 parent 0193ec3 commit af0b52c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pages/home/previews/url.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export default function () {
1313
const { text } = useParseText(ini)
1414
const config = recordKeysToLowerCase(parse(text()))
1515
const url = config.internetshortcut?.url
16-
url && window.open(url, "_blank")
16+
if (url) {
17+
const a = document.createElement("a")
18+
a.href = url
19+
a.rel = "noopener noreferrer"
20+
a.target = "_blank"
21+
a.click()
22+
}
1723
}
1824
createEffect(() => {
1925
openInNewWindow()

0 commit comments

Comments
 (0)