Skip to content

Commit 2596617

Browse files
committed
🐛 修复某些.user.js url 加载错误
1 parent a1b96b9 commit 2596617

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pkg/utils/script.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export function parseMetadata(code: string): Metadata | null {
5959
if (ret.name === undefined) {
6060
return null;
6161
}
62+
if (Object.keys(ret).length < 3) {
63+
return null;
64+
}
6265
if (!ret.namespace) {
6366
ret.namespace = [""];
6467
}

0 commit comments

Comments
 (0)