Added nostr.enable() function to page injection. This is for Alby compatibility, and let's it work with nostr.band.

This commit is contained in:
Ryan Breen
2023-01-22 21:43:38 -05:00
parent 8026339232
commit 6e0716d20d

View File

@@ -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) => {