()
| 84 | * Also detects inline manifest format (flag bit 2 set in #d=... data). |
| 85 | */ |
| 86 | export function hasUrlToLoad(): boolean { |
| 87 | if (typeof window === 'undefined') return false; |
| 88 | |
| 89 | // Hash format: #d=... |
| 90 | const hash = window.location.hash; |
| 91 | if (hash) { |
| 92 | const hashContent = hash.startsWith('#') ? hash.slice(1) : hash; |
| 93 | const hashParams = new URLSearchParams(hashContent); |
| 94 | if (hashParams.get('d')) return true; |
| 95 | } |
| 96 | |
| 97 | // Legacy query format: ?url=... |
| 98 | const searchParams = new URLSearchParams(window.location.search); |
| 99 | if (searchParams.get('url')) return true; |
| 100 | |
| 101 | return false; |
| 102 | } |
| 103 | |
| 104 | // Pre-compute at module load to show loading indicator immediately |
| 105 | const initialUrlLoading = hasUrlToLoad(); |
no test coverage detected