Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GaurangTandon opened this issue Feb 9, 2024 · 3 comments
Assignees
Labels
Bug the issue is a code defect that should be fixed Investigating The reported bug or issue is being actively investigated Waiting for more info more information is needed and the reporter was at-mentioned.

Comments

@GaurangTandon
Copy link

GaurangTandon commented Feb 9, 2024

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.

@RanadhirMSFT
Copy link
Collaborator

Hi @GaurangTandon, you are at the right place. Apologies for the delay in acknowledging this.
Does this issue persist while operating on the Edge Browser now?
If it does, could you please share some screenshots of the same?

@sivMSFT sivMSFT added Bug the issue is a code defect that should be fixed Waiting for more info more information is needed and the reporter was at-mentioned. labels Jun 5, 2024
@GaurangTandon
Copy link
Author

Hi @RanadhirMSFT the issue is still happening in Edge 125. See first screenshot. Notice on the last line the promise is pending. This google.com tab in my Edge browser was sleeping (see second screenshot, the tab is faded):

image

image

@RanadhirMSFT
Copy link
Collaborator

Thanks @GaurangTandon for bringing this up. We'll get the right team to address this at the earliest.

@RanadhirMSFT RanadhirMSFT added the Investigating The reported bug or issue is being actively investigated label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug the issue is a code defect that should be fixed Investigating The reported bug or issue is being actively investigated Waiting for more info more information is needed and the reporter was at-mentioned.
Projects
None yet
Development

No branches or pull requests

3 participants