Browse Source

only allow registering menus from top level windows

Signed-off-by: Gerald <[email protected]>
Gerald 11 năm trước cách đây
mục cha
commit
111267f43c
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      injected.js

+ 3 - 1
injected.js

@@ -410,7 +410,9 @@ var comm={
 function handleC(e){
 	var o=JSON.parse(e.attrName),maps={
 		SetValue:function(o){post({cmd:'SetValue',data:o});},
-		RegisterMenu:menu.push.bind(menu),
+		RegisterMenu:function(o){
+			if(window.top===window) menu.push(o);
+		},
 		GetRequestId:getRequestId,
 		HttpRequest:httpRequest,
 		AbortRequest:abortRequest,