Closed Bug 1686443 Opened 3 years ago Closed 3 years ago

tabs.onUpdated does not fire for title changes

Categories

(WebExtensions :: Android, defect)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1679688

People

(Reporter: robwu, Unassigned)

Details

STR:

  1. Start Firefox for Android, install any extension with the tabs permission (either via web-ext or via the add-ons manager, such as uBlock Origin).
  2. Visit example.com in a tab.
  3. Visit about:debugging on desktop and connect to the phone.
  4. Inspect the extension (which opens a debugger in a new tab), and add browser.tabs.onUpdated.addListener(console.log);
  5. Inspect the example.com tab (via about:debugging, which opens another debugger) and run document.title += "1";
  6. Go back to tab 4 and look at the console.

Expected:

  • An event with { title: "Example Domain1" }

Actual:

  • The event is missing.

To fix this, I think that DOMTitleChanged here should be replaced with pagetitlechanged, three times in https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/mobile/android/components/extensions/ext-tabs.js#259,302,305

( The windowTracker.addListener call there goes through https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/toolkit/components/extensions/parent/ext-tabs-base.js#1753,1773 and ultimately ends up at https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/toolkit/components/extensions/parent/ext-tabs-base.js#1832,1838 to call window.addEventListener(...) )

( The pagetitlechanged event is also used by GeckoView to maintain the visible tab title: https://hg.mozilla.org/mozilla-central/rev/1814c80616f0 )

https://phabricator.services.mozilla.com/D98471 implements my suggestion above to fix the bug.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.