var dianshangji_contentscript_debug=!1,dianshangji_contentscript={debug:function(a){dianshangji_contentscript_debug&&console.debug(a)},init:function(a){var b=this;b.cdr=a;a=document.createElement("div");a.id="dianshangji_contentscript";document.body.appendChild(a);b.page2content=document.createElement("div");b.page2content.id="dianshangji_contentscript_page2content";a.appendChild(b.page2content);b.content2page=document.createElement("div");b.content2page.id="dianshangji_contentscript_content2page";
a.appendChild(b.content2page);b.eventHandler.bind(b.page2content,b.page2content.id,function(a){var d=b.page2content.getAttribute("request");b.page2content.setAttribute("request","");b.cdr.sendRequest(d,function(a){null==a&&(a="");b.sendMessageToPage(d,a)})})},eventHandler:{bind:function(a,b,c){window.addEventListener?a.addEventListener(b,c,!1):window.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c},unbind:function(a,b,c){window.removeEventListener?a.removeEventListener(b,c,!1):window.detachEvent?
a.detachEvent("on"+b,c):elem["on"+b]=null},stop:function(a){a=a||window.event;a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()},dispatch:function(a,b){var c=document.createEvent("HTMLEvents");c.initEvent(b,!1,!1);c.eventType="message";a.dispatchEvent(c)}},sendMessageToPage:function(a,b){var c=this,d=c.content2page.getAttribute("request");null!=d&&0<d.length?setTimeout(function(){c.sendMessageToPage(a,b)},1E3):(c.content2page.setAttribute("request",a),c.content2page.setAttribute("request2",
b),c.eventHandler.dispatch(c.content2page,c.content2page.id))}};dianshangji_contentscript.init(dianshangji_cdr);
