Skip to content

Instantly share code, notes, and snippets.

@goldengrape
Created April 20, 2026 19:36
Show Gist options
  • Select an option

  • Save goldengrape/881801d7e932cef236b4c7f64c18f207 to your computer and use it in GitHub Desktop.

Select an option

Save goldengrape/881801d7e932cef236b4c7f64c18f207 to your computer and use it in GitHub Desktop.
pubmed-to-scholar-archive
请写一个 Chrome Manifest V3 扩展,只作用于 PubMed 文章详情页(例如 https://pubmed.ncbi.nlm.nih.gov/30110311/ )。
需求:
1. 从页面提取 DOI、PMID、标题。
2. 在页面的 Full text links 附近插入一个小面板。
3. 面板中放一个提交到 https://scholar.archive.org/search 的 HTML form。
4. form 必须使用 method="post" 和 target="_blank"。
5. form 的 q 字段默认优先使用 DOI 查询,其次 PMID,再次标题。
6. DOI 查询格式必须是 doi:10.1364/JOSAA.35.001180,不要给 DOI 加引号。
7. PMID 查询格式是 pmid:30110311。
8. 标题查询格式可以是 "Binocular system with asymmetric eyes"。
9. UI 里提供 DOI / PMID / 标题 三个切换按钮,点击后切换当前 form 的 q 值。
10. 不要使用 background script,不要 fetch scholar.archive.org,不要解析 PDF,不要用 MutationObserver 监听整页。
11. 只输出最小必要文件:manifest.json、content.js,必要时可加 README.md。
12. 代码要求简单、可读、稳妥。
请直接给出完整代码。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment