WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 158576
55663
Implement btoa and atob functions in Web Workers
https://bugs.webkit.org/show_bug.cgi?id=55663
Summary
Implement btoa and atob functions in Web Workers
Jon Leighton
Reported
2011-03-03 04:40:54 PST
Firefox supports btoa() and atob() functions within workers, which do the same thing as window.btoa() and window.atob() in the DOM. It would be great if these were available in WebKit too.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2011-03-03 14:38:58 PST
Could you please provide some use cases for using these functions in workers?
Jon Leighton
Comment 2
2011-03-03 15:07:18 PST
In a project I was working on I was downloading image data via XHR in a Web Worker and then encoding it into a data: URI. (I say 'was' because I have since stopped doing it in a worker, for separate reasons, but there you go...) I could imagine you might have, for example, a web-based email client which might want to encode a multipart message before sending it, all the background in a worker.
Eric
Comment 3
2012-08-17 15:33:22 PDT
My use case is similar. I'm using GIFEncoder (
https://github.com/antimatter15/jsgif/blob/master/GIFEncoder.js
), in a worker to produce a data URL from of the encoded gif. GIFEncoder implements it's own encode64() method:
https://github.com/antimatter15/jsgif/blob/master/Demos/b64.js
popecode
Comment 4
2013-09-23 21:15:31 PDT
I wrote a frame buffer to handle image downloads from a worker thread. For my application, this is necessary as the main thread is handling a video and an animation and performance is critical. To use the downloaded images in the browser, I first have to convert them via btoa(). Using firefox, I can perform this conversion before passing the data to the main thread. Since chrome does not allow this, Firefox runs significantly faster than Chrome in my case.
Dmitry Chestnykh
Comment 5
2014-12-13 06:13:57 PST
Is there any progress on this? I use atob/btoa for base64 encoding in TweetNaCl-js instead of implementing my own routines, and I'd like them to be available from web workers. FIY, both Firefox and Chrome have them. Thanks!
Mathias Bynens
Comment 6
2014-12-13 09:23:06 PST
@Dmitry, as a workaround you can use a fully `btoa`/`atob`-compatible polyfill like
https://github.com/mathiasbynens/base64
.
Chris Dumez
Comment 7
2016-06-09 15:44:09 PDT
*** This bug has been marked as a duplicate of
bug 158576
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug