window.nostr.js 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +2 -27
- package/dist/window.nostr.js +11 -11
- package/index.html +1 -26
- package/justfile +1 -7
- package/package.json +3 -3
- package/src/App.svelte +69 -27
- package/dist/iframe.html +0 -1
- package/dist/iframe.js +0 -4333
- package/dist/iframe.js.map +0 -7
- package/iframe/build.js +0 -9
- package/iframe/iframe.html +0 -1
- package/iframe/iframe.ts +0 -21
- package/src/lib.ts +0 -7
package/iframe/build.js
DELETED
package/iframe/iframe.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<script src="iframe.js"></script>
|
package/iframe/iframe.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {parseBunkerInput} from 'nostr-tools/nip46'
|
|
2
|
-
import {localStorageKeys} from '../src/lib'
|
|
3
|
-
|
|
4
|
-
window.onmessage = async (ev: MessageEvent) => {
|
|
5
|
-
if (
|
|
6
|
-
!ev.origin.startsWith('https://join.the-nostr.org') &&
|
|
7
|
-
!ev.origin.startsWith('http://localhost:6711')
|
|
8
|
-
) {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const {bunker} = ev.data
|
|
13
|
-
if (bunker) {
|
|
14
|
-
const bp = await parseBunkerInput(bunker)
|
|
15
|
-
if (bp) {
|
|
16
|
-
localStorage.setItem(localStorageKeys.BUNKER_POINTER, JSON.stringify(bp))
|
|
17
|
-
} else {
|
|
18
|
-
console.error('wnj iframe got an invalid bunker url:', bunker)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|