export function renderMarketAuthGate( document: Document, currentWindow: Window ): HTMLElement { const existingGate = document.querySelector( '[data-market-auth-gate="root"]' ) as HTMLElement | null; if (existingGate) { return existingGate; } const root = document.createElement("section"); root.dataset.marketAuthGate = "root"; root.innerHTML = ` 请先登录插件
打开扩展弹窗完成登录后刷新本页
`; root .querySelector('[data-market-auth-help="button"]') ?.addEventListener("click", () => { currentWindow.alert("请点击浏览器工具栏中的扩展图标完成登录"); }); document.body.prepend(root); return root; }