Well, after some searching on Google, I discovered that webkit has native Base64 encoding and decoding functions, respectively named
var s = "foo"; var encoded = btoa(s); var decoded = atob(encoded); window.runtime.trace(s); window.runtime.trace(encoded); window.runtime.trace(decoded);
foo Zm9v foo
Among other things, this can come in handy if you need to create custom HTTP authentication headers.
You can find more information on the apis here.