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 {