mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #2515 - Guard devtools click handlers against non-primary clicks.
We only want clicks on HTML elements to respond to the primary button.
This commit is contained in:
parent
bd439689e1
commit
9b56867901
5 changed files with 16 additions and 1 deletions
|
|
@ -209,6 +209,9 @@ SplitView.prototype = {
|
|||
this._nav.appendChild(aSummary);
|
||||
|
||||
aSummary.addEventListener("click", (aEvent) => {
|
||||
if (aEvent.button != 0) {
|
||||
return;
|
||||
}
|
||||
aEvent.stopPropagation();
|
||||
this.activeSummary = aSummary;
|
||||
}, false);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@ AutocompletePopup.prototype = {
|
|||
},
|
||||
|
||||
onClick: function (e) {
|
||||
if (e.button != 0) {
|
||||
return;
|
||||
}
|
||||
let item = e.target.closest(".autocomplete-item");
|
||||
if (item && typeof item.dataset.index !== "undefined") {
|
||||
this.selectedIndex = parseInt(item.dataset.index, 10);
|
||||
|
|
|
|||
|
|
@ -240,6 +240,9 @@ Spectrum.prototype = {
|
|||
},
|
||||
|
||||
onElementClick: function (e) {
|
||||
if (e.button != 0) {
|
||||
return;
|
||||
}
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1480,6 +1480,9 @@ Column.prototype = {
|
|||
* for sorting.
|
||||
*/
|
||||
onClick: function (event) {
|
||||
if (event.button != 0) {
|
||||
return;
|
||||
}
|
||||
let target = event.originalTarget;
|
||||
|
||||
if (target.nodeType !== target.ELEMENT_NODE || target == this.column) {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,10 @@ StyleEditorUI.prototype = {
|
|||
|
||||
this._view = new SplitView(viewRoot);
|
||||
|
||||
wire(this._view.rootElement, ".style-editor-newButton", () =>{
|
||||
wire(this._view.rootElement, ".style-editor-newButton", (e) =>{
|
||||
if (e.button != 0) {
|
||||
return;
|
||||
}
|
||||
this._debuggee.addStyleSheet(null);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue