微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。