mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-15 16:03:43 +00:00
fix: Fixed glance not listening for context menu activations, b=closes #11148, c=common, glance
This commit is contained in:
@@ -42,7 +42,7 @@ let JSWINDOWACTORS = {
|
||||
esModuleURI: 'resource:///actors/ZenGlanceChild.sys.mjs',
|
||||
events: {
|
||||
DOMContentLoaded: {},
|
||||
click: {
|
||||
mousedown: {
|
||||
capture: true,
|
||||
},
|
||||
keydown: {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user