🐛 Fix the issue of address redirection opening a new window.
This commit is contained in:
4
src-tauri/src/inject/event.js
vendored
4
src-tauri/src/inject/event.js
vendored
@@ -59,7 +59,7 @@ function externalTargetLink() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function externalSelfLink() {
|
function externalSelfLink() {
|
||||||
return ['twitter.com', 'www.zhihu.com'].indexOf(location.hostname) > -1;
|
return ['chat.openai.com'].indexOf(location.hostname) > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
@@ -170,7 +170,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
// case: download from dataURL -> convert dataURL ->
|
// case: download from dataURL -> convert dataURL ->
|
||||||
} else if (url.startsWith('data:')) {
|
} else if (url.startsWith('data:')) {
|
||||||
downloadFromDataUri(url, filename);
|
downloadFromDataUri(url, filename);
|
||||||
} else if (!externalSelfLink()) {
|
} else if (isDownloadLink(url) || externalSelfLink()) {
|
||||||
handleExternalLink(e, url);
|
handleExternalLink(e, url);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user