fix: filter out onion relay reviews on browsers without onion support
This commit is contained in:
parent
a6a8ac04ac
commit
a8fa3e1ecd
2 changed files with 16 additions and 5 deletions
|
|
@ -1,5 +1,10 @@
|
|||
export function isWebsocketUrl(url: string): boolean {
|
||||
return /^wss?:\/\/.+$/.test(url)
|
||||
try {
|
||||
const protocol = new URL(url).protocol
|
||||
return protocol === 'ws:' || protocol === 'wss:'
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export function isOnionUrl(url: string): boolean {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue