Chrome DevTools 协议 API 如何与 Puppeteer 配合使用?

问题描述

  1. Chrome DevTools Protocol APIs 是开源的吗?我正在尝试找出源代码以深入了解某些 API 的工作原理。

  2. 当我们尝试使用 Puppeteer 调用这些 API 时,幕后到底发生了什么? 这就是我们如何使用它们 -
    const containerRef = useRef<HTMLdivelement>(null); useEffect({ // useEffect would run just in client-side const rootContainer = document.createElement("div"); const parentElem = document.querySelector("#__next"); parentElem?.insertAdjacentElement("afterend",rootContainer); // parentElem?.after(rootContainer) this gives me same issue containerRef.current = rootContainer; },[]) useEffect({ // Will be execute once when containerRef is bind to <HTMLdivelement> if(containerRef.current) { ReactDOM.createPortal( <div className={["backdrop",props.open ? "open" : ""].join(" ")} onClick={props.onClick} />,containerRef.current ) } },[containerRef]) return null;
    我想了解这个接口(page._client.send)是如何工作的。它是否也使用互联网带宽发出请求,还是完全脱机工作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)