Kaynağa Gözat

ignore protected data

Signed-off-by: Gerald <[email protected]>
Gerald 11 yıl önce
ebeveyn
işleme
0f5c81623d
1 değiştirilmiş dosya ile 16 ekleme ve 12 silme
  1. 16 12
      injected.js

+ 16 - 12
injected.js

@@ -178,18 +178,22 @@ var comm={
 						}
 					}
 				}
-				Object.defineProperty(t,i,{
-					get:function(){
-						initProperty();
-						return value===window?t:value;
-					},
-					set:function(v){
-						initProperty();
-						value=v;
-						if(type!='function') window[i]=v;
-						type='custom';
-					},
-				});
+				try {
+					Object.defineProperty(t,i,{
+						get:function(){
+							initProperty();
+							return value===window?t:value;
+						},
+						set:function(v){
+							initProperty();
+							value=v;
+							if(type!='function') window[i]=v;
+							type='custom';
+						},
+					});
+				} catch(e) {
+					// ignore protected data
+				}
 				/*try{	// avoid reading protected data
 					if(typeof window[i]=='function') {
 						if(itemWrapper) t[i]=itemWrapper(window,i,wrapWindow);