var dianshangji_bg = {
    name_: "dsjext", version_: "2021-07-08", revision_: "2021-07-08", debug_: !1, debugdsjapp_: !1, log_: !1, trace_: !1, cdnindex_: 0, cdnuri_: ["http://115.159.36.132", "http://203.195.172.91"], updatehost_: "public.juguandian.com", updatehosts_: ["public.juguandian.com", "115.159.36.132", "203.195.172.91", "115.159.220.104"], updatehostindex_: 0, interfaces_: [], localAddr_: "", localPort_: 0, homepage_: null, extensionlist_: [], externalPort_: null, debugframe_: !0, loadframe_: !0, publicTempVar: { name: "", value: "" }, pouchdbs: {},
    clientid_: "", debug: function (a) { this.debug_ && console.log(a) }, log: function (a) { this.log_ && console.log(a) }, trace: function (a) { this.trace_ && console.log(a) }, sendRequest: function (a, b, c, d) { "undefined" == typeof b && (b = {}); "undefined" != typeof d ? jQuery.ajax({ type: "POST", url: a, data: d, dataType: "text", headers: b, success: function (a, b, d) { c(a) }, error: function (a, b, d) { c(null) } }) : jQuery.ajax({ type: "GET", url: a, dataType: "text", headers: b, success: function (a, b, d) { c(a) }, error: function (a, b, d) { c(null) } }) }, dsjextEntry: function (a,
        b, c) { c("") }, onRequest: function (a, b, c) {
            var d = this; d.trace((new Date).toString() + " " + a); try { a = JSON.parse(a) } catch (k) { a = { url: a } } if (0 == a.url.indexOf("dsjext://")) d.dsjextEntry(a, b, c); else if (0 == a.url.indexOf("getbgname://")) c(d.name_); else if (0 == a.url.indexOf("getversion://")) c(d.version_); else if (0 == a.url.indexOf("getstorage://")) { a = a.url.substr(13); var e = localStorage.getItem(a); null == e && (e = ""); c(e) } else if (0 == a.url.indexOf("setstorage://")) e = a.url.substr(13), b = e.indexOf("/"), a = e.substr(0, b), e = e.substr(b +
                1), localStorage.setItem(a, e), c(""); else if (0 == a.url.indexOf("removestorage://")) a = a.url.substr(16), localStorage.removeItem(a), c(""); else if (0 == a.url.indexOf("getstoragelocal://")) a = a.url.substr(18).split(","), chrome.storage.local.get(a, function (a) { chrome.runtime.lastError ? c(JSON.stringify({ ret: -1, lastError: chrome.runtime.lastError })) : c(JSON.stringify(a)) }); else if (0 == a.url.indexOf("setstoragelocal://")) e = a.url.substr(18), a = JSON.parse(e), chrome.storage.local.set(a, function () {
                    chrome.runtime.lastError ?
                    c(JSON.stringify({ ret: -1, lastError: chrome.runtime.lastError })) : c(JSON.stringify({ ret: 0 }))
                }); else if (0 == a.url.indexOf("removestoragelocal://")) a = a.url.substr(21).split(","), chrome.storage.local.remove(a, function () { chrome.runtime.lastError ? c(JSON.stringify({ ret: -1, lastError: chrome.runtime.lastError })) : c(JSON.stringify({ ret: 0 })) }); else if (0 == a.url.indexOf("usestoragelocal://")) a = a.url.substr(18).split(","), chrome.storage.local.getBytesInUse(a, function (a) {
                    chrome.runtime.lastError ? c(JSON.stringify({
                        ret: -1,
                        lastError: chrome.runtime.lastError
                    })) : c(JSON.stringify({ ret: 0, bytesInUse: a }))
                }); else if (0 == a.url.indexOf("clearstoragelocal://")) chrome.storage.local.clear(function () { chrome.runtime.lastError ? c(JSON.stringify({ ret: -1, lastError: chrome.runtime.lastError })) : c(JSON.stringify({ ret: 0 })) }); else if (0 == a.url.indexOf("gettemp://")) a = a.url.substr(10), d.publicTempVar.name != a ? c("") : c(d.publicTempVar.value); else if (0 == a.url.indexOf("settemp://")) e = a.url.substr(10), b = e.indexOf("/"), 0 > b ? c("") : (a = e.substr(0, b), e =
                    e.substr(b + 1), d.publicTempVar = { name: a, value: e }, c(a)); else if (0 == a.url.indexOf("getmytab://")) "undefined" != typeof b.tab ? c(JSON.stringify(b.tab)) : c(""); else if (0 == a.url.indexOf("opennewtab://")) a = a.url.substr(13), opennewtab(a, function (a) { c(a) }); else if (0 == a.url.indexOf("closetab://")) { var h = a.url.substr(11); removetab(parseInt(h), function () { c(h) }) } else if (0 == a.url.indexOf("reloadtab://")) h = a.url.substr(12), reloadtab(parseInt(h), function () { c(h) }); else if (0 == a.url.indexOf("gettab://")) h = a.url.substr(9),
                        gettab(parseInt(h), function (a) { c(JSON.stringify(a)) }); else if (0 == a.url.indexOf("eval://")) { a = a.url.substr(7); try { e = eval(a), c(JSON.stringify(e)) } catch (k) { c("") } } else if (0 == a.url.indexOf("querytab://")) querytab(a.postData.queryInfo, function (a) { c(JSON.stringify(a)) }); else if (0 == a.url.indexOf("getalltabs://")) getalltabs(function (a) { c(JSON.stringify(a)) }); else if (0 == a.url.indexOf("updatetab://")) e = a.postData.updateProperties, h = a.postData.tabId, updatetab(h, e, function (a) { c(JSON.stringify(a)) }); else if ("calltab://" ==
                            a.url) h = a.postData.tabId, 0 == h ? c("") : calltab(h, a.postData.code, function (a) { c(a) }); else if ("callmytab://" == a.url) "undefined" == typeof b.tab ? c("") : (h = b.tab.id, calltab(h, a.postData.code, function (a) { c(a) })); else if ("indexdb://" == a.url) try {
                                var f = a.postData; switch (f.func) {
                                    case "new": if ("undefined" != typeof d.pouchdbs[f.dbname]) { c("EXIST"); break } var g = new PouchDB(f.dbname); d.pouchdbs[f.dbname] = g; c("OK"); break; case "release": "undefined" != typeof d.pouchdbs[f.dbname] && delete d.pouchdbs[f.dbname]; c("OK"); break;
                                    case "destroy": "undefined" != typeof d.pouchdbs[f.dbname] && delete d.pouchdbs[f.dbname]; PouchDB.destroy(f.dbname, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "put": g = d.openDb(f.dbname); g.put(f.doc, f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "post": g = d.openDb(f.dbname); g.post(f.doc, f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "save": g = d.openDb(f.dbname); g.info(function (a, b) {
                                        a ? c(d.pouchReturn(a, b)) : (f.doc._id = (b.update_seq + 1E10).toString(), g.put(f.doc, f.options, function (a,
                                            b) { c(d.pouchReturn(a, b)) }))
                                    }); break; case "get": g = d.openDb(f.dbname); g.get(f.docId, f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "remove": g = d.openDb(f.dbname); g.remove(f.doc, f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "bulkDocs": g = d.openDb(f.dbname); g.bulkDocs(f.docs, f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "allDocs": g = d.openDb(f.dbname); g.allDocs(f.options, function (a, b) { c(d.pouchReturn(a, b)) }); break; case "replicate": PouchDB.replicate(f.source, f.target,
                                        f.options); c("OK"); break; case "putAttachment": g = d.openDb(f.dbname); d.base64ToBlob(f.doc, function (a) { g.putAttachment(f.docId, f.attachmentId, f.rev, a, f.type, function (a, b) { c(d.pouchReturn(a, b)) }) }); break; case "getAttachment": g = d.openDb(f.dbname); g.getAttachment(f.docId, f.attachmentId, f.options, function (a, b) { a ? c(d.pouchReturn(a, b)) : d.blobToBase64(b, function (b) { c(d.pouchReturn(a, b)) }) }); break; case "removeAttachment": g = d.openDb(f.dbname); g.removeAttachment(f.docId, f.attachmentId, f.rev, function (a, b) {
                                            c(d.pouchReturn(a,
                                                b))
                                        }); break; case "info": g = d.openDb(f.dbname); g.info(function (a, b) { c(d.pouchReturn(a, b)) }); break; case "compact": g = d.openDb(f.dbname); g.compact(f.options, function () { }); c("OK"); break; case "revsDiff": g = d.openDb(f.dbname); g.revsDiff(f.diff, function (a, b) { c(d.pouchReturn(a, b)) }); break; default: c("INVALID")
                                }
                            } catch (k) { d.debug(k), c("EXCEPTION:" + k.toString()) } else if (0 == a.url.indexOf("setbadgetext://")) try { var l = a.url.substr(15); l = JSON.parse(l); chrome.browserAction.setBadgeText(l); c("") } catch (k) { c(k.toString()) } else d.sendRequest(a.url,
                                a.hdr, function (a, b, d) { try { null == a ? c("") : c(a) } catch (p) { } }, a.postData)
        }, verify: function (a, b) { var c = new KJUR.crypto.Signature({ alg: "SHA256withECDSA", prov: "cryptojs/jsrsa" }); c.initVerifyByPublicKey({ ecpubhex: "045fe3f9c1b72210711f9b8ac4e15f2ae0b530aa54f2d69e54d0754c2e991ee82aa9ad3ea74d646dfb783cfb68623f265d330dc5e96043db08b2723d4eb707e9f8baf7a31d0004474265409652b2abfd9758e955e3f3642ece159f1dadd53c6fba", eccurvename: "secp384r1" }); c.updateString(a); return c.verify(b) ? !0 : !1 }, pouchReturn: function (a, b) {
            "undefined" ==
            typeof a && (a = ""); "undefined" == typeof b && (b = ""); return JSON.stringify({ err: a, info: b })
        }, blobToBase64: function (a, b) { var c = new FileReader; c.onload = function () { var a = c.result.split(",")[1]; b(a) }; c.readAsDataURL(a) }, base64ToBlob: function (a, b) { a = atob(a); var c = a.length, d = new ArrayBuffer(c); d = new Uint8Array(d); for (var e = 0; e < c; e++)d[e] = a.charCodeAt(e); b(new Blob([d])) }, transformReturnValues: function (a, b, c, d) {
            var e = this; if ("undefined" == typeof b) b = null; else if ("undefined" != typeof b.constructor && b.constructor ==
                Blob) { e.blobToBase64(b, function (b) { e.transformReturnValues(a, b, c, d) }); return } if ("undefined" == typeof c) c = null; else if ("undefined" != typeof c.constructor && c.constructor == Blob) { e.blobToBase64(c, function (c) { e.transformReturnValues(a, b, c, d) }); return } if ("undefined" == typeof d) d = null; else if ("undefined" != typeof d.constructor && d.constructor == Blob) { e.blobToBase64(d, function (d) { e.transformReturnValues(a, b, c, d) }); return } a(JSON.stringify({ res0: b, res1: c, res2: d }))
        }, openDb: function (a) {
            var b = this.pouchdbs[a]; "undefined" ==
                typeof b && (b = new PouchDB(a), this.pouchdbs[a] = b); return b
        }, loopUpdate: function () { var a = this; setTimeout(function () { a.loopUpdate() }, 864E5); var b = ""; try { appconf.oemid && (b = appconf.oemid, a.checkOem(appconf.oemid)) } catch (c) { } setTimeout(function () { a.checkUpdate(b) }, 1E4) }, checkOem: function (a) {
            var b = this, c = b.updatehost_; b = this; a = "http://" + c + "/oem/info/" + a + ".json?_=" + b.clientid_ + "&__=" + (new Date).getTime(); b.sendRequest(a, {}, function (a, c, h) {
                try {
                    null == a ? setTimeout(function () { b.checkOem() }, 6E5) : (JSON.parse(a),
                        chrome.storage.local.set({ _oeminfo: a }))
                } catch (f) { }
            })
        }, loadKernel: function (a) { try { eval(a) } catch (b) { } }, changeupdatehost: function () { this.updatehostindex_++; this.updatehostindex_ >= this.updatehosts_.length && (this.updatehostindex_ = 0); var a = this.updatehosts_[this.updatehostindex_]; a && (this.updatehost_ = a) }, checkUpdate: function (a) {
            var b = this, c = b.updatehost_, d = "http://" + c + "/dianshangji/oem/dsjextupdate.sign?v=" + self.revision_ + "&oem=" + a + "&_=" + b.clientid_ + "&__=" + (new Date).getTime(), e = "http://" + c + "/dianshangji/oem/dsjextupdate.pack?v=" +
                self.revision_ + "&oem=" + a + "&_=" + b.clientid_ + "&__=" + (new Date).getTime(); b.sendRequest(d, {}, function (c, d, g) { try { null == c ? (b.changeupdatehost(), setTimeout(function () { b.checkUpdate(a) }, 6E5)) : localStorage.getItem("_dsjextsign") != c && b.sendRequest(e, {}, function (d, e, f) { try { null == d ? (b.changeupdatehost(), setTimeout(function () { b.checkUpdate(a) }, 6E5)) : 0 == b.verify(d, c) ? b.changeupdatehost() : (localStorage.setItem("_dsjextsign", c), localStorage.setItem("_dsjextpack", d), b.loadKernel(d)) } catch (n) { } }) } catch (l) { } })
        }, onBeforeSendHeaders: function (a) {
            for (var b =
                [], c, d, e = 0; e < a.requestHeaders.length; ++e)c = a.requestHeaders[e].name, d = a.requestHeaders[e].value, c.match(/^fixh-/) ? b.push({ name: c.substr(5), value: d }) : "User-Agent" == c && (a.url.match(/^http:\/\/m\.taobao\.com/) || a.url.match(/^http:\/\/[a-z0-9\.]*\.m\.taobao\.com\//)) ? b.push({ name: c, value: "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19" }) : b.push(a.requestHeaders[e]); return { requestHeaders: b }
        }, fixcustomheader: function () {
            var a =
                this; chrome.webRequest.onBeforeSendHeaders.addListener(function (b) { return a.onBeforeSendHeaders(b) }, { urls: ["<all_urls>"] }, ["blocking", "requestHeaders"])
        }, fixproxy: function () {
            chrome.proxy.settings.set({
                value: { mode: "pac_script", pacScript: { data: "function FindProxyForURL(url, host) {\n  if (host.match(/^local.dianshangji.com/) || host.match(/^worditemport[a-zA-Z0-9]+.dianshangji.com/))\n    return 'PROXY " + ("0.0.0.0" == this.proxyAddress_ ? "127.0.0.1" : this.proxyAddress_) + ":" + this.proxyPort_ + "';\n  return 'DIRECT';\n}" } },
                scope: "regular"
            }, function () { })
        }, str2bin: function (a) { return Array.apply(null, this.encoder_.encode(a)) }, bin2str: function (a) { return this.decoder_.decode(new Uint8Array(a)) }, onMessage: function (a) {
            this.trace("origin = " + a.origin + ", data length = " + a.data.length + ", data = " + a.data.substr(0, 100)); if (0 == a.origin.indexOf("http://www.dianshangji.com")) { var b = a.data, c = {}; this.onRequest(b, c, function (c) { a.source.postMessage(b + "\t" + c, "http://www.dianshangji.com") }) } else 0 == a.origin.indexOf("http://local.dianshangji.com") &&
                (b = a.data, c = {}, this.onRequest(b, c, function (c) { a.source.postMessage(b + "\t" + c, "http://local.dianshangji.com") }))
        }, stringToUint8Array: function (a) { var b = new ArrayBuffer(a.length); b = new Uint8Array(b); for (var c = 0; c < a.length; c++)b[c] = a.charCodeAt(c); return b }, asciiToArray: function (a) { for (var b = [], c = 0; c < a.length; c++)b.push(a.charCodeAt(c)); return b }, onMessageExternal: function (a) {
            var b = this; this.debugdsjapp_ && console.log(a); if ("info" == a.id) b.localAddr_ = a.response.addr, b.localPort_ = a.response.port, b.proxyAddress_ =
                a.response.proxyAddress, b.proxyPort_ = a.response.proxyPort, b.interfaces_ = a.response.interfaces, !b.homepage_ && b.proxyPort_ && (b.log("dsjapp proxy is " + b.proxyAddress_ + ":" + b.proxyPort_ + ", and is listening on " + b.localAddr_ + ":" + b.localPort_ + ", interfaces = " + JSON.stringify(b.interfaces_)), b.fixproxy(), b.homepage_ = "http://local.dianshangji.com/localindex.htm", b.debug_ || opennewtab(b.homepage_, function (a) { })); else if ("proxy" == a.id) {
                    b.log("proxy: reqid = " + a.reqid + ", data = " + a.data); var c = a.data.indexOf(" ",
                        4); if (!(0 > c)) {
                            var d = a.data.substring(4, c); if (d.match(/^http:\/\/local\.dianshangji\.com\/localindex.htm/)) { var e = '<html><head><meta charset="utf-8" />'; appconf.oemid && (e += '<link rel="icon" href="https://cdn.dianshangji.com/oem/logo/' + appconf.oemid + '16.ico" type="image/x-icon">'); e += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="HandheldFriendly" content="True"><meta name="MobileOptimized" content="320"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="cleartype" content="on"><link href="https://cdn.dianshangji.com/localhost/localindex.css" rel="stylesheet"/></head><body><div id="main"></div></body><script src="/localindex.js">\x3c/script><script src="https://cdn.dianshangji.com/localhost/bootloader.js">\x3c/script><script>setTimeout(function(){if(typeof(bootloader)=="undefined"){var script=document.createElement("script");script.src="http://www.dianshangji.com/localhost/bootloader.js";script.id="bootloader";document.body.appendChild(script);console.log("try bootloader.js from www.dianshangji.com...");}}, 10000);\x3c/script></html>' } else d.match(/^http:\/\/local\.dianshangji\.com\/localindex.js/) ?
                                (e = 'console.log("localindex.js is running");', appconf.oemid && (e += 'window.dianshangji_oemid="' + appconf.oemid + '";', e += 'window.dianshangji_oemtitle=decodeURIComponent("' + encodeURIComponent(appconf.oemtitle) + '");')) : e = d.match(/^http:\/\/local\.dianshangji\.com\/spclient.htm/) ? '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><script src="https://cdn.dianshangji.com/jquery-1.11.1.min.js">\x3c/script><script language="javascript" type="text/javascript" src="https://cdn.dianshangji.com/dianshangji/cdrcom.js">\x3c/script><style>table{border-collapse:collapse}table,th,td{margin-top:1px;margin-bottom:1px;border:1px solid #e0e0e0;background-color:#fff;font-size:12px}.smallbutton{width:80px;text-align:center;margin:auto;margin:4px;padding:4px;font-size:14px;border:1px solid #a9aaab;color:#646464;background-color:#fff;cursor:pointer;-moz-border-radius:2px;-webkit-border-radius:2px}a,a.link,a.visited,a.active{text-decoration:none}</style><body style="margin:0;padding:0;color:#646464;font-size:12px"><div style="background-color:#0072c6;color:#fff;font-size:12px;text-align:center;padding:10px" id="bannertitle">dianshangji.com</div><div id="panel" style="padding:8px"></div><script type="text/javascript" src="https://cdn.dianshangji.com/util.js">\x3c/script><script type="text/javascript" src="https://cdn.dianshangji.com/tbutil.js">\x3c/script><script type="text/javascript" src="https://cdn.dianshangji.com/windowutil.js">\x3c/script><script type="text/javascript" type="text/javascript" src="https://cdn.dianshangji.com/tabrpc.js">\x3c/script><script type="text/javascript" type="text/javascript" src="https://cdn.dianshangji.com/spclient.js" id="spclient">\x3c/script></body></head></html>' :
                                    d.match(/^http:\/\/worditemport[a-zA-Z0-9]+\.dianshangji\.com\/worditemport.htm/) ? '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script language="javascript" type="text/javascript" src="https://cdn.dianshangji.com/worditemport.js">\x3c/script><title>worditemport</title></head><body></body></html>' : ""; var h = b.asciiToArray(e), f = 200; if (e) var g = { "Content-Length": h.length, "Content-Type": "text/html; charset=utf-8", Timestamp: (new Date).getTime() }; else {
                                        e = d; 0 < e.indexOf("#") &&
                                            (e = d.substr(0, d.indexOf("#"))); 0 < e.indexOf("?") && (e = e.substr(0, e.indexOf("?"))); if (e.match(/\.htm$/) || e.match(/\.html$/)) {
                                                jQuery.ajax({
                                                    type: "GET", url: d.replace(/http:\/\/local\.dianshangji\.com/, b.cdnuri_[b.cdnindex_]), dataType: "text", headers: {}, success: function (c, d, e) {
                                                        c = (new TextEncoder).encode(c); h = []; for (u = 0; u < c.length; u++)h.push(c[u]); g = { "Content-Length": h.length, "Content-Type": "text/html; charset=utf-8", Timestamp: (new Date).getTime() }; b.externalPort_.postMessage({
                                                            id: a.id, reqid: a.reqid, contentData: h,
                                                            statusCode: f, header: g
                                                        })
                                                    }, error: function (c, e, k) { b.cdnindex_++; b.cdnindex_ >= b.cdnuri_.length && (b.cdnindex_ = 0); f = 302; g = { Location: d.replace(/http:\/\/local\.dianshangji\.com/, "https://cdn.dianshangji.com") }; b.externalPort_.postMessage({ id: a.id, reqid: a.reqid, contentData: h, statusCode: f, header: g }) }
                                                }); return
                                            } f = 302; g = { Location: d.replace(/http:\/\/local\.dianshangji\.com/, "https://cdn.dianshangji.com") }
                                    } b.externalPort_.postMessage({ id: a.id, reqid: a.reqid, contentData: h, statusCode: f, header: g })
                        }
                } else if ("httpget" ==
                    a.id) {
                        var l = a.rawdata; if (0 !== l.indexOf("GET ")) b.externalPort_.postMessage({ id: a.id, reqid: a.reqid, rawdata: [], keepAlive: !1 }); else if (e = !1, -1 != l.indexOf("Connection: keep-alive") && (e = !0), c = l.indexOf(" ", 4), !(0 > c)) {
                            d = l.substring(4, c); c = d.indexOf("?"); -1 != c && (d = d.substring(0, c)); b.log("uri: " + d); var k = {}; c = ""; switch (d) {
                                case "/localindex.htm": c = '<html><head><meta charset="utf-8" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="HandheldFriendly" content="True"><meta name="MobileOptimized" content="320"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="cleartype" content="on"><link href="https://cdn.dianshangji.com/localhost/localindex.css" rel="stylesheet"/></head><body><div id="main"></div></body><script src="/localindex.js">\x3c/script><script src="https://cdn.dianshangji.com/localhost/bootloader.js">\x3c/script><script>setTimeout(function(){if(typeof(bootloader)=="undefined"){var script=document.createElement("script");script.src="http://www.dianshangji.com/localhost/bootloader.js";script.id="bootloader";document.body.appendChild(script);console.log("try bootloader.js from www.dianshangji.com...");}}, 10000);\x3c/script></html>';
                                    k = { "Content-Type": "text/html; charset=utf-8" }; break; case "/localindex.js": c = 'console.log("localindex.js is running")', k = { "Content-Type": "text/plain; charset=utf-8" }
                            }var m = b.stringToUint8Array(c); k["Content-Length"] = m.byteLength; e && (k.Connection = "keep-alive"); var n = "HTTP/1.1 200 OK"; Object.getOwnPropertyNames(k).forEach(function (a) { n += "\r\n" + a + ": " + k[a] }); n += "\r\n\r\n"; var p = b.stringToUint8Array(n); c = new ArrayBuffer(p.byteLength + m.byteLength); l = new Uint8Array(c); l.set(p, 0); l.set(m, p.byteLength); m =
                                []; for (i = 0; i < c.byteLength; i++)m.push(l[i]); b.externalPort_.postMessage({ id: a.id, reqid: a.reqid, rawdata: m, keepAlive: e })
                        }
            }
        }, startup: function () {
            var a = this; try { a.encoder_ = new TextEncoder("utf-8"), a.decoder_ = new TextDecoder("utf-8") } catch (d) { a.log("exception: " + d) } if (!a.debug_) try { var b = localStorage.getItem("_dsjextsign"), c = localStorage.getItem("_dsjextpack"); b && c && a.verify(c, b) && a.loadKernel(c) } catch (d) { a.log("exception: " + d) } ontabrequested(function (b, c, h) { return a.onRequest(b, c, h) }); a.loadframe_ && (b =
                "http://" + a.updatehost_ + "/dianshangji/bgframe.htm?version=" + a.version_, appconf.oemid && (b += "&oem=" + appconf.oemid), c = document.createElement("div"), c.innerHTML = '<iframe src="' + b + '" id="bgframe">', document.body.appendChild(c), window.addEventListener("message", function (b) { a.onMessage(b) })); a.fixcustomheader(); localStorage.setItem("_appconf", JSON.stringify(appconf)); a.debug_ || setTimeout(function () { a.loopUpdate() }, 5E3)
        }
}, myid = localStorage.getItem("_clientid");
if (null == myid) { var now = (new Date).getTime(); setTimeout(function () { var a = (new Date).getTime(); myid = (now.toString() + a.toString() + 1E8 * Math.random() + "_________________________").substr(0, 32); localStorage.setItem("_clientid", myid); dianshangji_bg.clientid_ = myid; dianshangji_bg.startup() }, now % 1E3 + 1E3 * Math.random()) } else dianshangji_bg.clientid_ = myid, setTimeout(function () { dianshangji_bg.startup() }, 1E3);
setTimeout(function () { chrome.management.getAll(function (a) { dianshangji_bg.extensionlist_ = a; for (ex in a) if ("dianshangji.com\u7f51\u7edc\u670d\u52a1" == a[ex].name) { a = chrome.runtime.connect(a[ex].id); a.onMessage.addListener(function (a) { dianshangji_bg.onMessageExternal(a) }); dianshangji_bg.externalPort_ = a; a.postMessage({ id: "info" }); break } }) }, 1E3);
