fix: Fixed glance not listening for context menu activations, b=closes #11148, c=common, glance

This commit is contained in:
Mr. M
2025-11-17 11:38:45 +01:00
parent a3f396ab19
commit 9a9c1c312c
2 changed files with 6 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ let JSWINDOWACTORS = {
esModuleURI: 'resource:///actors/ZenGlanceChild.sys.mjs',
events: {
DOMContentLoaded: {},
click: {
mousedown: {
capture: true,
},
keydown: {

View File

@@ -35,9 +35,12 @@ export class ZenGlanceChild extends JSWindowActorChild {
}
#sendClickDataToParent(target, element) {
if (!element || !target) {
if (!element && !target) {
return;
}
if (!target) {
target = element;
}
// Get the largest element we can get. If the `A` element
// is a parent of the original target, use the anchor element,
// otherwise use the original target.
@@ -54,7 +57,7 @@ export class ZenGlanceChild extends JSWindowActorChild {
});
}
on_click(event) {
on_mousedown(event) {
// get closest A element
const target = event.target.closest('A');
const elementToRecord = event.originalTarget || event.target;