🐛 优化弹窗被拦截时的处理方式
- 弹窗被阻止时改为toast提示,避免当前页跳转 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2019,8 +2019,8 @@ handleDragLeave(e) {
|
|||||||
if (!url) return;
|
if (!url) return;
|
||||||
const newWindow = window.open(url, '_blank', 'noopener');
|
const newWindow = window.open(url, '_blank', 'noopener');
|
||||||
if (!newWindow || newWindow.closed || typeof newWindow.closed === 'undefined') {
|
if (!newWindow || newWindow.closed || typeof newWindow.closed === 'undefined') {
|
||||||
// 部分浏览器可能阻止弹窗,退回当前页跳转
|
// 弹窗被拦截时提示用户手动打开,避免当前页跳转
|
||||||
window.location.href = url;
|
this.showToast('info', '提示', '浏览器阻止了新标签页,请允许弹窗或手动打开链接');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user