Hi Chrome Developer Community,
I'm working on an email tracking extension for Gmail, utilizing the
chrome.declarativeNetRequest API. Our extension aims to block certain network requests when users open emails, ensuring these opens aren't counted by our tracking system.
We employ both Dynamic and Static Rules for this purpose. The Static Rules are a fallback to handle scenarios where the JavaScript might not be loaded.
However, we've encountered a recurring issue reported by several users. After Chrome has been open for an extended period, it appears that our blocking rules stop functioning, and the requests that should be blocked are getting sent.
Here are some specific details:
- Rule Example: { id: 2, priority: 1, action: { type: "block" }, condition: { urlFilter: "*pixel*user=" + user.id + "&end=1*", resourceTypes: ["image"] } }
- Issue Observation: The rule works as expected initially but fails after Chrome has been active for a long time.
- Configuration: We're using a mix of Dynamic and Static Rules, with the latter as a backup.
I'm looking for insights or suggestions on the following:
- Are there known issues with chrome.declarativeNetRequest in relation to browser uptime?
- Could this be related to rule limits, caching, or service worker interactions?
- Any best practices or troubleshooting steps recommended for such a scenario?
Any assistance or guidance would be greatly appreciated.
Thanks in advance!
Tom