about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-07 22:20:40 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-07 22:20:40 +0200
commit472145622f03f643090f55d168e021f82a5dd2b6 (patch)
treee798eeae99d9d4264d95d5d84fabdd5ecfa038bf /src/display/client.nim
parent121bb912080570854f5d11683d961f670a8ba749 (diff)
downloadchawan-472145622f03f643090f55d168e021f82a5dd2b6.tar.gz
Add btoa, atob
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index fe973b9c..c531e4a6 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -34,6 +34,7 @@ import ips/forkserver
 import ips/serialize
 import ips/serversocket
 import ips/socketstream
+import js/base64
 import js/domexception
 import js/fromjs
 import js/intl
@@ -567,6 +568,12 @@ proc jsCollect(client: Client) {.jsfunc.} =
 proc sleep(client: Client, millis: int) {.jsfunc.} =
   sleep millis
 
+proc atob(client: Client, data: string): DOMResult[string] {.jsfunc.} =
+  return atob(data)
+
+proc btoa(client: Client, data: string): DOMResult[string] {.jsfunc.} =
+  return btoa(data)
+
 proc addJSModules(client: Client, ctx: JSContext) =
   ctx.addDOMExceptionModule()
   ctx.addCookieModule()