0.4.10 • Published 2 years ago

@u4/chrome-remote-interface v0.4.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

chrome-CDP

Chrome DevTools Protocol is a generic protocol to debug / control web browser.

import { Devtools } from "@u4/chrome-remote-interface";
/**
 * Sample API usage
 *
 * The following snippet loads https://github.com and dumps every request made for 3 sec:
 */
async function test() {
  const devtools = new Devtools();
  const tab = await devtools.connectFirst("page");
  try {
    await tab.Network.enable();
    await tab.Page.enable();

    tab.Network.on("requestWillBeSent", (params) => {
      console.log("requestedUrl:", params.request.url);
    });

    const loadEventFired = tab.Page.loadEventFired();
    await tab.Page.navigate({ url: "https://github.com" });
    await loadEventFired;
    console.log("loadEventFired");
    await new Promise((r) => setTimeout(r, 3000));
  } catch (e) {
    console.error(e);
  } finally {
    tab.close();
  }
}

void test();

references

0.4.9

2 years ago

0.4.10

2 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.5

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago