Closed Bug 1390090 Opened 7 years ago Closed 7 years ago

browserAction.onClicked not fired after disabling and enabling an add-on on Android

Categories

(WebExtensions :: Android, defect)

56 Branch
Unspecified
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1375857

People

(Reporter: robwu, Unassigned)

References

Details

Browser version: Firefox Beta on Android (version 55, appBuildId=20170807232150). STR: 1. Install an add-on that has a browser_action and registers a browserAction.onClicked. 2. Tap on the three dots to open the menu, swipe to the bottom and tap on the extension's menu item. 3. Go to Menu > Addons and disable the add-on. 4. Re-enable the add-on. 5. Repeat step 2. Expected result: - After step 2 and step 5, the extension's browserAction.onClicked listener should be triggered. Actual result: - After step 5, the extension's browserAction.onClicked is not triggered. Additional information: - The only sure way to work around the bug is to quit and start the browser after enabling an add-on. - The problem seems to be in the interaction between BrowserActions.jsm and Java, as demonstrated as follows: 1. Open WebIDE and connect to Firefox on Android 2. Select the browser process, and add logging to the browserAction.onClicked source in BrowserActions.jsm, by running the next code in the console: originalOnEvent = Cu.import('resource://gre/modules/BrowserActions.jsm',{}).BrowserActions.onEvent; Cu.import('resource://gre/modules/BrowserActions.jsm',{}).BrowserActions.onEvent = function() { console.log('Triggered BrowserActions.onEvent', ...arguments); return originalOnEvent.apply(this, arguments); } 3. Follow the above steps to reproduce, and notice that the event is logged after step 3, but not after step 5. 4. To rule out other causes: If I manually trigger the BrowserAction.onClicked, then the extension's browserAction.onClicked event is triggered, as expected (note: teplace the zero in "[0]" with the index of the addon that you're testing with): Object.values(Cu.import('resource://gre/modules/BrowserActions.jsm',{}).BrowserActions._browserActions)[0].onClicked()
See Also: → 1390099
Typo: I tested with version 56 (build 20170807232150), not version 55.
Hi Rob, I'm unable to reproduce this on Nightly, I suspect that it could be related to Bug 1375857 and Bug 1387026, which have been fixed in Nightly and recently uplifted on beta. Do you mind trying to reproduce it again on a Firefox for Android 56 beta version which includes these uplifted fixes? If we are unable to reproduce it on the 56 Beta version which includes the above uplifts, I'm going to close this as a duplicate, otherwise if you are still able to reproduce it on 56 beta and/or on Nightly, I'm going to dig deeper into this.
Flags: needinfo?(rob)
Version: 55 Branch → 56 Branch
I can confirm that the issue does not exist on Nightly. bug 1387026 is unrelated, but bug 1375857 is the culprit. When I use WebIDE to register the following listener, then I see that it is triggered when the menu item is tapped. EventDispatcher.instance.registerListener({ onEvent: console.log }, 'Menu:Clicked'); So it seems that once the menu has been opened, any menu items added by extensions using the WebExtension API will not respond to tapping. That seems like a serious usability issue, can the fix for bug 1375857 be uplifted to stable too?
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(rob)
Resolution: --- → DUPLICATE
Thanks Rob for confirming it, Bug 1375857 was my guess too. Bug 1375857's uplifted request has been approved and it has been landed on 56 beta as https://hg.mozilla.org/releases/mozilla-beta/rev/b65bc1bf7a41
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.