Open Bug 1653876 Opened 5 years ago Updated 5 months ago

tabs API stuck on discarded tabs - promiseTabWhenReady should not wait for discarded tabs

Categories

(WebExtensions :: General, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

STR:

  1. Load attached extension (either at about:debugging, or on Nightly with xpinstall.signatures.required = false at about:config).
  2. Open the global JS console with "Show Content Messages" enabled (or look at the extension's background page's console)
  3. Click on the extension button.
  4. Look at the console from step 2. It contains some messages including "Awaiting detectLanguage"

Expected:

  • After "Awaiting detectLanguage", there should either be a message:
    • "detectLanguage result(...) = ...".
    • or an error indicating that the (discarded) tab is not available.

Actual:

  • After "Awaiting detectLanguage", there is no more message.
  • Even when I click on the tab (which loads the content), the tabs.detectLanguage call doesn't resolve. This means that the promise is stuck forever.

It's getting stuck in the promiseTabWhenReady function (which is also used by many other tabs methods): https://searchfox.org/mozilla-central/rev/b2395478c6adf6e5b241be1610fb1d920ed995ed/browser/components/extensions/parent/ext-tabs.js#513-529
(similar logic also exists on Android)

I found this while reducing the test case from https://bugzilla.mozilla.org/show_bug.cgi?id=1652925#c18.

Although this bug is entirely different from bug 1499667, I'm still linking the two since the other bug's title is a way to describe this bug to users.

Bug 1640192 is definitely (partially) caused by this bug.

Blocks: 1652925, 1640192
See Also: → 1499667
Assignee: nobody → rob
Severity: -- → S2
Priority: -- → P1

Unassigned and changed to P2/S3, same as Bug 1640192.

Assignee: rob → nobody
Severity: S2 → S3
Priority: P1 → P2
Whiteboard: [addons-jira]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: