microsoft / microsoft/MicrosoftEdge-Extensions
Critical bug in chrome.tabs.sendMessage for a "Sleeping" tab in Edge browser
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 245
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I don't know where to report this because this issue is specific to the Edge browser (Chrome doesn't have a Sleeping tabs feature - and it's Memory Saver feature works correctly).
Steps to reproduce issue:
- Enable "Sleeping tabs" setting in Edge settings
- Wait for a tab to go to sleep
- Open your Manifest V3 extension's Service Worker console
- Run
await chrome.tabs.query({})to get all open tabs - Get the tabId of the sleeping tab
- Run
chrome.tabs.sendMessage(tabId, { type: 'check', }, { frameId: 0 }).then(x => console.log('responded', x)).catch(x => console.log('errored', x))
Expected result: promise resolves/rejects with an error message like "Receiving end does not exist".
Actual result: promise remains in pending state until the tab is woken up from sleep.
Request: I think this is a bug and we should fix this, but at the very least, there should be a property on the Tab object indicating that this tab is sleeping (so the extension doesn't bother messaging the tab). On Chrome, the discarded property is set to true for a tab that is crashed by the Memory Saver.
This seems to be a Edge specific issue in Extension APIs. Please let me know what is the appropriate forum to report this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.