从Javascript访问Chrome的内部gzip例程 [英] Access Chrome's internal gzip routine from Javascript

查看:301
本文介绍了从Javascript访问Chrome的内部gzip例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有现代浏览器都包含gzip例程,用于与服务器交换压缩数据。任何人都可以指出我写正确的方向写一个Chrome扩展,这将允许Javascript来利用这个例程吗?



我想在JavaScript中压缩一些数据,然后发送给服务器通过WebSocket和Chrome内置的deflate例程肯定会比我能用Javascript编写的任何东西都快。

基于 基于在堆栈溢出问题的这个答案上,手动将gzip应用于WebSocket是完全没有必要的。从版本19开始,当服务器支持它时,Chrome显然会自动压缩WebSocket流量。


All modern browsers include gzip routines for exchanging compressed data with servers. Can anyone point me in the right direction for writing a Chrome extension that would allow Javascript to leverage this routine?

I would like to compress some data in Javascript before sending it to the server over a WebSocket, and Chrome's built in deflate routine would certainly be faster than anything I could write in Javascript.

解决方案

Based on this answer to a Stack Overflow question, manually applying gzip to a WebSocket is completely unnecessary. As of version 19, Chrome will apparently compress WebSocket traffic automatically when the server supports it.

这篇关于从Javascript访问Chrome的内部gzip例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆