File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,23 @@ export class DotContextMenuParent extends JSWindowActorParent {
8
8
if ( message . name !== "contextmenu" ) return ;
9
9
10
10
const browser = this . manager . rootFrameLoader . ownerElement ;
11
- const win = browser . ownerGlobal . top ;
11
+ const win = browser . ownerGlobal ;
12
12
13
- const { x, y, context } = message . data ;
13
+ // Make sure this browser belongs to us before we open the panel
14
+ if ( win . gDot . tabs . getTabForWebContents ( browser ) ) {
15
+ const { x, y, context } = message . data ;
14
16
15
- const panel = win . gDot . panels . getPanelById ( "browser-context-menu" ) ;
17
+ const panel = win . gDot . panels . getPanelById ( "browser-context-menu" ) ;
16
18
17
- panel . openPanel ( {
18
- coordMode : "screen" ,
19
+ panel . openPanel ( {
20
+ coordMode : "screen" ,
19
21
20
- x : x ,
21
- y : y ,
22
+ x : x ,
23
+ y : y ,
22
24
23
- args : context
24
- } ) ;
25
+ args : context
26
+ } ) ;
27
+ }
25
28
}
26
29
27
30
hiding ( ) {
You can’t perform that action at this time.
0 commit comments