Skip to content

Commit

Permalink
πŸ› Fix issue where context menus were being created on external browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandrewett committed Dec 16, 2023
1 parent f29dee6 commit 3a9ed21
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions actors/DotContextMenuParent.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ export class DotContextMenuParent extends JSWindowActorParent {
if (message.name !== "contextmenu") return;

const browser = this.manager.rootFrameLoader.ownerElement;
const win = browser.ownerGlobal.top;
const win = browser.ownerGlobal;

const { x, y, context } = message.data;
// Make sure this browser belongs to us before we open the panel
if (win.gDot.tabs.getTabForWebContents(browser)) {
const { x, y, context } = message.data;

const panel = win.gDot.panels.getPanelById("browser-context-menu");
const panel = win.gDot.panels.getPanelById("browser-context-menu");

panel.openPanel({
coordMode: "screen",
panel.openPanel({
coordMode: "screen",

x: x,
y: y,
x: x,
y: y,

args: context
});
args: context
});
}
}

hiding() {
Expand Down

0 comments on commit 3a9ed21

Please sign in to comment.