microsoft / microsoft/MicrosoftEdge-Extensions

Critical bug in chrome.tabs.sendMessage for a "Sleeping" tab in Edge browser

Open
#134 8 comments 2 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

API Bug Edge Addons Tracked
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:

  1. Enable "Sleeping tabs" setting in Edge settings
  2. Wait for a tab to go to sleep
  3. Open your Manifest V3 extension's Service Worker console
  4. Run await chrome.tabs.query({}) to get all open tabs
  5. Get the tabId of the sleeping tab
  6. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.