tabs.onUpdated does not fire for title changes
Categories
(WebExtensions :: Android, defect)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned)
Details
STR:
- Start Firefox for Android, install any extension with the
tabs
permission (either viaweb-ext
or via the add-ons manager, such as uBlock Origin). - Visit example.com in a tab.
- Visit
about:debugging
on desktop and connect to the phone. - Inspect the extension (which opens a debugger in a new tab), and add
browser.tabs.onUpdated.addListener(console.log);
- Inspect the example.com tab (via
about:debugging
, which opens another debugger) and rundocument.title += "1";
- 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 )
Reporter | ||
Comment 1•4 years ago
|
||
https://phabricator.services.mozilla.com/D98471 implements my suggestion above to fix the bug.
Description
•