Skip to content

Instantly share code, notes, and snippets.

View mohummedalee's full-sized avatar

Ali mohummedalee

View GitHub Profile
@mohummedalee
mohummedalee / setup-cdp-ws.js
Created January 4, 2019 23:09
Pulling out the web-socket URL of a Chrome Debugging Protocol run – can be used to connect other services (e.g. Puppeteer) to CDP
const request = require('request');
// Assuming CDP is running on localhost
Browser.prototype.setupWSURL = async function() {
let that = this;
let url = `http://localhost:${this.port}/json/version`;
request(url,
function(err, resp, body) {
if (!err) {
that.webSocketDebuggerUrl = JSON.parse(body).webSocketDebuggerUrl;

Keybase proof

I hereby claim:

  • I am mohummedalee on github.
  • I am muhammadali (https://keybase.io/muhammadali) on keybase.
  • I have a public key ASAPdjf-Oh5L0BNa2k5SF-Nm9QImqQVMZ5Rq3T3my1Jt2Ao

To claim this, I am signing this object: