0.4.10 • Published 1 year ago

@u4/chrome-remote-interface v0.4.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.4.10

1 year ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.5

2 years ago

0.4.6

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.5

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.3

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago