{"_id":"browser-x","_rev":"2864493","name":"browser-x","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","dist-tags":{"latest":"0.0.1-beta7"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"time":{"modified":"2022-09-14T03:06:57.000Z","created":"2016-04-04T09:41:44.095Z","0.0.1-beta7":"2017-02-13T06:26:25.092Z","0.0.1-beta6":"2016-05-10T04:03:10.561Z","0.0.1-beta5":"2016-04-16T02:25:04.379Z","0.0.1-beta4":"2016-04-14T14:35:01.165Z","0.0.1-beta2":"2016-04-12T12:07:08.594Z","0.0.1-beta1":"2016-04-11T16:22:04.771Z","0.0.1-beta":"2016-04-10T15:41:57.344Z","0.0.1-pre3":"2016-04-10T15:18:47.454Z","0.0.1-pre2":"2016-04-09T09:58:25.553Z","0.0.1-pre1":"2016-04-07T10:24:52.895Z","0.0.1-pre":"2016-04-04T09:41:44.095Z"},"users":{},"author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"versions":{"0.0.1-beta7":{"name":"browser-x","version":"0.0.1-beta7","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","homepage":"https://github.com/aui/browser-x","author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"bugs":{"url":"https://github.com/aui/browser-x/issues"},"main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"46a7be4148ebb276002875b2198d5e5f7842ef61","_id":"browser-x@0.0.1-beta7","_shasum":"7434850d36e9809f19e3721033aa4104f728a188","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"dist":{"shasum":"7434850d36e9809f19e3721033aa4104f728a188","size":17489,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta7.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta7.tgz"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta7.tgz_1486967184860_0.7392052644863725"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:07.197Z","publish_time":1486967185092,"_cnpm_publish_time":1486967185092},"0.0.1-beta6":{"name":"browser-x","version":"0.0.1-beta6","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","homepage":"https://github.com/aui/browser-x","author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"bugs":{"url":"https://github.com/aui/browser-x/issues"},"main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"ecac7c46565f32bdc6247d4cf0c3186ff25e3f57","_id":"browser-x@0.0.1-beta6","_shasum":"dd8edc5185244768571b5cff7d93fc408c99cae9","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"dd8edc5185244768571b5cff7d93fc408c99cae9","size":17488,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta6.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta6.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta6.tgz_1462852987992_0.04230601922608912"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:07.107Z","publish_time":1462852990561,"_cnpm_publish_time":1462852990561},"0.0.1-beta5":{"name":"browser-x","version":"0.0.1-beta5","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","homepage":"https://github.com/aui/browser-x","author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"bugs":{"url":"https://github.com/aui/browser-x/issues"},"main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"ba539f46e1280560d6d9ff21709f73ecfbcfde23","_id":"browser-x@0.0.1-beta5","_shasum":"3be723de0c1e9112fb08e5379ba7726283b6b5cd","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"3be723de0c1e9112fb08e5379ba7726283b6b5cd","size":17094,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta5.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta5.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta5.tgz_1460773502397_0.12822026759386063"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:06.178Z","publish_time":1460773504379,"_cnpm_publish_time":1460773504379},"0.0.1-beta4":{"name":"browser-x","version":"0.0.1-beta4","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","homepage":"https://github.com/aui/browser-x","author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"bugs":{"url":"https://github.com/aui/browser-x/issues"},"main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"1c11f9e8a4f219c23fb39008f002b1d9989291f0","_id":"browser-x@0.0.1-beta4","_shasum":"bf1b8f5b38d1d26817a91a419fb1176742516103","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"bf1b8f5b38d1d26817a91a419fb1176742516103","size":17053,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta4.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta4.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta4.tgz_1460644500701_0.39076300617307425"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:05.299Z","publish_time":1460644501165,"_cnpm_publish_time":1460644501165},"0.0.1-beta2":{"name":"browser-x","version":"0.0.1-beta2","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","homepage":"https://github.com/aui/browser-x","author":{"name":"aui","email":"sugarpie.tang@gmail.com"},"repository":{"type":"git","url":"git://github.com/aui/browser-x.git"},"bugs":{"url":"https://github.com/aui/browser-x/issues"},"main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"0e06ce94287bdd2068cb7e7b0add589ea2ca8f48","_id":"browser-x@0.0.1-beta2","_shasum":"85944b857ed70924895b83399e52d34cd1724bfc","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"85944b857ed70924895b83399e52d34cd1724bfc","size":16693,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta2.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta2.tgz_1460462825788_0.5559029693249613"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:04.250Z","publish_time":1460462828594,"_cnpm_publish_time":1460462828594},"0.0.1-beta1":{"name":"browser-x","version":"0.0.1-beta1","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"79747cca7a8969426dd1af98ebeee0d90875be03","_id":"browser-x@0.0.1-beta1","_shasum":"ad676846ac1f48d2ebfca32de50774e4f8c57045","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"ad676846ac1f48d2ebfca32de50774e4f8c57045","size":16543,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta1.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta1.tgz_1460391723524_0.0926281928550452"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:03.360Z","publish_time":1460391724771,"_cnpm_publish_time":1460391724771},"0.0.1-beta":{"name":"browser-x","version":"0.0.1-beta","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"engines":{"node":">= 4.0.0"},"license":"MIT","gitHead":"07b4ea3acb3da1e5dfa32d0a0cded26adeac6b7a","_id":"browser-x@0.0.1-beta","_shasum":"095ceb992d773afe1638ffa0dfa2d672bd6e6dff","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"095ceb992d773afe1638ffa0dfa2d672bd6e6dff","size":16442,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-beta.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-beta.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-beta.tgz_1460302914835_0.1820577427279204"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:02.494Z","publish_time":1460302917344,"_cnpm_publish_time":1460302917344},"0.0.1-pre3":{"name":"browser-x","version":"0.0.1-pre3","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"license":"MIT","gitHead":"07b4ea3acb3da1e5dfa32d0a0cded26adeac6b7a","_id":"browser-x@0.0.1-pre3","_shasum":"b022fc0c8bcb1b6b4cb49e8c0152aa96db779a5b","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"b022fc0c8bcb1b6b4cb49e8c0152aa96db779a5b","size":16419,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-pre3.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-pre3.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-pre3.tgz_1460301525096_0.2761040071491152"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:01.625Z","publish_time":1460301527454,"_cnpm_publish_time":1460301527454},"0.0.1-pre2":{"name":"browser-x","version":"0.0.1-pre2","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider","style","getComputedStyle"],"license":"MIT","gitHead":"d22e7c22e1ea6aeca4a87512376ce009ddb7cc46","_id":"browser-x@0.0.1-pre2","_shasum":"f2adb9af169029f0e585e1ca9d95447c100dcccc","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"f2adb9af169029f0e585e1ca9d95447c100dcccc","size":16487,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-pre2.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-pre2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-pre2.tgz_1460195904574_0.7379612459335476"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:58:00.759Z","publish_time":1460195905553,"_cnpm_publish_time":1460195905553},"0.0.1-pre1":{"name":"browser-x","version":"0.0.1-pre1","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider"],"gitHead":"e2ef370c2cfdc5513016d6d51551776dc32174ad","_id":"browser-x@0.0.1-pre1","_shasum":"af9920039203b9c6c4021b9fb998dc4e1a14b54b","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"af9920039203b9c6c4021b9fb998dc4e1a14b54b","size":15897,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-pre1.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-pre1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-pre1.tgz_1460024692422_0.4649901937227696"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:57:59.897Z","publish_time":1460024692895,"_cnpm_publish_time":1460024692895},"0.0.1-pre":{"name":"browser-x","version":"0.0.1-pre","description":"A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.","main":"index.js","dependencies":{"css-mediaquery":"^0.1.2","cssom":"^0.3.1","cssstyle":"^0.2.34","nwmatcher":"^1.3.7","parse5":"^2.1.5","specificity":"^0.1.5","verror":"^1.6.1"},"scripts":{"debug":"node-inspector test/debug.js","test":"mocha ./test/index"},"keywords":["dom","browser","cssom","css","css3","selector","spider"],"gitHead":"304bbc893d96deca72b2f95ea4760b3512e52069","_id":"browser-x@0.0.1-pre","_shasum":"f9ca038cebf11f3223c78f79b7005f1a93a4b76b","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"aui","email":"1987.tangbin@gmail.com"},"maintainers":[{"name":"aui","email":"1987.tangbin@gmail.com"}],"dist":{"shasum":"f9ca038cebf11f3223c78f79b7005f1a93a4b76b","size":15798,"noattachment":false,"key":"/browser-x/-/browser-x-0.0.1-pre.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-x/download/browser-x-0.0.1-pre.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/browser-x-0.0.1-pre.tgz_1459762903582_0.7486053265165538"},"directories":{},"_cnpmcore_publish_time":"2021-12-20T01:57:59.020Z","publish_time":1459762904095,"_cnpm_publish_time":1459762904095}},"readme":"# BrowserX\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-ci-image]][travis-ci-url]\n\nBrowserX 是一个基于 NodeJS 实现的虚拟浏览器，它的目标是高效的实现 DOM 中最核心的特性，以便开发者能够在 NodeJS 中使用 W3C 标准方法来操作文档与样式。\n\n* 提供 DOM 核心核心\n* 完整支持 CSS3 选择器来查询节点\n* 支持样式解析，如 `element.style`、`document.styleSheets`、`window.getComputedStyle()` 以及 CSSOM 相关构造器访问\n\n## 安装\n\n``` shell\nnpm install browser-x\n```\n\n## 接口\n\n### browser(options, callback)\n\n返回：`Promise`\n\n``` javascript\nvar browser = require('browser-x');\n\nvar url = __dirname + '/debug.html';\nbrowser({\n    url: url,\n    loadCssFile: true,\n    silent: false\n}, function (errors, window) {\n    if (errors) {\n        throw errors;\n    }\n    var document = window.document;\n    var element = document.querySelector('#banner h2');\n    var fontFamily = window.getComputedStyle(element, '::after').fontFamily;\n    console.log(fontFamily);\n});\n```\n\n## options\n\n``` javascript\n{\n    /**\n     * 文件基础路径 - 支持本地或远程地址\n     */\n    url: 'about:blank',\n\n    /*\n     * HTML 文本内容\n     */\n    html: null,\n\n    /**\n     * 是否支持加载外部 CSS 文件\n     */\n    loadCssFile: false,\n\n    /**\n     * 是否忽略内部解析错误-关闭它有利于开发调试\n     * @type    {Boolean}\n     */\n    silent: true,\n\n    /**\n     * 请求超时限制\n     * @type    {Number}    毫秒\n     */\n    resourceTimeout: 8000,\n\n    /**\n     * 最大的文件加载数量限制\n     * @type    {Number}    数量\n     */\n    resourceMaxNumber: 64,\n\n    /**\n     * 是否缓存请求成功的资源\n     * @return  {Object}\n     */\n    resourceCache: true,\n\n    /**\n     * 映射资源路径\n     * @param   {String}    旧文件地址\n     * @return  {String}    新文件地址\n     */\n    resourceMap: function(file) {\n        return file;\n    },\n\n    /**\n     * 忽略资源\n     * @param   {String}    文件地址\n     * @return  {Boolean}   如果返回`true`则忽略当当前文件的加载\n     */\n    resourceIgnore: function(file) {\n        return false;\n    },\n\n    /**\n     * 资源加载前的事件\n     * @param   {String}    文件地址\n     */\n    resourceBeforeLoad: function(file) {\n    },\n\n    /**\n     * 加载远程资源的自定义请求头\n     * @param   {String}    文件地址\n     * @return  {Object}\n     */\n    resourceRequestHeaders: function(file) {\n        return {\n            'accept-encoding': 'gzip,deflate'\n        };\n    }\n}\n```\n\n## 支持的 DOM API\n\n* Window\n    - [getComputedStyle()](https://developer.mozilla.org/zh-CN/docs/Web/API/Window/getComputedStyle)\n    - [CSSStyleDeclaration()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleDeclaration)\n    - [CSSRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSRule)\n    - [CSSStyleRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleRule)\n    - [MediaList()](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaList)\n    - [CSSMediaRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSMediaRule)\n    - [CSSImportRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSImportRule)\n    - [CSSFontFaceRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSFontFaceRule)\n    - [StyleSheet()](https://developer.mozilla.org/zh-CN/docs/Web/API/StyleSheet)\n    - [CSSStyleSheet()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleSheet)\n    - [CSSKeyframesRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSKeyframesRule)\n    - [CSSKeyframeRule()](https://developer.mozilla.org/zh-CN/docs/Web/API/CSSKeyframeRule)\n* Document\n    - [URL](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/URL)\n    - [documentElement](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/documentElement)\n    - [head](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/head)\n    - [body](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/body)\n    - [title](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/title)\n    - [styleSheets](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/styleSheets)\n    - [getElementsByTagName()](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/getElementsByTagName)\n    - [getElementById()](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/getElementById)\n    - [querySelector()](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/querySelector)\n    - [querySelectorAll()](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/querySelectorAll)\n* Element\n    - [id](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/id)\n    - [tagName](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/tagName)\n    - [className](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/className)\n    - [innerHTML](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/innerHTML)\n    - [outerHTML](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/outerHTML)\n    - [attributes](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.attributes)\n    - [hasAttribute()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/hasAttribute)\n    - [getAttribute()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getAttribute)\n    - [querySelector()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/querySelector)\n    - [querySelectorAll()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/querySelectorAll)\n    - [getElementsByTagName()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getElementsByTagName)\n    - [matches()](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/matches)\n* HTMLElement\n    - [style](https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLElement/style)\n* Node\n    - [nodeName](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.nodeName)\n    - [nodeType](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.nodeType)\n    - [childNodes](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.childNodes)\n    - [parentNode](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.parentNode)\n    - [firstChild](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.firstChild)\n    - [lastChild](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.lastChild)\n    - [nextSibling](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.nextSibling)\n    - [previousSibling](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.previousSibling)\n    - [textContent](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.textContent)\n    - [baseURI](https://developer.mozilla.org/zh-CN/docs/Web/API/Node.baseURI)\n\n## 注意事项\n\n1. 不支持 XML 文档解析 \n2. 所有的 DOM 属性均为只读（*计划在未来版本支持写入*）\n3. window.getComputedStyle() 仅能获取元素或伪元素在 CSS 中定义的原始值或继承属性，但没有进行计算输出（例如 em \\> px）\n4. document.styleSheets 在浏览器中无法跨域访问 CSSOM，BrowserX 没有做此限制（外部样式需要打开 `loadCssFile` 选项）\n5. 不支持浏览器怪异模式\n\n## 为什么使用 BrowserX\n\nBrowserX 适合做这些事情：\n\n1. 高效的爬虫程序，使用 CSS 选择器来收集内容\n2. 分析元素的样式使用情况，例如和 CSS 相关的开发工具\n\n例如：WebFont 压缩工具——[font-spider](https://github.com/aui/font-spider)\n\n如果需要更多的 DOM 特性，例如跑基于 DOM 的测试脚本、甚至载入 jQuery 等，那么 [jsdom](https://github.com/tmpvar/jsdom) 这个项目可能会更适合你（注意：它没有完整解析样式表）。\n\n\n[npm-image]: https://img.shields.io/npm/v/browser-x.svg\n[npm-url]: https://npmjs.org/package/browser-x\n[node-version-image]: https://img.shields.io/node/v/browser-x.svg\n[node-version-url]: http://nodejs.org/download/\n[downloads-image]: https://img.shields.io/npm/dm/browser-x.svg\n[downloads-url]: https://npmjs.org/package/browser-x\n[travis-ci-image]: https://travis-ci.org/aui/browser-x.svg?branch=master\n[travis-ci-url]: https://travis-ci.org/aui/browser-x","_attachments":{},"homepage":"https://github.com/aui/browser-x","bugs":{"url":"https://github.com/aui/browser-x/issues"},"license":"MIT"}