Download apps/readest-app/src/utils/open.ts from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/open.ts
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/utils/open.ts
-
curl -L -o open.ts https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/utils/open.ts
476 Bytes
| import { openUrl } from '@tauri-apps/plugin-opener'; | |
| import { isTauriAppPlatform } from '@/services/environment'; | |
| export const interceptWindowOpen = () => { | |
| const windowOpen = window.open; | |
| globalThis.open = function ( | |
| url?: string | URL, | |
| target?: string, | |
| features?: string, | |
| ): Window | null { | |
| if (isTauriAppPlatform()) { | |
| openUrl(url?.toString() || ''); | |
| return null; | |
| } else { | |
| return windowOpen(url, target, features); | |
| } | |
| }; | |
| }; | |