puppeteer/lib
Andrey Lushnikov 9c4b6d06e2
refactor: use browser-compliant interface of 'ws' (#3218)
Bundled version of Puppeteer should rely on native WebSocket.

Luckily, 'ws' module supports the same interface as the native
browser websockets. This patch switches WebSocketTransport to
use the browser-compliant interface of 'ws'.

After this patch, I was able to bundle Puppeteer for browser
using the following config in `package.json`:

```json
"browser": {
  "./lib/BrowserFetcher.js": false,
  "ws": "./lib/BrowserWebSocket",
  "fs": false,
  "child_process": false,
  "rimraf": false,
  "readline": false
}
```

where `./lib/BrowserWebSocket` is:

```js
module.exports = WebSocket;
```

and the bundling command is:

```sh
$ browserify -r ./index.js:puppeteer > ppweb.js
```

References #2119
2018-09-11 18:41:28 +01:00
..
.eslintrc.js Introduce Eslint to validate style 2017-06-11 01:32:59 -07:00
Browser.js feat(browsercontext): implement BrowserContext.overridePermissions (#3159) 2018-08-30 23:36:09 +01:00
BrowserFetcher.js refactor: avoid dynamic requires in lib/ folder (#3208) 2018-09-06 20:33:41 +01:00
Connection.js refactor: move Connection to use ConnectionTransport (#3217) 2018-09-07 21:36:16 +01:00
Coverage.js fix(coverage): report anonymous scripts with debugger:// urls (#2875) 2018-07-11 21:05:16 -07:00
Dialog.js chore: upgrade to TypeScript 3.0.1 (#3024) 2018-08-06 11:31:33 -07:00
EmulationManager.js chore: upgrade to TypeScript 3.0.1 (#3024) 2018-08-06 11:31:33 -07:00
Errors.js feat: introduce puppeteer/Errors (#3056) 2018-08-09 16:51:12 -07:00
ExecutionContext.js fix: fix null-type bugs (#3137) 2018-08-24 15:17:36 -07:00
externs.d.ts refactor: move Connection to use ConnectionTransport (#3217) 2018-09-07 21:36:16 +01:00
FrameManager.js fix: fix null-type bugs (#3137) 2018-08-24 15:17:36 -07:00
helper.js refactor: avoid dynamic requires in lib/ folder (#3208) 2018-09-06 20:33:41 +01:00
Input.js fix: fix null-type bugs (#3137) 2018-08-24 15:17:36 -07:00
Launcher.js refactor: move Connection to use ConnectionTransport (#3217) 2018-09-07 21:36:16 +01:00
Multimap.js chore: upgrade to TypeScript 3.0.1 (#3024) 2018-08-06 11:31:33 -07:00
NavigatorWatcher.js fix(page): Page.goto should properly handle historyAPI in beforeunload (#3198) 2018-09-05 22:59:29 +01:00
NetworkManager.js feat(network): introduce Response.statusText() (#3193) 2018-09-05 21:03:24 +01:00
Page.js fix(page): Page.goto should properly handle historyAPI in beforeunload (#3198) 2018-09-05 22:59:29 +01:00
PipeTransport.js refactor: move Connection to use ConnectionTransport (#3217) 2018-09-07 21:36:16 +01:00
Puppeteer.js refactor: avoid dynamic requires in lib/ folder (#3208) 2018-09-06 20:33:41 +01:00
Target.js fix: fix null-type bugs (#3137) 2018-08-24 15:17:36 -07:00
TaskQueue.js chore: upgrade to TypeScript 3.0.1 (#3024) 2018-08-06 11:31:33 -07:00
Tracing.js Revert "chore(tests): redirect debugError to the output category of tests (#2969)" (#2987) 2018-07-30 16:41:39 -07:00
USKeyboardLayout.js feat(keyboard): Accept codes (#1116) 2017-10-23 12:43:45 -07:00
WebSocketTransport.js refactor: use browser-compliant interface of 'ws' (#3218) 2018-09-11 18:41:28 +01:00
Worker.js refactor: drop object factory from execution context (#3099) 2018-08-16 16:16:27 -07:00