How does Metamask persist the background script?

Hi all! I wanted to ask how does MetaMask persist the service worker? I mean, with manifest v3 now service workers should go inactive after 5 minutes of inactivity, but how does MetaMask prevent this from happening? Thanks :slight_smile:

If anyone has the same question, after reading the extension code, I found that they use a “keepAlive” function which the content script executes every 1 second, for 45 minutes. This way, if there is any active tab, it will keep reviving the service worker. Cheers!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.