this is the code needed to load html page from nostr,
can we make it smaller?
```html
m = location.href.match(/([^;]+)/g)
s = new WebSocket("wss://" + m[1])
s.onopen = () => {
s.send('["REQ","q",{"ids":["'+m[2]+'"]}]')
}
s.onmessage = (e) => {
document.write(JSON.parse(e.data)[2].content)
}
```
moving all the params from url to code, we can make it to 326 bytes
data:text/html;base64,PHNjcmlwdD5zPW5ldyBXZWJTb2NrZXQoIndzczovL25vcy5sb2wiKSxzLm9ub3Blbj0oKT0+e3Muc2VuZCgnWyJSRVEiLCJxIix7ImlkcyI6WyI4MjA0ZTkyYWRlMTgxYTI0YWIwMjA2MTQ0ZmU1YzBiZjU1MWUxOTQyODEwZjk4YmJiNmMwZjI5NDYyODY5OWZkIl19XScpfSxzLm9ubWVzc2FnZT1lPT57ZG9jdW1lbnQud3JpdGUoSlNPTi5wYXJzZShlLmRhdGEpWzJdLmNvbnRlbnQpfTwvc2NyaXB0Pgo=
it seems base64 encoding in data uri is not necessary
this is just 257 bytes
data:text/html;nos.lol,
and now we have additional benefit that the note id and relay url are in clear text, can be configured in url again
Thread collapsed
Thread collapsed
Thread collapsed
Thread collapsed