瀏覽代碼

修复在chrome最新版点击无反应的bug

更替了一些过时的方法;修改了manifest中的persistent
Alien 11 年之前
父節點
當前提交
ab95a0228f

+ 4 - 4
chrome/manifest.json

@@ -1,6 +1,6 @@
 { 
 	"name": "WEB前端助手(FeHelper)", 
-	"version": "5.3",
+	"version": "5.4",
     "manifest_version": 2,
 	 
 	"default_locale": "zh_CN", 
@@ -19,7 +19,7 @@
 	},
 
     "background": {
-        "persistent": false,
+        "persistent": true,
         "page": "template/fehelper_background.html"
     },
 	"options_page": "template/fehelper_options.html", 
@@ -78,14 +78,14 @@
             "static/js/jsonformat/json-format-ent.js",
             "static/js/jsonformat/contentscript-jsonformat.js"
 		],
-		"run_at":"document_end",
+		"run_at":"document_start",
 		"all_frames":false
 	},{
         "matches":["http://*.baidufe.com/fehelper/*","http://*.baidufe.com/fehelper"],
         "js":[
             "static/js/fe-contentscript-fehelper.js"
         ],
-        "run_at":"document_end",
+        "run_at":"document_start",
         "all_frames":false
     }],
     "content_security_policy": "script-src 'self' https://ssl.google-analytics.com 'unsafe-eval'; object-src 'self'",

+ 4 - 4
chrome/online.manifest.json

@@ -1,6 +1,6 @@
 {
     "name": "WEB前端助手(FeHelper)",
-    "version": "5.3",
+    "version": "5.4",
     "manifest_version": 2,
 
     "default_locale": "zh_CN",
@@ -19,7 +19,7 @@
 	},
 
     "background": {
-        "persistent": false,
+        "persistent": true,
         "page": "template/fehelper_background.html"
     },
 	"options_page": "template/fehelper_options.html",
@@ -57,14 +57,14 @@
 			
 			"static/js/mod/mod_manifest.js"
 		],
-		"run_at":"document_end",
+		"run_at":"document_start",
 		"all_frames":false
 	},{
         "matches":["http://*.baidufe.com/fehelper/*","http://*.baidufe.com/fehelper"],
         "js":[
             "static/js/fe-contentscript-fehelper.js"
         ],
-        "run_at":"document_end",
+        "run_at":"document_start",
         "all_frames":false
     }],
     "content_security_policy": "script-src 'self' https://ssl.google-analytics.com 'unsafe-eval'; object-src 'self'",

+ 2 - 0
chrome/static/js/core/fe-const.js

@@ -59,6 +59,8 @@ const MSG_TYPE = {
 
     CODE_COMPRESS : 'code_compress',
 
+    FROM_POPUP : 'from_popup_action',
+
     ////////////////////如下是popup中的menu,value和filename相同///////////////////
     REGEXP_TOOL : 'regexp',
     //字符串编解码

+ 259 - 251
chrome/static/js/fe-background.js

@@ -2,121 +2,124 @@
  * FE-Helper后台运行程序
  * @author [email protected]
  */
-var BgPageInstance = (function(){
+var BgPageInstance = (function () {
 
-	//各种元素的就绪情况	
-	var _readyState = {
-		css : false,
-		js : false,
-		html : true,
-		allDone : false
-	};
-	
-	//侦测的interval
-	var _detectInterval = null;
-	
-	//侦测就绪情况
-	var _detectReadyState = function(){
-		_detectInterval = window.setInterval(function(){
-			if(_readyState.css && _readyState.js && _readyState.html) {
-				_readyState.allDone = true;
-				window.clearInterval(_detectInterval);
-			}
-		},100);
-	};
-	
-	
-	/**
-	 * 执行前端FCPHelper检测
-	 */
-	var _doFcpDetect = function(tab){
-		//所有元素都准备就绪
-		if(_readyState.allDone) {
+    //各种元素的就绪情况
+    var _readyState = {
+        css:false,
+        js:false,
+        html:true,
+        allDone:false
+    };
+
+    //侦测的interval
+    var _detectInterval = null;
+
+    //侦测就绪情况
+    var _detectReadyState = function () {
+        _detectInterval = window.setInterval(function () {
+            if (_readyState.css && _readyState.js && _readyState.html) {
+                _readyState.allDone = true;
+                window.clearInterval(_detectInterval);
+            }
+        }, 100);
+    };
+
+
+    /**
+     * 执行前端FCPHelper检测
+     */
+    var _doFcpDetect = function (tab) {
+        //所有元素都准备就绪
+        if (_readyState.allDone) {
             chrome.tabs.sendMessage(tab.id, {
-                type: MSG_TYPE.BROWSER_CLICKED,
-				event : MSG_TYPE.FCP_HELPER_DETECT
+                type:MSG_TYPE.BROWSER_CLICKED,
+                event:MSG_TYPE.FCP_HELPER_DETECT
+            });
+        } else {
+            //正在准备数据,请稍等...
+            //显示桌面提醒
+            baidu.feNotification.notifyText({
+                message:"正在准备数据,请稍等..."
             });
-		} else {
-			//正在准备数据,请稍等...
-			//显示桌面提醒
-			baidu.feNotification.notifyText({
-				message : "正在准备数据,请稍等..."
-			});	
-		}
-	};
-	
-	/**
-	 * 执行栅格检测
-	 */
-	var _doGridDetect = function(tab){
+        }
+    };
+
+    /**
+     * 执行栅格检测
+     */
+    var _doGridDetect = function (tab) {
         chrome.tabs.sendMessage(tab.id, {
-            type: MSG_TYPE.BROWSER_CLICKED,
-			event : MSG_TYPE.GRID_DETECT
+            type:MSG_TYPE.BROWSER_CLICKED,
+            event:MSG_TYPE.GRID_DETECT
         });
-	};
+    };
 
-    var notId=0;
-	/**
-	 * 提醒层 缓存
-	 * @type {Array}
-	 */
-	var _notificationCache = [];
-	
-	/**
-	 * 查看页面wpo信息
-	 */
-	var _showPageWpoInfo = function(wpoInfo){
-		chrome.tabs.getSelected(null,function(tab){
-            try{
+    /**
+     * 提醒层 缓存
+     * @type {Array}
+     */
+    var _notificationCache = [];
+
+    /**
+     * 查看页面wpo信息
+     */
+    var _showPageWpoInfo = function (wpoInfo) {
+        chrome.tabs.query({active:true, currentWindow:true}, function (tabs) {
+            var tab = tabs[0];
+            try {
                 _notificationCache[tab.id].cancel();
-            }catch (e){}
-            if(!wpoInfo) {
-				baidu.feNotification.notifyText({
-					message : "对不起,检测失败"
-				});	
-			}else{
-                if(window.webkitNotifications && webkitNotifications.createHTMLNotification) {
+            } catch (e) {
+            }
+            if (!wpoInfo) {
+                baidu.feNotification.notifyText({
+                    message:"对不起,检测失败"
+                });
+            } else {
+                if (window.webkitNotifications && webkitNotifications.createHTMLNotification) {
                     baidu.feNotification.notifyHtml("template/fehelper_wpo.html?" + JSON.stringify(wpoInfo));
                 } else {
                     chrome.tabs.create({
-                        url : "template/fehelper_wpo.html?" + JSON.stringify(wpoInfo),
-                        selected : true
+                        url:"template/fehelper_wpo.html?" + JSON.stringify(wpoInfo),
+                        active:true
                     });
                 }
-			}
-		});
-	};
+            }
+        });
+    };
 
-	/**
-	 * 获取页面wpo信息
-	 * @return {[type]}
-	 */
-	var _getPageWpoInfo = function(){
-		chrome.tabs.getSelected(null,function(tab){	
-			//显示桌面提醒
-			_notificationCache[tab.id] = baidu.feNotification.notifyText({
-					message : "正在统计,请稍后...",
-					autoClose : false
-				});	
-	        chrome.tabs.sendMessage(tab.id,{
-				type : MSG_TYPE.GET_PAGE_WPO_INFO
-			});
-		});
-	};
+    /**
+     * 获取页面wpo信息
+     * @return {[type]}
+     */
+    var _getPageWpoInfo = function () {
+        chrome.tabs.query({active:true, currentWindow:true}, function (tabs) {
+            var tab = tabs[0];
+            //显示桌面提醒
+            _notificationCache[tab.id] = baidu.feNotification.notifyText({
+                message:"正在统计,请稍后...",
+                autoClose:false
+            });
+            chrome.tabs.sendMessage(tab.id, {
+                type:MSG_TYPE.GET_PAGE_WPO_INFO
+            });
+        });
+    };
 
     /**
      * 执行JS Tracker
      * @private
      */
-    var _doJsTracker = function(){
-        chrome.tabs.getSelected(null,function(tab){
-            chrome.tabs.executeScript(tab.id,{
-                code : "void function(t,r,a,c,k){t.tracker_type='bm';t.tracker_uid='fehelper';"
+    var _doJsTracker = function () {
+        chrome.tabs.query({active:true, currentWindow:true}, function (tabs) {
+            var tab = tabs[0];
+            chrome.tabs.executeScript(tab.id, {
+                code:"void function(t,r,a,c,k){t.tracker_type='bm';t.tracker_uid='fehelper';"
                     + "(k=t.TrackerGlobalEvent)?k.f(r):[(k=t[a]('script')).charset='utf-8',"
                     + "k.src='http://www.ucren.com/'+c+'/'+c+'.js?'+Math.random(),"
                     + "t.documentElement.appendChild(k)]}(document,'TrackerJSLoad','createElement','tracker') ",
-                allFrames : false,
-                runAt : 'document_end'
+                allFrames:false,
+                runAt:'document_end'
             });
         });
     };
@@ -125,26 +128,26 @@ var BgPageInstance = (function(){
      * 代码压缩工具
      * @private
      */
-    var _goCompressTool = function(){
+    var _goCompressTool = function () {
         var url = "http://www.baidufe.com/fehelper/codecompress.html";
-        chrome.tabs.getAllInWindow(null,function(tabs){
+        chrome.tabs.query({windowId:chrome.windows.WINDOW_ID_CURRENT }, function (tabs) {
             var isOpened = false;
-            var tabId ;
-            var reg = new RegExp("fehelper.*codecompress.html$","i");
-            for(var i = 0,len = tabs.length;i < len;i++){
-                if(reg.test(tabs[i].url)) {
+            var tabId;
+            var reg = new RegExp("fehelper.*codecompress.html$", "i");
+            for (var i = 0, len = tabs.length; i < len; i++) {
+                if (reg.test(tabs[i].url)) {
                     isOpened = true;
                     tabId = tabs[i].id;
                     break;
                 }
             }
-            if(!isOpened) {
+            if (!isOpened) {
                 chrome.tabs.create({
-                    url : url,
-                    selected : true
+                    url:url,
+                    active:true
                 });
             } else {
-                chrome.tabs.update(tabId,{selected : true});
+                chrome.tabs.update(tabId, {highlighted:true});
             }
         });
     };
@@ -155,25 +158,25 @@ var BgPageInstance = (function(){
      * @param file
      * @private
      */
-    var _openFileAndRun = function(tab,file){
-        chrome.tabs.getAllInWindow(null,function(tabs){
+    var _openFileAndRun = function (tab, file) {
+        chrome.tabs.query({windowId:chrome.windows.WINDOW_ID_CURRENT }, function (tabs) {
             var isOpened = false;
-            var tabId ;
-            var reg = new RegExp("^chrome.*" + file + ".html$","i");
-            for(var i = 0,len = tabs.length;i < len;i++){
-                if(reg.test(tabs[i].url)) {
+            var tabId;
+            var reg = new RegExp("^chrome.*" + file + ".html$", "i");
+            for (var i = 0, len = tabs.length; i < len; i++) {
+                if (reg.test(tabs[i].url)) {
                     isOpened = true;
                     tabId = tabs[i].id;
                     break;
                 }
             }
-            if(!isOpened) {
+            if (!isOpened) {
                 chrome.tabs.create({
-                    url : 'template/fehelper_' + file + '.html',
-                    selected : true
+                    url:'template/fehelper_' + file + '.html',
+                    active:true
                 });
             } else {
-                chrome.tabs.update(tabId,{selected : true});
+                chrome.tabs.update(tabId, {highlighted:true});
             }
         });
     };
@@ -181,13 +184,14 @@ var BgPageInstance = (function(){
     /**
      * 根据给定参数,运行对应的Helper
      */
-    var _runHelper = function(config){
-        chrome.tabs.getSelected(null,function(tab){
+    var _runHelper = function (config) {
+        chrome.tabs.query({active:true, currentWindow:true}, function (tabs) {
+            var tab = tabs[0];
             // 如果是采用独立文件方式访问,直接打开该页面即可
-            if(config.useFile == '1') {
-                _openFileAndRun(tab,config.msgType);
-            }else{
-                switch(config.msgType) {
+            if (config.useFile == '1') {
+                _openFileAndRun(tab, config.msgType);
+            } else {
+                switch (config.msgType) {
                     //fcphelper检测
                     case MSG_TYPE.FCP_HELPER_DETECT:
                         _doFcpDetect(tab);
@@ -212,140 +216,144 @@ var BgPageInstance = (function(){
             }
         });
     };
-	
-	/**
-	 * 创建扩展专属的右键菜单
-	 */
-	var _createContextMenu = function(){
-		_removeContextMenu();
-		baidu.contextMenuId = chrome.contextMenus.create({
-			title : "FeHelper-FE助手"
-		});
-		chrome.contextMenus.create({
-			title : "编码检测",
-			parentId : baidu.contextMenuId,
-			onclick : function(info,tab) {
-				//编码检测
-				_doFcpDetect(tab);
-			}
-		});
-		chrome.contextMenus.create({
-			title : "栅格检测",
-			parentId : baidu.contextMenuId,
-			onclick : function(info,tab) {
-				//执行栅格检测
-				_doGridDetect(tab);
-			}
-		});
-		chrome.contextMenus.create({
-			title : "网页加载耗时",
-			parentId : baidu.contextMenuId,
-			onclick : function(info,tab) {
-				//网页加载耗时
-				_getPageWpoInfo();
-			}
-		});
-	};
-	
-	/**
-	 * 移除扩展专属的右键菜单
-	 */
-	var _removeContextMenu = function(){
-		if(!baidu.contextMenuId) return;
-		chrome.contextMenus.remove(baidu.contextMenuId);
-		baidu.contextMenuId = null;
-	};
-	
-	/**
-	 * 创建或移除扩展专属的右键菜单
-	 */
-	var _createOrRemoveContextMenu = function(){
 
-		//管理右键菜单
-		if(baidu.feOption.getOptionItem('opt_item_contextMenus') === 'true') {
-			_createContextMenu();
-		} else {
-			_removeContextMenu();
-		}
-	};
-	
-	/**
-	 * 接收来自content_scripts发来的消息
-	 */
-	var _addExtensionListener = function(){
-		chrome.extension.onMessage.addListener(function(request,sender,callback){
-			//处理CSS的请求
-			if(request.type == MSG_TYPE.GET_CSS) {
-				//直接AJAX获取CSS文件内容
-				baidu.network.readFileContent(request.link,callback);
-			}
-			//处理JS的请求
-			else if(request.type == MSG_TYPE.GET_JS) {
-				//直接AJAX获取JS文件内容
-				baidu.network.readFileContent(request.link,callback);
-			}
-			//处理HTML的请求
-			else if(request.type == MSG_TYPE.GET_HTML) {
-				//直接AJAX获取JS文件内容
-				baidu.network.readFileContent(request.link,callback);
-			}
-			//处理cookie
-			else if(request.type == MSG_TYPE.GET_COOKIE) {
-				baidu.network.getCookies(request,callback);
-			}
-			//移除cookie
-			else if(request.type == MSG_TYPE.REMOVE_COOKIE) {
-				baidu.network.removeCookie(request,callback);
-			}
-			//设置cookie
-			else if(request.type == MSG_TYPE.SET_COOKIE) {
-				baidu.network.setCookie(request,callback);
-			}
-			//CSS准备就绪
-			else if(request.type == MSG_TYPE.CSS_READY) {
-				_readyState.css = true;
-			}
-			//JS准备就绪
-			else if(request.type == MSG_TYPE.JS_READY) {
-				_readyState.js = true;
-			}
-			//HTML准备就绪
-			else if(request.type == MSG_TYPE.HTML_READY) {
-				_readyState.html = true;
-			}
-			//提取配置项
-			else if(request.type == MSG_TYPE.GET_OPTIONS){
-				baidu.feOption.doGetOptions(request.items,callback);
-			}
-			//保存配置项
-			else if(request.type == MSG_TYPE.SET_OPTIONS){
-				baidu.feOption.doSetOptions(request.items,callback);
-				//管理右键菜单
-				_createOrRemoveContextMenu();
-			}
-			//保存当前网页加载时间
-			else if(request.type == MSG_TYPE.CALC_PAGE_LOAD_TIME){
-				_showPageWpoInfo(request.wpo);
-			}
+    /**
+     * 创建扩展专属的右键菜单
+     */
+    var _createContextMenu = function () {
+        _removeContextMenu();
+        baidu.contextMenuId = chrome.contextMenus.create({
+            title:"FeHelper-FE助手"
+        });
+        chrome.contextMenus.create({
+            title:"编码检测",
+            parentId:baidu.contextMenuId,
+            onclick:function (info, tab) {
+                //编码检测
+                _doFcpDetect(tab);
+            }
+        });
+        chrome.contextMenus.create({
+            title:"栅格检测",
+            parentId:baidu.contextMenuId,
+            onclick:function (info, tab) {
+                //执行栅格检测
+                _doGridDetect(tab);
+            }
+        });
+        chrome.contextMenus.create({
+            title:"网页加载耗时",
+            parentId:baidu.contextMenuId,
+            onclick:function (info, tab) {
+                //网页加载耗时
+                _getPageWpoInfo();
+            }
+        });
+    };
+
+    /**
+     * 移除扩展专属的右键菜单
+     */
+    var _removeContextMenu = function () {
+        if (!baidu.contextMenuId) return;
+        chrome.contextMenus.remove(baidu.contextMenuId);
+        baidu.contextMenuId = null;
+    };
+
+    /**
+     * 创建或移除扩展专属的右键菜单
+     */
+    var _createOrRemoveContextMenu = function () {
+
+        //管理右键菜单
+        if (baidu.feOption.getOptionItem('opt_item_contextMenus') === 'true') {
+            _createContextMenu();
+        } else {
+            _removeContextMenu();
+        }
+    };
+
+    /**
+     * 接收来自content_scripts发来的消息
+     */
+    var _addExtensionListener = function () {
+        chrome.runtime.onMessage.addListener(function (request, sender, callback) {
+            //处理CSS的请求
+            if (request.type == MSG_TYPE.GET_CSS) {
+                //直接AJAX获取CSS文件内容
+                baidu.network.readFileContent(request.link, callback);
+            }
+            //处理JS的请求
+            else if (request.type == MSG_TYPE.GET_JS) {
+                //直接AJAX获取JS文件内容
+                baidu.network.readFileContent(request.link, callback);
+            }
+            //处理HTML的请求
+            else if (request.type == MSG_TYPE.GET_HTML) {
+                //直接AJAX获取JS文件内容
+                baidu.network.readFileContent(request.link, callback);
+            }
+            //处理cookie
+            else if (request.type == MSG_TYPE.GET_COOKIE) {
+                baidu.network.getCookies(request, callback);
+            }
+            //移除cookie
+            else if (request.type == MSG_TYPE.REMOVE_COOKIE) {
+                baidu.network.removeCookie(request, callback);
+            }
+            //设置cookie
+            else if (request.type == MSG_TYPE.SET_COOKIE) {
+                baidu.network.setCookie(request, callback);
+            }
+            //CSS准备就绪
+            else if (request.type == MSG_TYPE.CSS_READY) {
+                _readyState.css = true;
+            }
+            //JS准备就绪
+            else if (request.type == MSG_TYPE.JS_READY) {
+                _readyState.js = true;
+            }
+            //HTML准备就绪
+            else if (request.type == MSG_TYPE.HTML_READY) {
+                _readyState.html = true;
+            }
+            //提取配置项
+            else if (request.type == MSG_TYPE.GET_OPTIONS) {
+                baidu.feOption.doGetOptions(request.items, callback);
+            }
+            //保存配置项
+            else if (request.type == MSG_TYPE.SET_OPTIONS) {
+                baidu.feOption.doSetOptions(request.items, callback);
+                //管理右键菜单
+                _createOrRemoveContextMenu();
+            }
+            //保存当前网页加载时间
+            else if (request.type == MSG_TYPE.CALC_PAGE_LOAD_TIME) {
+                _showPageWpoInfo(request.wpo);
+            }
+            // 从popup中点过来的
+            else if (request.type == MSG_TYPE.FROM_POPUP) {
+                _runHelper(request.config);
+            }
 
             return true;
-		});
-	};
-	
-	/**
-	 * 初始化
-	 */
-	var _init = function(){
-		_addExtensionListener();
-		_detectReadyState();
-		_createOrRemoveContextMenu();
-	};
-	
-	return {
-		init		: _init,
-        runHelper	: _runHelper
-	};
-})();	
+        });
+    };
+
+    /**
+     * 初始化
+     */
+    var _init = function () {
+        _addExtensionListener();
+        _detectReadyState();
+        _createOrRemoveContextMenu();
+    };
+
+    return {
+        init:_init,
+        runHelper:_runHelper
+    };
+})();
 
 //初始化
 BgPageInstance.init();

+ 1 - 1
chrome/static/js/fe-helper.js

@@ -49,7 +49,7 @@ baidu.fehelper = (function(){
 	 * 执行栅格检测:在页面上显示栅格
 	 */
 	var _doGridDetect = function(){
-		chrome.extension.onMessage.addListener(function(request,sender,callback){
+		chrome.runtime.onMessage.addListener(function(request,sender,callback){
 			//browserAction被点击
 			if(request.type == MSG_TYPE.BROWSER_CLICKED && request.event == MSG_TYPE.GRID_DETECT) {
 				//加载css

+ 2 - 1
chrome/static/js/fe-option.js

@@ -126,7 +126,8 @@ baidu.feOption = (function(){
 	 * 关闭配置页面
 	 */
 	var _closeTab = function(){
-		chrome.tabs.getSelected(null,function(tab){
+        chrome.tabs.query({active:true, currentWindow:true}, function (tabs) {
+            var tab = tabs[0];
 			chrome.tabs.remove(tab.id);
 		});
 	};

+ 12 - 49
chrome/static/js/fe-popup.js

@@ -2,57 +2,20 @@
  * FeHelper弹出(下拉)页面
  * @author zhaoxianlie
  */
-baidu.fePopup = (function(){
-	/**
-	 * 获取后台页面,返回window对象
-	 */
-	var bgPage = null;
+$(function () {
+    // 获取后台页面,返回window对象
+    var bgPage = chrome.extension.getBackgroundPage();
+    // 菜单点击以后执行的动作
+    jQuery('ul.fe-function-list li').click(function (e) {
+        var msgType = $(this).attr('data-msgtype');
+        var isUseFile = $(this).attr('data-usefile');
 
-    /**
-     * 初始化Fdp菜单项
-     */
-    var _initFdpMenu = function(){
-        if(bgPage.baidu.feOption.getOptionItem('opt_item_showfdpmenu') == "true"){
-            jQuery("li.-x-fdp").removeClass("fe-hide");
-        }
-    };
-
-    /**
-     * 绑定弹出菜单的点击事件
-     * @private
-     */
-    var _bindPopMenuEvent = function(){
-        jQuery('ul.fe-function-list li').click(function(e){
-            var msgType = $(this).attr('data-msgtype');
-            var isUseFile = $(this).attr('data-usefile');
-            window.close();
-            bgPage.BgPageInstance.runHelper({
-                msgType : MSG_TYPE[msgType],
-                useFile : isUseFile
-            });
+        bgPage.BgPageInstance.runHelper({
+            msgType:MSG_TYPE[msgType],
+            useFile:isUseFile
         });
-    };
-	
-	/**
-	 * 初始化页面,包括事件的绑定等
-	 */
-	var _doInit = function(){
-		_initFdpMenu();
-        _bindPopMenuEvent();
-	};
-
-    var _init = function(){
-        bgPage = chrome.extension.getBackgroundPage();
-        _doInit();
-    };
-	
-	return {
-		init : _init
-	};
-})();
-
-$(function(){
-    baidu.fePopup.init();
+        window.close();
+    });
 });
 
 

+ 1 - 1
chrome/static/js/wpo/fe-calc-wpo.js

@@ -84,7 +84,7 @@ baidu.calcPageLoadTime = (function(){
     };
 	
 	var init = function(){
-		chrome.extension.onMessage.addListener(function(request,sender,callback){
+		chrome.runtime.onMessage.addListener(function(request,sender,callback){
 			// 获取页面相关性能数据
 			if(request.type == MSG_TYPE.GET_PAGE_WPO_INFO) {
 				(function check() {