-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Describe the bug
While testing the build, a discrepancy was found between the domain count displayed in the Page Resource Table (PRT) and the domain count shown in the Script Blocking tab.
To Reproduce
Steps to reproduce the behavior:
- Using the v1.2 build
- Open chrome with the ip protection flags
- Open the Devtools UI, then go to PSAT.
- Enable CDP if its not enabled.
- Then go to domain-aaa.com/prt-script-blocking
- In PSAT go to IP Protection
- Under Observability group go to site notice the domain count, then check the domain count for Script Blocking.
- There will be domain count difference.
Expected behavior
Count of domains should match the count of domains in script blocking tab.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS
- Browser: Chrome 141.0.7390.67
- Version: 1.2
Additional context
Debugging revealed that the counts differ because the Chrome Debugger Protocol (CDP) listener (chrome.debugger.onEvent.addListener) is intermittently failing to capture all network events. Specifically, some network requests are only registering the Network.responseReceived event and are missing the corresponding Network.requestWillBeSent event. This incomplete event data prevents the requests from being correctly processed and counted by the PRT logic, leading to the count mismatch.
Patch Fix
To correct the PRT domain count and provide accurate data to the user until the underlying CDP event loss issue is resolved, a temporary fallback mechanism is proposed:
- Trigger Condition: This solution will only be activated if the domain counts in the Script Blocking tab and the PRT are unequal.
- Data Acquisition: Utilize the
chrome.devtools.network.getHARAPI within the PSAT UI to retrieve the complete HAR log for the page, which contains all request and response entries. - Data Processing: The HAR data will be sent to the Service Worker for processing. The Service Worker will then use this complete data to recalculate and generate the corrected PRT domain data.
- Display: The corrected data will be sent back to the DevTools UI and used to update the PRT, resolving the immediate count discrepancy.
Patch fix will be added till the original issue is rectified and fixed.
Related chromium issue 451460569