Fix the webdists, this fixes #170.

Particular problems and how they were resolved:
 - The `fs-extra` module, used exclusively by TokenCacher, didn't have a browser version. I rewrote TokenCacher to not use fs-extra (see fdd4cfc7cc)
 - TokenCacher wouldn't work in the browser anyway due to lack of a file system. I made a shim (`Util/TokenCacher-shim.js`) that implements all TokenCacher functionality as null implementations, this causes `login` to always make a request.
 - Compressed packets couldn't be parsed because neither node's Buffers nor zlib were working correctly. Initially I tried to make a browser-only parser class that parses compressed `Blob` packets, but this didn't work out, so I just disabled compression by default.
This commit is contained in:
meew0
2016-01-30 14:17:27 +01:00
parent 151b98e0a2
commit 634a5bd737
5 changed files with 54 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ var Client = (function (_EventEmitter) {
_EventEmitter.call(this);
this.options = options || {};
this.options.compress = options.compress || true;
this.options.compress = options.compress || !process.browser;
this.options.revive = options.revive || false;
this.options.rate_limit_as_error = options.rate_limit_as_error || false;
this.internal = new _InternalClient2["default"](this);