23 lines
310 B
Bash
23 lines
310 B
Bash
#!/bin/sh
|
|
#
|
|
# this is a curl/wget stub which
|
|
# substitute it with browser's javascript fetch()
|
|
|
|
url="$1"
|
|
|
|
js = '
|
|
url = args[0]
|
|
ret = 0
|
|
|
|
fetch(url)
|
|
.then( (res) => res.arrayBuffer() )
|
|
.then( (abuf) => {
|
|
buf = new Uint8Array(abuf)
|
|
})
|
|
.catch( (e) => {
|
|
done = true
|
|
ret = 1
|
|
})
|
|
'
|
|
|
|
# wait for response filese
|