fix: 修复外链正则转义错误导致主进程无法启动,加源文件语法检查测试
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fc3afd1863
commit
91d53ffec0
2 files changed
+29
-1
No files matched your search
+1
-1
@@ -54,7 +54,7 @@ function warn(message) {
|
||||
// 页面里的外链(如"申请 Key")一律交给系统浏览器,不在应用内开窗口
|
||||
function guardNavigation(win) {
|
||||
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (/^https?:///i.test(url)) shell.openExternal(url);
|
||||
if (/^https?:\/\//i.test(url)) shell.openExternal(url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
win.webContents.on('will-navigate', (event) => event.preventDefault());
|
||||
|
||||
Reference in new issue
Block a user