mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 19:10:49 +08:00
This commit is contained in:
parent
76c9243ff8
commit
fdf840cc5f
@ -7,7 +7,16 @@ export const openByMobile = (uri: string) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isInIOS()) {
|
if (isInIOS()) {
|
||||||
window.webkit.messageHandlers.openLink.postMessage(uri);
|
if (uri.startsWith("assets/")) {
|
||||||
|
window.webkit.messageHandlers.openLink.postMessage(location.origin + "/" + uri);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
new URL(uri);
|
||||||
|
window.webkit.messageHandlers.openLink.postMessage(uri);
|
||||||
|
} catch (e) {
|
||||||
|
window.webkit.messageHandlers.openLink.postMessage("https://" + uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (isInAndroid()) {
|
} else if (isInAndroid()) {
|
||||||
window.JSAndroid.openExternal(uri);
|
window.JSAndroid.openExternal(uri);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user