修复浏览器控制网络被阻塞的BUG

This commit is contained in:
fofolee
2025-02-17 00:06:08 +08:00
parent bf1d6ff007
commit 49fdd973c1
4 changed files with 58 additions and 5 deletions

View File

@@ -9,12 +9,11 @@ const initCDP = async (targetId) => {
port,
});
const { Page, Runtime, Target, Network, Emulation, DOM, Fetch } = client;
const { Page, Runtime, Target, Network, Emulation, DOM } = client;
await Promise.all([
Page.enable(),
Runtime.enable(),
DOM.enable(),
Fetch.enable(),
]);
return {
@@ -25,7 +24,6 @@ const initCDP = async (targetId) => {
Network,
Emulation,
DOM,
Fetch,
};
} catch (err) {
console.log(err);