Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/core/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ const useProxyPer = {

// Call this if page object passed
CDPPage: async (page, proxy) => {
if (!page.eventsMap) {
page.eventsMap = new Map();
}
await page.setRequestInterception(true);
const listener = "$ppp_requestListener";
removeRequestListener(page, listener);
Expand All @@ -87,9 +90,9 @@ const useProxyPer = {
}
}

// Main function
const useProxy = async (target, data) => {
if(target.constructor.name == "CdpPage") return useProxyPer.CDPPage(target, data);
useProxyPer[target.constructor.name](target, data);
};

module.exports = useProxy;
module.exports = useProxy;