checkForMiddleClick should trigger event handlers added via addEventListener




5 years ago
2 years ago


(Reporter: pikadudeno1+bugzilla, Unassigned)


(Depends on: 1 bug, {feature})

25 Branch
Windows 7

Firefox Tracking Flags

(Not tracked)




5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131017174213

Steps to reproduce:

Call checkForMiddleClick(node, event) (defined in utilityOverlay.js).

Actual results:

Only the event handler defined by the oncommand attribute is called.

Expected results:

Handlers added via node.addEventListener("command", handler) should be called as well. For bootstrapped add-ons, which can only add elements via JavaScript code, addEventListener is the most convenient way to go.

Comment 1

3 years ago
User Agent 	Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0
Version 	46.0a1
Build ID 	20160111030207
Channel 	nightly

Thank you for taking time to report this.  Sorry it took longer to review this issue.
Are you still able to reproduce this in the latest version ?  Can you give more details and sample test page to verify this ?
Component: Untriaged → Event Handling
Flags: needinfo?(pikadudeno1+bugzilla)
Product: Firefox → Core

Comment 2

3 years ago
This is all Firefox code, not Gecko. And nothing to do with event handling. Just a JS function doing something.
Component: Event Handling → General
Product: Core → Firefox

Comment 3

3 years ago
I've confirmed that Firefox still has the bug by checking the source code on dxr. Permalink:

As you can see, checkForMiddleClick works by reading the oncommand attribute and executing its code, ignoring all other event listeners.
Flags: needinfo?(pikadudeno1+bugzilla)
Hi reporter,

Can you please provide a functional test case so I can test this on my end? Does other browsers have the same behavior when calling checkForMiddleClick(node, event) function?

Also, can you please try to reproduce this on the latest release(44.0) and latest Nightly(47.0a1) and provide the results? When doing this, please try to reproduce with a new clean Firefox profile, maybe even in safe mode, as some of this issues may be caused by third party installed add-ons or custom settings(

Flags: needinfo?(pikadudeno1+bugzilla)

Comment 5

3 years ago
Considering the fact that the reporter did not answer to the above (comments 1 & 4) requests until now, I will mark this as resolved-incomplete.
If anyone can still reproduce it, feel free to reopen the issue and provide more information.

Last Resolved: 3 years ago
Resolution: --- → INCOMPLETE

Comment 6

3 years ago
This is a valid improvement request for add-on compat. It might be quite tricky to implement correctly (what about command listeners on the parents/ancestors of the element?), but there's enough info here.
Severity: normal → enhancement
Ever confirmed: true
Flags: needinfo?(pikadudeno1+bugzilla)
Resolution: INCOMPLETE → ---

Comment 7

3 years ago
As it is enhancement, changing its status to NEW.

Comment 8

3 years ago
Were the doCommand method able to accept a click event argument, fixing this would a simple matter of having checkForMiddleClick use that instead of read the oncommand attribute/property.
Depends on: 461578


3 years ago
Keywords: feature
You need to log in before you can comment on or make changes to this bug.