Open Bug 762015 Opened 8 years ago Updated 3 years ago

Checkboxes in inline preferences don't fire the command event


(Firefox for Android :: General, defect)

Not set




(Reporter: gaubugzilla, Unassigned)



Adblock Plus uses inline preferences that aren't bound to a preference - a "command" event handler is being attached instead when the inline preferences open. This works fine in desktop Firefox and XUL Fennec but fails in the native Fennec. Looking at the code, the issue is apparently this line:


fireEvent("oncommand") will merely eval the value of the "oncommand" attribute, it won't dispatch an actual "command" event. In fact, it will pass in an event with wrong type "oncommand" to the function. The work-around is adding this oncommand attribute to the <setting> tag:

> oncommand="if (event.type == 'oncommand') {event = document.createEvent('Events'); event.initEvent('command', true, true); this.dispatchEvent(event);}"
Is this still an issue?
Yes, nothing changed since I filed that bug. Current code will still call fireEvent("oncommand") which merely evals the oncommand attribute but doesn't actually trigger listeners for the "command" event.
You need to log in before you can comment on or make changes to this bug.