You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions
Hi, I'm trying to capture when tabs are auto discarded. I'm reading through the docs but don't see an event that covers it. I'm using chrome.tabs.onUpdated, but it doesn't seem to fire when it happens.
Can anyone recommend how to handle these?
kg_17
unread,
Jun 22, 2024, 8:28:05 PM (6 days ago) Jun 22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Nathan Pierce
The id of a tab changes immediately after it gets discarded, so you can listen to chrome.tabs.onReplaced. Then chrome.tabs.onUpdated will fire right after that with the new tabId (changeInfo.discarded will be true). That is at least what happens when chrome.tabs.discard is run on a tab. I assume the behavior is the same when Chrome auto discards a tab, but I'm not positive.
Nathan Pierce
unread,
Jun 23, 2024, 2:19:16 PM (6 days ago) Jun 23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, kg_17, Nathan Pierce
Aha! I realized I had some code breaking my onReplaced listener. Got it :) Thanks kg_17