PageSourceSearch

https://anchor-plus.info/assets/extension-bridge-Tzgh4fRK.js

js anchor-plus.info collected 2026-10-02 01:57:43 UTC 2,270 bytes, 1 lines download raw bytes

1import{t as e}from"./account-session-X-ArS05r.js";import{d as t,f as n,i as r,m as i,n as a,p as o,s}from"./contracts-DeT8v0QM.js";function c(){return typeof window>`u`?null:{window,origin:window.location.origin,setTimer:(e,t)=>window.setTimeout(e,t),clearTimer:e=>window.clearTimeout(e)}}function l(e,t){e.window.postMessage(t,e.origin)}function u(e=8e3,r=c()){if(!r)return Promise.reject(Error(`请在浏览器中打开账号中心`));let s=n();return new Promise((n,c)=>{let u=!1,d=()=>{u||(u=!0,r.window.removeEventListener(`message`,f),r.clearTimer(p))},f=e=>{if(!i(e,{source:`anchor-query-extension`,type:`BILIBILI_IDENTITY_RESPONSE`,nonce:s},{expectedWindowSource:r.window,origin:r.origin}))return;d();let t=e.data;if(o(t)){if(t.success!==!0){c(Object.assign(Error(t.error||`无法读取当前 B 站登录信息`),{code:t.code}));return}if(!t.data){c(Error(`无法读取当前 B 站登录信息`));return}n(t.data)}},p=r.setTimer(()=>{d(),c(Error(`未检测到插件,请确认已安装并重新加载插件`))},e);r.window.addEventListener(`message`,f),l(r,{source:t,type:a,nonce:s})})}function d(e=500,a=c()){if(!a)return Promise.resolve(!1);let o=n();return new Promise(n=>{let s=!1,c=e=>{s||(s=!0,a.window.removeEventListener(`message`,u),a.clearTimer(d),n(e))},u=e=>{i(e,{source:`anchor-query-extension`,type:`EXTENSION_BRIDGE_READY`,nonce:o},{expectedWindowSource:a.window,origin:a.origin})&&c(!0)},d=a.setTimer(()=>c(!1),e);a.window.addEventListener(`message`,u),l(a,{source:t,type:r,nonce:o})})}function f(t,n=8e3,r=c()){return!r||!t?Promise.resolve(`UNAVAILABLE`):new Promise(i=>{let a=!1,o=t=>{a||(a=!0,r.window.removeEventListener(e,s),r.clearTimer(c),i(t))},s=e=>{let n=e.detail;n?.accountId===t&&o(n.status||`UNAVAILABLE`)},c=r.setTimer(()=>o(`TIMEOUT`),n);r.window.addEventListener(e,s)})}function p(e,r=800,a=c()){if(!a||!e)return Promise.resolve();let o=n();return new Promise(n=>{let c=!1,u=()=>{c||(c=!0,a.window.removeEventListener(`message`,d),a.clearTimer(f),n())},d=e=>{i(e,{source:`anchor-query-extension`,type:`ACCOUNT_LOGOUT_RESPONSE`,nonce:o},{expectedWindowSource:a.window,origin:a.origin})&&u()},f=a.setTimer(u,r);a.window.addEventListener(`message`,d),l(a,{source:t,type:s,nonce:o,accountId:e})})}export{d as i,u as n,f as r,p as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.