mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-26 19:47:25 +02:00
fix bunker:// uri for chrome
This commit is contained in:
@@ -276,7 +276,8 @@ class NostrConnectService {
|
|||||||
fromBunkerURI(uri: string) {
|
fromBunkerURI(uri: string) {
|
||||||
const url = new URL(uri);
|
const url = new URL(uri);
|
||||||
|
|
||||||
const pubkey = url.host;
|
// firefox puts pubkey part in host, chrome puts pubkey in pathname
|
||||||
|
const pubkey = url.host || url.pathname.replace("//", "");
|
||||||
if (!isHexKey(pubkey)) throw new Error("Invalid connection URI");
|
if (!isHexKey(pubkey)) throw new Error("Invalid connection URI");
|
||||||
const relays = url.searchParams.getAll("relay");
|
const relays = url.searchParams.getAll("relay");
|
||||||
if (relays.length === 0) throw new Error("Missing relays");
|
if (relays.length === 0) throw new Error("Missing relays");
|
||||||
|
Reference in New Issue
Block a user