From 6e0716d20da50046cc017ff78a4b16577721cd0f Mon Sep 17 00:00:00 2001 From: Ryan Breen Date: Sun, 22 Jan 2023 21:43:38 -0500 Subject: [PATCH] Added nostr.enable() function to page injection. This is for Alby compatibility, and let's it work with nostr.band. --- Shared (Extension)/Resources/nostr.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Shared (Extension)/Resources/nostr.js b/Shared (Extension)/Resources/nostr.js index 4603d79..8684c09 100644 --- a/Shared (Extension)/Resources/nostr.js +++ b/Shared (Extension)/Resources/nostr.js @@ -13,6 +13,12 @@ window.nostr = { return await this.broadcast('getRelays'); }, + // This is here for Alby comatibility. This is not part of the NIP-07 standard. + // I have found at least one site, nostr.band, which expects it to be present. + async enable() { + return {enabled: true} + }, + broadcast(kind, payload) { let reqId = Math.random().toString(); return new Promise((resolve, _reject) => {