DEV Community

岚多多
岚多多

Posted on

The Manifest V3 bug that passes your tests and breaks for users

Here is a background script for a Chrome extension. It counts requests and logs the total every few seconds.

// background.js
let requestCount = 0;
chrome.webRequest.onBeforeRequest.addListener(() => { requestCount++; });
setInterval(() => { console.log(`seen ${requestCount} requests`); }, 5000);
Enter fullscreen mode Exit fullscreen mode

It works. You load the extension, browse a few pages, watch the count climb, ship it. A week later users report the log stopped and the count is stuck at 0. Nothing in your code changed.

Top comments (0)