mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
9c4b6d06e2
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 |
||
---|---|---|
.. | ||
.eslintrc.js | ||
Browser.js | ||
BrowserFetcher.js | ||
Connection.js | ||
Coverage.js | ||
Dialog.js | ||
EmulationManager.js | ||
Errors.js | ||
ExecutionContext.js | ||
externs.d.ts | ||
FrameManager.js | ||
helper.js | ||
Input.js | ||
Launcher.js | ||
Multimap.js | ||
NavigatorWatcher.js | ||
NetworkManager.js | ||
Page.js | ||
PipeTransport.js | ||
Puppeteer.js | ||
Target.js | ||
TaskQueue.js | ||
Tracing.js | ||
USKeyboardLayout.js | ||
WebSocketTransport.js | ||
Worker.js |