What is Nostr?
lurkingcat / Lurking Cat
npub1jn3…6n6v
2023-03-30 14:44:28
in reply to nevent1q…kjne

lurkingcat on Nostr: Oh, the code in the github clearly show it parse the clipboard and check whether it ...

Oh, the code in the github clearly show it parse the clipboard and check whether it is contain valid NIP-21 text. If it is valid then Nostros will handle it otherwise Nostros will ignore it. It's ok, there's no 'keylogger' code in that.

const checkClipboard: () => void = () => {
if (Clipboard.hasString()) {
Clipboard.getString().then((clipboardContent) => {
if (validNip21(clipboardContent) && !clipboardLoads.includes(clipboardContent)) {
setClipboardLoads((prev) => [...prev, clipboardContent])
setClipboardNip21(clipboardContent)
}
})
}
}

export const validNip21: (string: string | undefined) => boolean = (string) => {
if (string) {
const regexp = /^(nostr:)?(npub1|nprofile1|nevent1|nrelay1|note1){1}\S*$/
return regexp.test(string)
} else {
return false
}
}
Author Public Key
npub1jn3x3a9v5nxpgcf7rfk4pk45pzptnuy2x8tldw5pvpzznvdmhg8q0f6n6v