fix worker not found, progress checker still needs work

This commit is contained in:
Mantao Huang 2026-03-08 12:11:34 -05:00
parent b017e208a2
commit b4a7555104

View File

@ -91,15 +91,14 @@ async def save_to_zotero(url, headless_mode="new"):
print("[*] Finding Zotero Connector service worker...") print("[*] Finding Zotero Connector service worker...")
worker = None worker = None
for i in range(10): for i in range(60):
for w in browser_context.service_workers: for w in browser_context.service_workers:
if EXTENSION_ID in w.url: if "background-worker.js" in w.url or "zotero" in w.url:
worker = w worker = w
break break
if worker: if worker:
break break
await asyncio.sleep(0.5) await asyncio.sleep(0.5)
if not worker: if not worker:
print("[!] Could not find Zotero extension service worker.") print("[!] Could not find Zotero extension service worker.")
else: else: