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
}
}
Published at
2023-03-30 14:44:28Event JSON
{
"id": "c4338f177c7b14c9eec9f8f5400497a0ee089fd61f00c45b43da253585e1f02b",
"pubkey": "94e268f4aca4cc14613e1a6d50dab40882b9f08a31d7f6ba81604429b1bbba0e",
"created_at": 1680187468,
"kind": 1,
"tags": [
[
"e",
"65e75f37ad67415fce6281956b3373149c3da6ae023880cadcfc35c7a757347e"
],
[
"e",
"9f568f9b498ce2395256416eb9f067650d0174605142e0ce01f81e145a5558dc"
],
[
"e",
"1112f551de48f76394cd29465c4c81fbb98eea9da0c1ce0e5107704449d85d0e"
],
[
"p",
"2cddc25194de5dad70ba22ed207eb866d34dbf7bc65eeb6e1d479d466e00542c"
],
[
"p",
"94e268f4aca4cc14613e1a6d50dab40882b9f08a31d7f6ba81604429b1bbba0e"
],
[
"r",
"Clipboard.getString"
],
[
"r",
"regexp.test"
]
],
"content": "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.\n\nconst checkClipboard: () =\u003e void = () =\u003e {\n if (Clipboard.hasString()) {\n Clipboard.getString().then((clipboardContent) =\u003e {\n if (validNip21(clipboardContent) \u0026\u0026 !clipboardLoads.includes(clipboardContent)) {\n setClipboardLoads((prev) =\u003e [...prev, clipboardContent])\n setClipboardNip21(clipboardContent)\n }\n })\n }\n }\n\nexport const validNip21: (string: string | undefined) =\u003e boolean = (string) =\u003e {\n if (string) {\n const regexp = /^(nostr:)?(npub1|nprofile1|nevent1|nrelay1|note1){1}\\S*$/\n return regexp.test(string)\n } else {\n return false\n }\n}",
"sig": "26f587de5acdd497ecd26b68c720989ce14e465d71710f5fe44e80c192ac115cd2652a487f199e90b76a200fc5ef469613ac599e2054b9044729fa46c95d4aad"
}