no message

This commit is contained in:
kuaifan 2025-04-07 11:54:43 +08:00
parent 3e44e584c0
commit 3334abfb8f
4 changed files with 55 additions and 44 deletions

View File

@ -324,7 +324,7 @@ class IndexController extends InvokeController
"file" => Request::file('file'),
"type" => 'publish',
"path" => $draftPath,
"fileName" => true,
"saveName" => true,
]);
}

26
electron/electron.js vendored
View File

@ -185,11 +185,12 @@ function createMainWindow() {
// 新窗口处理
mainWindow.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
}
utils.onBeforeOpenWindow(mainWindow.webContents, url).then(() => {
openExternal(url)
})
} else {
utils.onBeforeOpenWindow(mainWindow.webContents, url).then(() => {
openExternal(url)
})
}
return {action: 'deny'}
})
@ -425,11 +426,12 @@ function createChildWindow(args) {
// 新窗口处理
browser.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
}
utils.onBeforeOpenWindow(browser.webContents, url).then(() => {
openExternal(url)
})
} else {
utils.onBeforeOpenWindow(browser.webContents, url).then(() => {
openExternal(url)
})
}
return {action: 'deny'}
})
@ -691,9 +693,10 @@ function createWebTabWindow(args) {
})
browserView.webContents.setWindowOpenHandler(({url}) => {
if (allowedCalls.test(url)) {
return {action: 'allow'}
openExternal(url)
} else {
createWebTabWindow({url})
}
createWebTabWindow({url})
return {action: 'deny'}
})
browserView.webContents.on('page-title-updated', (event, title) => {
@ -2483,10 +2486,9 @@ function windowAction(method) {
function openExternal(url) {
//Only open http(s), mailto, tel, and callto links
if (allowedUrls.test(url)) {
shell.openExternal(url);
shell.openExternal(url).catch(_ => {});
return true;
}
return false;
}

View File

@ -267,6 +267,10 @@ export default {
if (this.isCtrlCommandPressed) {
return 1;
}
// 应用协议链接
if (this.isApplicationProtocol(url)) {
return 1;
}
// 常见会议链接
if (this.isMeetingUrlStrict(url)) {
return 1;
@ -300,6 +304,41 @@ export default {
return 0;
},
isApplicationProtocol(url) {
const protocols = [
'thunder:', // 迅雷专有链接
'ed2k:', // 电驴链接
'magnet:', // 磁力链接
'weixin:', // 微信
'alipays:', // 支付宝
'mqq:', // QQ
'dingtalk:', // 钉钉
'baidumap:', // 百度地图
'iosamap:', // 高德地图iOS
'androidamap:', // 高德地图Android
'tel:', // 电话
'sms:', // 短信
'mailto:', // 邮件
'market:', // 应用市场
'intent:', // Android Intent
'taobao:', // 淘宝
'tmall:', // 天猫
'jd:', // 京东
'pinduoduo:', // 拼多多
'vnd.youtube:', // YouTube应用
'zhihu:', // 知乎
'bilibili:', // B站
'snssdk1128:', // 抖音
'kwai:', // 快手
'fb:', // Facebook
'twitter:', // Twitter
'instagram:', // Instagram
'linkedin:' // LinkedIn
];
const lowerUrl = `${url}`.toLowerCase()
return protocols.some(protocol => lowerUrl.startsWith(protocol));
},
isMeetingUrlStrict(url) {
const meetingDomains = [
// 视频会议(内置浏览器无法正常使用摄像头/麦克风)
@ -360,9 +399,6 @@ export default {
'drive.google.com', // Google Drive
'onedrive.live.com', // OneDrive
'xunlei.com', // 迅雷
'thunder://', // 迅雷专有链接
'ed2k://', // 电驴链接
'magnet:?', // 磁力链接
// 即时通讯(需要系统通知和持久连接)
'wx.qq.com', // 微信网页版
@ -384,33 +420,6 @@ export default {
'instagram.com/live', // Instagram直播
'youtube.com/live', // YouTube直播
'twitch.tv/live', // Twitch直播
// 专门的APP协议链接
'weixin://', // 微信
'alipays://', // 支付宝
'mqq://', // QQ
'dingtalk://', // 钉钉
'baidumap://', // 百度地图
'iosamap://', // 高德地图iOS
'androidamap://', // 高德地图Android
'tel://', // 电话
'sms://', // 短信
'mailto://', // 邮件
'market://', // 应用市场
'intent://', // Android Intent
'taobao://', // 淘宝
'tmall://', // 天猫
'jd://', // 京东
'pinduoduo://', // 拼多多
'vnd.youtube://', // YouTube应用
'zhihu://', // 知乎
'bilibili://', // B站
'snssdk1128://', // 抖音
'kwai://', // 快手
'fb://', // Facebook
'twitter://', // Twitter
'instagram://', // Instagram
'linkedin://' // LinkedIn
];
const lowerUrl = `${url}`.toLowerCase()
return meetingDomains.some(domain => lowerUrl.indexOf(domain) !== -1);

View File

@ -403,7 +403,7 @@
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
-webkit-line-clamp: 6;
}
.modal-item-mybot {