Description of the issue:
There is a discrepancy between how Chrome and Brave respond to the extension listed below. The extension creates an alarm, and stores tab details when the alarm expires. Querying the storage reveals that in Chrome tabs exist at the time the alarm expires, but in Brave they do not.
How can this issue be reproduced?
- Create an extension based on the scripts below
- Create a new profile in Brave and in Chrome
- Install the extension in the Brave and Chrome profiles
- close the new profiles but in each browser keep another profile open
- Re-open the closed profiles after more than 60 seconds
- Check in the console to see what was logged
Expected result:
Both browsers should report the same thing regarding the number of tabs
Brave Version( check About Brave
):
Brave: 1.76.81 Chromium: 134.0.6998.166 (Official Build) (64-bit)
Chrome: 134.0.6998.165 (Official Build) (64-bit)
Additional Information:
I’m using Fedora Linux 41.
Screenshot of the consoles showing extension output. Brave is on the left.
manifest.json
{
"manifest_version": 3,
"version": "1.0",
"name": "Check tabs at startup",
"description": "Do tabs exist at startup?",
"permissions": [
"alarms",
"storage",
"tabs"
],
"background": {
"service_worker": "sw.js"
}
}
sw.js
chrome.runtime.onInstalled.addListener(details =>
{
chrome.alarms.create(
"test",
{ delayInMinutes: 1 }
);
});
chrome.alarms.onAlarm.addListener(alarm =>
{
logger();
setTimeout(logger, 1000);
async function logger()
{
chrome.storage.local
.set({ [Date.now()]: await chrome.tabs.query({ }) });
}
});