Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(extension): expand vertical and article platform clipping (#578)

LuoQianhong1bb958000748
diff --git a/apps/extension/article-clip.test.mjs b/apps/extension/article-clip.test.mjs
new file mode 100644
index 00000000..d4d110bd
--- /dev/null
+++ b/apps/extension/article-clip.test.mjs
@@ -0,0 +1,321 @@
+import { expect, test } from "bun:test";
+import { readFileSync } from "node:fs";
+import { createDocument } from "@mixmark-io/domino";
+import { readArticle } from "./src/article-clip.ts";
+import { readJike } from "./src/jike-clip.ts";
+import { readDouban, doubanCommentTarget } from "./src/douban-clip.ts";
+import { isPlatformClip, platformTarget, socialPlatform } from "./src/platform-clip.ts";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
+
+const urls = {
+ wechat:"https://mp.weixin.qq.com/s/TC-ONpL3PGklsD0yhtcuBQ",sspai:"https://sspai.com/post/92653",juejin:"https://juejin.cn/post/6972051526416072717",
+ jike:"https://m.okjike.com/originalPosts/66ac89b0314f5cced41012d3","jike-grid":"https://m.okjike.com/originalPosts/6715e824d9dc81724c2ec74d","jike-long":"https://m.okjike.com/originalPosts/64c9dd9a2edae6abdc610605",
+ "douban-book":"https://book.douban.com/review/16093028/","douban-movie":"https://movie.douban.com/review/17798662/","douban-music":"https://music.douban.com/review/17855287/","douban-note":"https://www.douban.com/note/814698224/",
+};
+const fixture=(name)=>createDocument(readFileSync(new URL(`./fixtures/platforms/${name}.html`,import.meta.url),"utf8"));
+const read=(name,doc=fixture(name))=>name.startsWith("jike") ? readJike(doc,urls[name]) : name.startsWith("douban") ? readDouban(doc,platformTarget(urls[name]),urls[name]) : readArticle(doc,urls[name],"公众号");
+
+test("article URLs normalize aliases and tracking, retaining only WeChat query identity/signature",()=>{
+ for (const [name,url] of Object.entries(urls)) expect(platformTarget(url+"?from=share#comments")?.url).toBe(url);
+ const long="https://mp.weixin.qq.com/s?__biz=MzA%3D%3D&mid=123&idx=1&sn=abc&scene=21&pass_ticket=unused";
+ expect(platformTarget(long)).toEqual({platform:"wechat",id:"MzA==/123/1",url:"https://mp.weixin.qq.com/s?__biz=MzA%3D%3D&mid=123&idx=1&sn=abc"});
+ expect(platformTarget(long.replace("&sn=abc", ""))?.platform).toBe("wechat");
+ expect(platformTarget(long+"&mid=456")).toBeNull();
+ expect(platformTarget(urls.jike.replace("m.okjike.com/originalPosts", "web.okjike.com/originalPost"))?.url).toBe(urls.jike);
+ for (const url of [urls.wechat.replace("mp.weixin.qq.com","mp.weixin.qq.com.evil.test"),urls.sspai+"/extra",urls.juejin.replace("https:","http:"),urls["douban-book"].replace("https://","https://u:p@"),"https://mp.weixin.qq.com/","https://sspai.com/","https://juejin.cn/","https://web.okjike.com/"]) expect(platformTarget(url)).toBeNull();
+});
+
+for(const [name,author,images] of [["wechat","陈云亮",21],["sspai","北鸮",9],["juejin","小和山的菜鸟们",2],["jike","汐笺",1],["jike-grid","彗星咻咻咻",9],["jike-long","泛函",1],["douban-book","完颜打骨折",6],["douban-movie","希音",2],["douban-note","孩子气概",6],["douban-music",null,3]]) {
+ test(`${name}: real DOM retains own text/author/images and satisfies the save contract`,()=>{
+ const result=read(name); expect(result.ok).toBe(true);
+ if(author) expect(result.clip.author).toBe(author);
+ expect([...result.clip.markdown.matchAll(/!\[/g)]).toHaveLength(images);
+ expect(isPlatformClip(result.clip,platformTarget(urls[name]))).toBe(true);
+ expect(result.clip.markdown).not.toMatch(/javascript:|<script|写留言|收集各项错误|检查视图/);
+ });
+}
+
+test("WeChat keeps its account, author, declared cover and lazy image URLs while excluding share/reward controls",()=>{
+ const result=read("wechat");
+ expect(result.clip.markdown).toContain("公众号: 大数据架构之道");
+ expect(result.clip.markdown).toContain("选择模型进行对话");
+ expect(result.clip.markdown).toContain("https://mmbiz.qpic.cn/");
+ expect(result.clip.markdown).not.toContain("喜欢作者");
+ expect(result.clip.markdown).not.toContain("wx_lazy=1");
+ expect(result.clip.publishedAt).toEqual({value:"2025-02-22T23:02:00",precision:"datetime"});
+});
+
+test("Sspai retains its update as a quote with displayed time, bold title and complete body after the original article",()=>{
+ const doc=fixture("sspai"),original=doc.body.outerHTML,result=read("sspai",doc);
+ expect(result.ok).toBe(true);
+ expect(result.clip.markdown).toContain("> 以下内容于 10:00更新\n>\n> **中国大陆推出睡眠呼吸暂停迹象提示功能**\n>\n> 2026 年 10 月 14 日,Apple 在中国大陆正式推出 Apple Watch 睡眠呼吸暂停迹象提示功能,文章根据相关信息更新并重推。");
+ expect(result.clip.markdown.indexOf("> **中国大陆推出")).toBeGreaterThan(result.clip.markdown.indexOf("手腕上的「心率检测」靠谱吗"));
+ expect(result.clip.markdown.match(/中国大陆推出睡眠呼吸暂停迹象提示功能/g)).toHaveLength(1);
+ expect(result.clip.publishedAt).toEqual({value:"2024-10-10",precision:"date"});
+ expect(result.clip.markdown).not.toContain("42位派友已充电");
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("Sspai update blocks stay scoped and ordered, keeping rich content while omitting hidden or missing metadata",()=>{
+ const doc=fixture("sspai"),updates=doc.querySelector('.update__details__wrapper');
+ const later=doc.querySelector('.update-details-item').cloneNode(true);later.id='update-1';
+ later.querySelector('.update-title').textContent='后续更正';
+ later.querySelector('.update-date').textContent='以下内容于 昨天 18:30更新';
+ later.querySelector('.update-body').innerHTML='<p>补充说明 <a href="https://example.test/source">官方来源</a></p><pre><code class="language-js">const corrected = true;</code></pre><img data-src="https://example.test/update.png">';
+ later.insertAdjacentHTML('beforeend','<button>不应保存的互动控件</button><p>不应保存的推荐信息</p>');updates.appendChild(later);
+ const unrelated=later.cloneNode(true);unrelated.querySelector('.update-body').textContent='其他区域的同名更新';doc.body.appendChild(unrelated);
+ const result=read('sspai',doc);expect(result.ok).toBe(true);
+ expect(result.clip.markdown.indexOf('> **后续更正**')).toBeGreaterThan(result.clip.markdown.indexOf('> **中国大陆推出'));
+ for(const text of ['以下内容于 昨天 18:30更新','[官方来源](https://example.test/source)','> ```js\n> const corrected = true;','> ![](https://example.test/update.png)']) expect(result.clip.markdown).toContain(text);
+ for(const text of ['不应保存的互动控件','不应保存的推荐信息','其他区域的同名更新']) expect(result.clip.markdown).not.toContain(text);
+ expect(result.clip.markdown.match(/!\[/g)).toHaveLength(10);
+ later.querySelector('.update-title').remove();later.querySelector('.update-date').setAttribute('hidden','');
+ const optional=read('sspai',doc);expect(optional.ok).toBe(true);expect(optional.clip.markdown).toContain('补充说明');expect(optional.clip.markdown).not.toContain('昨天 18:30');
+ updates.setAttribute('style','display:none');
+ const hidden=read('sspai',doc);expect(hidden.ok).toBe(true);expect(hidden.clip.markdown).not.toContain('2026 年 10 月 14 日');expect(hidden.clip.markdown).not.toContain('补充说明');
+});
+
+test("Sspai authors remain within the selected article, retaining coauthors and optional absence",()=>{
+ const doc=fixture("sspai"),article=doc.querySelector("article.normal-article"),own=article.querySelector('.article__header__author');
+ const outside=own.cloneNode(true);outside.querySelectorAll('.ss__user__nickname > span').forEach(node=>node.textContent='OTHER ARTICLE AUTHOR');doc.body.insertBefore(outside,article);
+ const coauthor=own.cloneNode(true);coauthor.querySelectorAll('.ss__user__nickname > span').forEach(node=>node.textContent='合著者');own.after(coauthor);
+ const hidden=own.cloneNode(true);hidden.querySelectorAll('.ss__user__nickname > span').forEach(node=>node.textContent='HIDDEN AUTHOR');hidden.style.display='none';own.after(hidden);
+ const result=read('sspai',doc);expect(result.ok).toBe(true);expect(result.clip.author).toBe('北鸮, 合著者');
+ expect(result.clip.publishedAt).toEqual({value:'2024-10-10',precision:'date'});
+ Array.from(article.querySelectorAll('.article__header__author')).forEach(node=>node.remove());
+ const optional=read('sspai',doc);expect(optional.ok).toBe(true);expect(optional.clip.author).toBeUndefined();
+});
+
+test("WeChat removes the article's own follow banner, decorative dividers, ad widgets and trailing recommendation",()=>{
+ const doc=fixture("wechat"),original=doc.body.outerHTML,result=read("wechat",doc);
+ expect(result.ok).toBe(true);
+ for(const noise of ["点击上方蓝字","关于我们","分割线","现阶段的AI没有推理能力","DRPKCGMAPjK","iaic5Jv7oDhWHr79"]) expect(result.clip.markdown).not.toContain(noise);
+ for(const text of ["什么是Deepseek V3","model='deepseek-reasoner'","点击右上角","选择模型进行对话","至此,可以体验由华为云昇腾AI芯片提供的满血版DeepSeek R1"]) expect(result.clip.markdown).toContain(text);
+ for(const model of ["DeepSeek-R1-671B-32K","DeepSeek-V3-671B-32K","DeepSeek-R1-671B-8K","DeepSeek-V3-671B-8K","DeepSeek-V3-671B-4K","DeepSeek-R1-671B-4K"]) expect(result.clip.markdown).toContain(model);
+ const clean=fixture("wechat");clean.querySelector("mp-common-cpsad").innerHTML='<p>广告短剧:立即观看</p><img src="https://example.test/ad-cover.png">';
+ expect(read("wechat",clean).clip.markdown).not.toContain("广告短剧");expect(read("wechat",clean).clip.markdown).not.toContain("ad-cover.png");
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("WeChat keeps tutorial actions, quoted follow wording, meaningful GIFs and inline article references",()=>{
+ const doc=fixture("wechat"),body=doc.querySelector("#js_content");
+ body.innerHTML='<p>教程示例:点击上方蓝字是常见的关注话术。</p><blockquote><p>点击上方蓝字,关注我们</p></blockquote><pre><code>点击上方蓝字,关于我们</code></pre><p>点击右上角“注册”,按要求填写即可。</p><p><img class="__bg_gif" alt="模型推理过程" data-src="https://example.test/reasoning.gif"></p><p>参见 <a href="https://mp.weixin.qq.com/s/reference">相关教程</a>,继续下面的步骤。</p><section><a href="https://mp.weixin.qq.com/s/inline"><span class="h5_image_link"><img src="https://example.test/inline.png"></span>文章引用</a></section><p>正文在引用之后继续。</p><p><a href="https://example.test/conclusion">结论来源</a></p>';
+ const result=read("wechat",doc);expect(result.ok).toBe(true);
+ for(const text of ["点击上方蓝字是常见的关注话术","关注我们","关于我们","点击右上角","reasoning.gif","[相关教程]","文章引用","inline.png","正文在引用之后继续","[结论来源]"]) expect(result.clip.markdown).toContain(text);
+});
+
+test("WeChat restores the real article's styled sections and nested step headings without changing its title",()=>{
+ const doc=fixture("wechat"),original=doc.body.outerHTML,result=read("wechat",doc);
+ expect(result.ok).toBe(true);
+ expect(result.clip.title).toBe("华为云DeepSeek-R1&V3满血版体验:10分钟让你轻松掌握AI大模型应用技巧!");
+ expect(result.clip.markdown.match(/^#{2,6} .+$/gm).map(line=>line.replace(/\s+/g,' '))).toEqual([
+ "## 什么是Deepseek V3","## 什么是DeepSeek R1","## 华为云ModelAart Studio(MaaS)",
+ "### 第一步:注册华为云账号","### 第二步:领取免费tokens","### 第三步:安装cherry studio","### 第四步:配置并使用cherry studio",
+ ]);
+ expect(result.clip.markdown.match(/!\[/g)).toHaveLength(21);
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("WeChat keeps bold prose, ordinary numbered actions, quotes, code and captions out of inferred headings",()=>{
+ const doc=fixture("wechat"),body=doc.querySelector("#js_content");
+ body.innerHTML='<p style="font-size:14px">这是一段说明正文。它用于解释下面的操作和普通排版,包含足够的实际内容。</p><p style="font-size:14px"><strong>这是一段完整加粗的正文。</strong></p><p style="font-size:14px"><span style="font-size:24px">首</span>字放大,其余还是正文。</p><p style="font-size:16px">这一段字号略大,但仍是正文说明。</p><p>1.点击添加模型</p><p>第一步:完成注册,再继续操作。</p><p>第二步:检查输入,然后确认。</p><blockquote><p style="font-size:24px">引用中的排版</p></blockquote><pre><code>第一步:代码示例</code></pre><figure><figcaption><p style="font-size:24px">图片说明</p></figcaption></figure><h4>原有四级标题</h4>';
+ const result=read("wechat",doc);expect(result.ok).toBe(true);
+ expect(result.clip.markdown.match(/^#{1,6} .+$/gm)).toEqual(['#### 原有四级标题']);
+ expect(result.clip.markdown).toContain('**这是一段完整加粗的正文。**');
+ for(const text of ['1.点击添加模型','第一步:完成注册','第二步:检查输入','引用中的排版','第一步:代码示例','图片说明']) expect(result.clip.markdown).toContain(text);
+});
+
+test("WeChat preserves distinct typography levels and leaves a lone step label as prose",()=>{
+ const doc=fixture("wechat"),body=doc.querySelector("#js_content");
+ body.innerHTML='<p style="font-size:14px">这里是文章正文,说明各个章节的内容与操作,普通段落保持原样。</p><p style="font-size:24px">主要章节</p><p style="font-size:15pt">章节下的主题</p><p>第一步:只有一条的操作说明</p><h4>已有小节</h4>';
+ const result=read("wechat",doc);expect(result.ok).toBe(true);
+ expect(result.clip.markdown.match(/^#{1,6} .+$/gm)).toEqual(['## 主要章节','### 章节下的主题','#### 已有小节']);
+ expect(result.clip.markdown).toContain('\n\n第一步:只有一条的操作说明');
+});
+
+test("optional article metadata does not reject readable content; hidden metadata remains absent",()=>{
+ for(const name of ["wechat","sspai","juejin"]) {
+ const doc=fixture(name); for(const n of Array.from(doc.querySelectorAll('meta,link,#js_name,#js_author_name,.article__header__author,.author-info-block'))) n.remove();
+ expect(read(name,doc).ok).toBe(true);
+ }
+ const doc=fixture("wechat");doc.querySelector("#js_author_name").setAttribute("hidden","");
+ expect(read("wechat",doc).clip.author).toBeUndefined();
+});
+
+test("Juejin code language, indentation and literal fence content survive UI cleanup",()=>{
+ const result=read("juejin");
+ expect(result.clip.markdown).toContain("```javascript\nlet readFile = (path, callBack) => {");
+ expect(result.clip.markdown).toContain(" setTimeout(function () {");
+ expect(result.clip.markdown).not.toContain("复制代码");
+ expect(result.clip.publishedAt).toEqual({value:"2021-06-10T06:41:24.000Z",precision:"datetime"});
+});
+
+test("Juejin's comparison table retains every header, row, cell and inline link in the editor document",()=>{
+ const source=fixture('juejin'),result=read('juejin',source);
+ expect(result.ok).toBe(true);
+ const tables=markdownToDoc(result.clip.markdown).content.filter(node=>node.type==='table');
+ expect(tables).toHaveLength(1);
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ expect(tables[0].content.map(row=>row.content.map(text))).toEqual(Array.from(source.querySelector('table').rows).map(row=>Array.from(row.cells).map(cell=>cell.textContent.trim())));
+ expect(tables[0].content[0].content.map(cell=>cell.type)).toEqual(['tableHeader','tableHeader','tableHeader']);
+ expect(JSON.stringify(tables[0])).toContain(new URL(source.querySelector('table a').getAttribute('href')).href);
+});
+
+test("known article identity conflicts and hidden article bodies never become whole-page captures",()=>{
+ for(const [name,selector] of [["wechat","#js_content"],["sspai",".article__main__content"],["juejin",".article-viewer"]]) {
+ const doc=fixture(name);doc.querySelector(selector).setAttribute("hidden","");expect(read(name,doc)).toEqual({ok:false,reason:"unreadable"});
+ const wrong=fixture(name); const declared=wrong.querySelector('link[rel="canonical"],meta[property="og:url"]');declared.setAttribute(declared.tagName==='META'?'content':'href',urls[name]+"/extra");expect(read(name,wrong)).toEqual({ok:false,reason:"changed"});
+ }
+});
+
+test("Jike uses the public original picture URL, retaining nine ordered images and a complete long post",()=>{
+ expect(read("jike").clip.markdown).toContain("/meta-keep-list/");
+ expect(read("jike").clip.markdown).not.toContain("thumbnail/");
+ const grid=read("jike-grid"); expect([...grid.clip.markdown.matchAll(/!\[/g)]).toHaveLength(9);
+ const long=read("jike-long");expect(long.ok).toBe(true);expect(long.clip.markdown).toContain("《世界尽头的咖啡馆》和《斯坦福大学人生设计课》");
+ expect(long.clip.markdown).not.toContain("?s=");
+});
+
+test("Jike missing media, truncated text or stale post metadata fail before saving",()=>{
+ const doc=fixture("jike-grid");doc.querySelector(".image-item").remove();expect(read("jike-grid",doc)).toEqual({ok:false,reason:"incomplete"});
+ const short=fixture("jike-long");short.querySelector(".text").textContent="我在即刻写东西";expect(read("jike-long",short)).toEqual({ok:false,reason:"incomplete"});
+ const wrong=fixture("jike");const state=wrong.querySelector("#__NEXT_DATA__"),data=JSON.parse(state.textContent);data.props.pageProps.post.id="6715e824d9dc81724c2ec74d";state.textContent=JSON.stringify(data);expect(read("jike",wrong)).toEqual({ok:false,reason:"changed"});
+});
+
+test("Douban reviews and diary exclude controls and do not label edit time as original publication",()=>{
+ expect(read("douban-book").clip.markdown).not.toContain("来自豆瓣App");
+ expect(read("douban-book").clip.markdown).not.toContain("有关键情节透露");
+ expect(read("douban-book").clip.publishedAt).toBeUndefined();
+ expect(read("douban-note").clip.publishedAt).toEqual({value:"2021-10-14T22:06:17",precision:"datetime"});
+});
+
+test("Douban book review retains its seven displayed paragraphs and all six image positions",()=>{
+ const doc=fixture('douban-book'),original=doc.body.outerHTML,result=read('douban-book',doc);
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ const expected=Array.from(doc.querySelectorAll('.review-content p')).flatMap(p=>p.textContent.split(/\n\s*\n/));
+ const paragraphs=markdownToDoc(result.clip.markdown).content.filter(node=>node.type==='paragraph').map(text);
+ expect(expected).toHaveLength(7);expect(paragraphs.slice(1)).toEqual(expected);
+ expect(result.clip.markdown).toContain('\n\n在路上,我遇到了瓦尔泽');
+ expect(result.clip.markdown).toContain('\n\n有人说,他写的是西方的散文');
+ expect(result.clip.markdown.match(/!\[/g)).toHaveLength(6);
+ expect(result.clip.markdown.indexOf('p11097735.webp')).toBeGreaterThan(result.clip.markdown.indexOf('在路上'));
+ expect(result.clip.markdown.indexOf('p11097735.webp')).toBeLessThan(result.clip.markdown.indexOf('《散步》是'));
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("Douban paragraph breaks preserve nested emphasis, links and literal code without splitting code's own blank lines",()=>{
+ const doc=fixture('douban-book');
+ doc.querySelector('.review-content').innerHTML='<p>首段<strong>加粗\n\n仍然加粗<a href="https://example.test/source">链接</a></strong>第二段\n\n末段<code>alpha\n\nbeta</code></p>';
+ const result=read('douban-book',doc);
+ expect(result.clip.markdown).toContain('首段**加粗**\n\n**仍然加粗[链接](https://example.test/source)**第二段\n\n末段');
+ expect(result.clip.markdown).toContain('`alpha beta`');
+});
+
+test("Douban music review preserves each displayed single newline as a hard break",()=>{
+ const doc=fixture('douban-music'),original=doc.body.outerHTML,result=read('douban-music',doc);
+ const expected=doc.querySelector('.review-content p').textContent;
+ const lines=expected.split(/\r?\n/);
+ expect(lines.length).toBeGreaterThan(3);
+ const text=node=>node.text || (node.content || []).map(child=>child.type==='hardBreak'?'\n':text(child)).join('');
+ const paragraph=markdownToDoc(result.clip.markdown).content.find(node=>node.type==='paragraph' && text(node).startsWith(lines[0]));
+ expect(text(paragraph)).toBe(lines.map(line=>line.trim()).join('\n'));
+ expect(paragraph.content.filter(node=>node.type==='hardBreak')).toHaveLength(lines.length-1);
+ expect(result.clip.markdown.match(/!\[/g)).toHaveLength(3);
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("Douban short comments bind to the chosen own permalink and do not capture neighbouring comments",()=>{
+ const doc=fixture("douban-comments"),page="https://book.douban.com/subject/36864764/comments/",card=doc.querySelector(".comment-item");
+ const target=doubanCommentTarget(card,page);expect(target.url).toBe("https://book.douban.com/comment/4237804504/");
+ expect(platformTarget(page)).toBeNull();expect(socialPlatform(page)).toBe("douban");
+ const result=readDouban(doc,target,page);expect(result.ok).toBe(true);expect(result.clip.title).toBe("散步 · 就绪雀");
+ expect(result.clip.markdown).toContain("有很多没必要写的句子");expect(result.clip.markdown).not.toContain("翻译的存在感太明显了");
+ card.querySelector('.comment-time').setAttribute('href','/comment/4259416906/');expect(doubanCommentTarget(card,page)).toBeNull();
+});
+
+
+test("Jike declared content cannot lose its entire text or links, and media cannot be replaced by duplicates",()=>{
+ for(const mode of ["remove","hidden"]){const doc=fixture("jike-grid"),text=doc.querySelector('.text');mode==="remove"?text.remove():text.setAttribute('hidden','');expect(read("jike-grid",doc)).toEqual({ok:false,reason:"incomplete"});}
+ const links=fixture("jike-long");for(const link of Array.from(links.querySelectorAll('.text a[href]')))link.remove();expect(read("jike-long",links)).toEqual({ok:false,reason:"incomplete"});
+ const wrong=fixture("jike-long");wrong.querySelector('.text a[href]').setAttribute('href','https://m.okjike.com/originalPosts/6715e824d9dc81724c2ec74d');expect(read("jike-long",wrong)).toEqual({ok:false,reason:"incomplete"});
+ const images=fixture("jike-grid"),first=images.querySelector('.image-item img').getAttribute('src');for(const img of Array.from(images.querySelectorAll('.image-item img')))img.setAttribute('src',first);expect(read("jike-grid",images)).toEqual({ok:false,reason:"incomplete"});
+});
+
+test("hidden visual date and rating fields are omitted while optional short-comment time does not gate text",()=>{
+ const doc=fixture("douban-book");doc.querySelector('.main-meta').textContent='';const time=doc.createElement('span');time.setAttribute('content','2024-07-31');time.setAttribute('hidden','');time.textContent='2024-07-31 17:37:35';doc.querySelector('.main-meta').appendChild(time);
+ const rating=doc.querySelector('.main-title-rating');rating.setAttribute('title','HIDDEN RATING');rating.setAttribute('hidden','');const result=read('douban-book',doc);expect(result.clip.publishedAt).toBeUndefined();expect(result.clip.markdown).not.toContain('HIDDEN RATING');
+ for(const action of ['remove','href']){const list=fixture('douban-comments'),card=list.querySelector('.comment-item'),time=card.querySelector('.comment-time');action==='remove'?time.remove():time.removeAttribute('href');const target=doubanCommentTarget(card,'https://book.douban.com/subject/36864764/comments/');const saved=readDouban(list,target,'https://book.douban.com/subject/36864764/comments/');expect(saved.ok).toBe(true);expect(saved.clip.markdown).toContain('/subject/36864764/comments/#c-4237804504');}
+});
+
+const jikeFeedUrl='https://m.okjike.com/topics/63579abb6724cc583b9bba9a';
+test('Jike topic feed binds each real card by its own author/text and keeps only that post',async()=>{
+ const {jikeCardTarget}=await import('./src/jike-clip.ts');const d=fixture('jike-feed'),cards=Array.from(d.querySelectorAll('.post-item-li'));
+ const first=jikeCardTarget(cards[0],jikeFeedUrl),second=jikeCardTarget(cards[1],jikeFeedUrl);
+ expect(first.id).toBe('6aceee92141b85b292eb4e27');expect(second.id).toBe('6ace942f756bbb66581c3f96');
+ const firstRead=readJike(d,jikeFeedUrl,first);expect(firstRead.ok).toBe(true);expect(firstRead.clip.markdown).toContain('42章经');expect(firstRead.clip.markdown).toContain('世界第一');expect(firstRead.clip.markdown).not.toContain('JimHuiHui');
+ const r=readJike(d,jikeFeedUrl,second);expect(r.ok).toBe(true);expect(r.clip.author).toBe('JimHuiHui');expect(r.clip.markdown).toContain('护城河');expect(r.clip.markdown).not.toContain('Ambi');expect(r.clip.tags).toEqual(['web-clip','jike']);expect(r.clip.markdown.match(/!\[/g)).toHaveLength(1);
+ const s=d.querySelector('script'),v=JSON.parse(s.textContent);v.props.pageProps.posts.reverse();s.textContent=JSON.stringify(v);
+ expect(jikeCardTarget(cards[1],jikeFeedUrl)).toEqual(second);
+ v.props.pageProps.posts.push({...v.props.pageProps.posts[0],id:'6715e824d9dc81724c2ec74d'});s.textContent=JSON.stringify(v);
+ expect(jikeCardTarget(cards[1],jikeFeedUrl)).toBeNull();
+});
+test('Jike topic cards never derive a target from body references, changed authors or hidden content',async()=>{
+ const {jikeCardTarget}=await import('./src/jike-clip.ts');
+ for(const change of [card=>card.querySelector('.avatar').setAttribute('href','/users/other'),card=>card.querySelector('.avatar').setAttribute('href','https://unrelated.example'+card.querySelector('.avatar').getAttribute('href')),card=>card.querySelector('.text').textContent='Different post',card=>card.style.display='none',card=>card.querySelector('.image-item').remove()]) {
+ const d=fixture('jike-feed'),card=d.querySelectorAll('.post-item-li')[1];change(card);expect(jikeCardTarget(card,jikeFeedUrl)).toBeNull();
+ }
+});
+test('the compiled Jike pointer listener marks only the card under the context-menu event',async()=>{
+ const {createWindow}=await import('@mixmark-io/domino'),{runInNewContext}=await import('node:vm'),{bundleTestScripts}=await import('./bundle-test-scripts.mjs');
+ const w=createWindow(readFileSync(new URL('./fixtures/platforms/jike-feed.html',import.meta.url),'utf8'),jikeFeedUrl);
+ runInNewContext(bundleTestScripts(['social-target'])[0],{document:w.document,location:w.location,URL,Element:w.Element,Node:w.Node});
+ const cards=w.document.querySelectorAll('.post-item-li'),event=w.document.createEvent('Event');event.initEvent('contextmenu',true,true);cards[1].querySelector('.text').dispatchEvent(event);
+ expect(w.document.querySelectorAll('[data-edgeever-social-target]')).toHaveLength(1);expect(cards[1].getAttribute('data-edgeever-social-target')).toBe('https://m.okjike.com/originalPosts/6ace942f756bbb66581c3f96');
+ cards[0].querySelector('.text').dispatchEvent(event);expect(cards[1].hasAttribute('data-edgeever-social-target')).toBe(false);
+});
+
+test('article metadata retains source date precision and normalized own headlines',async()=>{
+ const {mediumContent}=await import('./src/medium-content.ts'),{substackContent}=await import('./src/substack-content.ts');
+ const medium=fixture('medium-article');medium.querySelector('script').remove();expect(mediumContent(medium,'https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e').publishedAt).toEqual({value:'2026-08-31',precision:'date'});
+ const d=fixture('substack-article'),s=d.querySelector('script'),v=JSON.parse(s.textContent);v.headline='The Dot and the Swarm';d.querySelector('h1').textContent=v.headline;s.textContent=JSON.stringify(v);
+ expect(substackContent(d,'https://www.oneusefulthing.org/p/the-dot-and-the-swarm').author).toBe('Ethan Mollick');
+});
+test('only a visible real Substack paywall blocks whole-article extraction',async()=>{
+ const {substackContent}=await import('./src/substack-content.ts'),{substackPaywall}=await import('./src/article-platform.ts'),d=fixture('substack-paywall'),url='https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense';
+ expect(substackPaywall(d)).toBe(true);expect(substackContent(d,url)).toBeNull();d.querySelector('.paywall').style.display='none';expect(substackPaywall(d)).toBe(false);expect(substackContent(d,url)).not.toBeNull();
+});
+
+test('Substack paywall text follows descendant visibility in the serialized probe',async()=>{
+ const {substackContent}=await import('./src/substack-content.ts'),{substackPaywall}=await import('./src/article-platform.ts');
+ const url='https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense';
+ for(const wrapper of ['hidden','aria-hidden="true"','style="display:none"','style="visibility:hidden"']) {
+ const d=fixture('substack-paywall'),gate=d.querySelector('.paywall');gate.innerHTML=`<div ${wrapper}>${gate.innerHTML}</div>`;
+ expect(substackPaywall(d)).toBe(false);expect(substackContent(d,url)).not.toBeNull();
+ }
+ const d=fixture('substack-paywall'),gate=d.querySelector('.paywall');
+ gate.style.visibility='hidden';gate.innerHTML=`<div style="visibility:visible">${gate.innerHTML}</div>`;
+ expect(substackPaywall(d)).toBe(true);expect(substackContent(d,url)).toBeNull();
+ // executeScript serializes the probe without its module's closure.
+ const {runInNewContext}=await import('node:vm');
+ expect(runInNewContext(`(${substackPaywall.toString()})(document)`,{document:d})).toBe(true);
+});
+
+test('Jike clickable image controls retain every confirmed original image',()=>{
+ for(const tag of ['div','button','img']) {
+ const d=fixture('jike-grid');
+ for(const node of Array.from(d.querySelectorAll('.image-item'))) {
+ node.setAttribute('role','button');
+ if(tag==='button') {const button=d.createElement('button');node.replaceWith(button);button.appendChild(node);}
+ if(tag==='img') node.querySelector('img').setAttribute('role','button');
+ }
+ const r=read('jike-grid',d);
+ expect(r.ok).toBe(true);expect(r.clip.markdown.match(/!\[/g)).toHaveLength(9);
+ const originals=JSON.parse(d.querySelector('#__NEXT_DATA__').textContent).props.pageProps.post.pictures.map(p=>p.picUrl);
+ for(const url of originals) expect(r.clip.markdown).toContain(url);
+ }
+});
+
+test('article metadata retains a visible relative publication value when no machine date exists',async()=>{
+ const {mediumContent}=await import('./src/medium-content.ts'),d=fixture('medium-article');d.querySelector('script').remove();d.querySelector('[data-testid="storyPublishDate"]').textContent='2 days ago';
+ expect(mediumContent(d,'https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e').publishedAt).toEqual({value:'2 days ago',precision:'relative'});
+});
diff --git a/apps/extension/bundle-test-scripts.mjs b/apps/extension/bundle-test-scripts.mjs
index ca3c46f9..0c4e6c00 100644
--- a/apps/extension/bundle-test-scripts.mjs
+++ b/apps/extension/bundle-test-scripts.mjs
@@ -17,7 +17,7 @@ export const bundleTestScripts = (names) => {
import { writeFileSync } from "node:fs";
import { build } from "esbuild";
const scripts = await Promise.all(${JSON.stringify(entryPoints)}.map(async (entry) =>
- (await build({ entryPoints: [entry], bundle: true, platform: "browser", format: "iife", write: false })).outputFiles[0].text
+ (await build({ entryPoints: [entry], bundle: true, platform: "browser", conditions: entry.endsWith("/background.ts") ? ["worker"] : [], format: "iife", loader: { ".css": "empty" }, write: false })).outputFiles[0].text
));
writeFileSync(${JSON.stringify(bundlePath)}, JSON.stringify(scripts));
`], { cwd: import.meta.dir, encoding: "utf8" });
diff --git a/apps/extension/capture-bundle.test.mjs b/apps/extension/capture-bundle.test.mjs
index e4730af8..5981ed89 100644
--- a/apps/extension/capture-bundle.test.mjs
+++ b/apps/extension/capture-bundle.test.mjs
@@ -8,8 +8,36 @@ import { Script, createContext, runInContext } from "node:vm";
import { createWindow, createDocument } from "@mixmark-io/domino";
import { bundleTestScripts } from "./bundle-test-scripts.mjs";
import { fileURLToPath } from "node:url";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
+
+test('whole-page and selection captures share table conversion and preserve code blank lines',async()=>{
+ const [source]=bundleTestScripts(['capture']);
+ const code='const first = 1;\n\n\nconst second = 2;';
+ const content='<h2 data-selectable-paragraph>Section</h2><blockquote><p>Quoted update</p></blockquote><table><tr><th>A</th><th>B</th></tr><tr><td>cell<br>line</td><td><a href="https://example.test/source">source</a></td></tr></table><pre><code class="language-js">'+code+'</code></pre>';
+ for(const name of ['medium-article','substack-article','generic']) for(const selection of [false,true]) {
+ const url=name==='medium-article'?'https://medium.com/@scott.batson_76410/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e':name==='substack-article'?'https://www.oneusefulthing.org/p/the-dot-and-the-swarm':'https://example.test/article';
+ const html=name==='generic'?'<title>Article</title><article>'+content+'</article>':await readFile(new URL(`./fixtures/platforms/${name}.html`,import.meta.url),'utf8');
+ const w=createWindow(html,url);let page;
+ // Readability uses modern iterable live collections; Domino's mock omits
+ // this browser API even though real Chromium/Firefox provide it.
+ Object.getPrototypeOf(w.document.getElementsByTagName('*'))[Symbol.iterator] ??= Array.prototype[Symbol.iterator];
+ Object.defineProperty(Object.getPrototypeOf(w.document),'baseURI',{configurable:true,get(){return this.URL;}});
+ const holder=createDocument(content).body;
+ if(name!=='generic') {const container=w.document.querySelector(name==='medium-article'?'article':'.body.markup');while(holder.firstChild)container.appendChild(w.document.importNode(holder.removeChild(holder.firstChild),true));}
+ w.getSelection=()=>selection?{rangeCount:1,toString:()=> 'Selected content',getRangeAt:()=>({cloneContents:()=>{const f=w.document.createDocumentFragment(),temp=createDocument(content).body;while(temp.firstChild)f.appendChild(w.document.importNode(temp.removeChild(temp.firstChild),true));return f;}})}:null;
+ const context=createContext({...browserTimers,window:w,document:w.document,location:w.location,URL,chrome:{i18n:{getMessage:key=>key},runtime:{sendMessage:message=>{page=message.page;}}},...(selection?{__edgeeverPageClipPayload:{mode:'selection'}}:{})});
+ runInContext(source,context);
+ const parsed=markdownToDoc(page.markdown),blocks=[];const walk=node=>{blocks.push(node);(node.content || []).forEach(walk);};walk(parsed);
+ expect(blocks.find(node=>node.type==='codeBlock')?.content.map(node=>node.text).join(''),`${name}, selection=${selection}: ${page.markdown}`).toBe(code);
+ const table=blocks.find(node=>node.type==='table');expect(table?.content).toHaveLength(2);expect(table.content[1].content).toHaveLength(2);
+ expect(blocks.some(node=>node.type==='hardBreak')).toBe(true);
+ expect(blocks.some(node=>node.marks?.some(mark=>mark.type==='link' && mark.attrs.href==='https://example.test/source'))).toBe(true);
+ expect(page.kind).toBe(selection?'selection':'page');
+ }
+});
const execFileAsync = promisify(execFile);
+const browserTimers={setTimeout,clearTimeout,setInterval,clearInterval};
test('Medium page capture retains story blocks and both images without article controls',async()=>{
const html=await readFile(new URL('./fixtures/platforms/medium-article.html',import.meta.url),'utf8');
@@ -19,7 +47,7 @@ test('Medium page capture retains story blocks and both images without article c
const w=createWindow(body,sourceUrl);let page;
w.DOMParser=class { parseFromString(value){return createDocument(value);} };
w.getSelection=()=>selection?{rangeCount:1,toString:()=> 'Selected paragraph',getRangeAt:()=>({cloneContents:()=>{const f=w.document.createDocumentFragment(),p=w.document.createElement('p');p.textContent='Selected paragraph';f.appendChild(p);return f;}})}:null;
- const context=createContext({window:w,document:w.document,location:w.location,URL,chrome:{i18n:{getMessage:k=>k},runtime:{sendMessage:m=>{page=m.page;}}}});
+ const context=createContext({...browserTimers,window:w,document:w.document,location:w.location,URL,chrome:{i18n:{getMessage:k=>k},runtime:{sendMessage:m=>{page=m.page;}}}});
runInContext(source,context);return page;
};
const page=capture(html);expect(page.title).toBe('What Should Programmers Do While the AI Writes Code?');
@@ -30,6 +58,13 @@ test('Medium page capture retains story blocks and both images without article c
expect(capture(html,true).markdown).toBe('Selected paragraph');
const custom=capture(html,false,'https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e');
expect(custom.markdown).toBe(page.markdown);expect(custom.title).toBe(page.title);
+ expect(custom.platform).toBe('medium');expect(custom.author).toBe('Scott Batson');expect(custom.publishedAt).toEqual({value:'2026-08-31T18:48:46Z',precision:'datetime'});
+ expect(capture(html,true).platform).toBeUndefined();
+ const noTitle=createDocument(html);noTitle.querySelector('h1[data-selectable-paragraph]').remove();noTitle.querySelector('article').style.display='none';
+ for(const pageUrl of [url,'https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e']) {
+ expect(capture(noTitle.documentElement.outerHTML,false,pageUrl)).toEqual({error:'unreadable'});
+ expect(capture(noTitle.documentElement.outerHTML,true,pageUrl).markdown).toBe('Selected paragraph');
+ }
for(const attribute of ['hidden','aria-hidden="true"']) {
const hidden=html.replace('<article',`<article ${attribute}`);
expect(capture(hidden)).toEqual({error:'unreadable'});
@@ -46,11 +81,14 @@ test('Substack article capture retains sections and images on custom domains wit
const w=createWindow(body,url);let page;
w.DOMParser=class { parseFromString(value){return createDocument(value);} };
w.getSelection=()=>selection?{rangeCount:1,toString:()=> 'Selected paragraph',getRangeAt:()=>({cloneContents:()=>{const f=w.document.createDocumentFragment(),p=w.document.createElement('p');p.textContent='Selected paragraph';f.appendChild(p);return f;}})}:null;
- runInContext(source,createContext({window:w,document:w.document,location:w.location,URL,chrome:{i18n:{getMessage:k=>k},runtime:{sendMessage:m=>{page=m.page;}}}}));return page;
+ runInContext(source,createContext({...browserTimers,window:w,document:w.document,location:w.location,URL,chrome:{i18n:{getMessage:k=>k},runtime:{sendMessage:m=>{page=m.page;}}}}));return page;
};
const url='https://www.oneusefulthing.org/p/the-dot-and-the-swarm';
const page=capture(html,url);
expect(page.title).toBe('The Dot and the Swarm');
+ expect(page.platform).toBe('substack');expect(page.author).toBe('Ethan Mollick');expect(page.publishedAt).toEqual({value:'2026-10-01T18:54:12+08:00',precision:'datetime'});
+ const missing=createDocument(html);missing.querySelector('script').remove();expect(capture(missing.documentElement.outerHTML,url).author).toBeUndefined();
+ const unrelated=createDocument(html),schema=unrelated.querySelector('script'),data=JSON.parse(schema.textContent);data.url='https://www.oneusefulthing.org/p/other';schema.textContent=JSON.stringify(data);expect(capture(unrelated.documentElement.outerHTML,url).author).toBeUndefined();
for(const content of ['Benefitting from the Bitter Lesson','Nope.','# Dots and Muse','# Swarms','# A Not-Entirely-Bitter Lesson','very cool pre-order bonus'])expect(page.markdown).toContain(content);
expect(page.markdown.match(/!\[/g)).toHaveLength(3);
for(const noise of ['Subscribe','Share','Comments and recommendations','One Useful Thing'])expect(page.markdown).not.toContain(noise);
diff --git a/apps/extension/context-menus.test.mjs b/apps/extension/context-menus.test.mjs
index 5b5dc3f3..6865a657 100644
--- a/apps/extension/context-menus.test.mjs
+++ b/apps/extension/context-menus.test.mjs
@@ -48,6 +48,13 @@ test("registers context menus on install, not on background startup", async () =
"save-hacker-news",
"save-v2ex",
"save-xiaoyuzhou",
+ "save-boss",
+ "save-xueqiu",
+ "save-wechat",
+ "save-jike",
+ "save-sspai",
+ "save-juejin",
+ "save-douban",
"save-facebook",
"save-instagram",
"save-linkedin",
diff --git a/apps/extension/fixtures/platforms/boss-login-required.html b/apps/extension/fixtures/platforms/boss-login-required.html
new file mode 100644
index 00000000..7cb2a97b
--- /dev/null
+++ b/apps/extension/fixtures/platforms/boss-login-required.html
@@ -0,0 +1,122 @@
+<!doctype html><html><head><meta charset="utf-8"><link rel="canonical" href="https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html"></head><body><div class="job-banner">
+ <div class="inner home-inner">
+ <div class="job-primary detail-box">
+ <div class="info-primary">
+ <div class="job-status"><span>招聘中</span></div>
+ <div class="name">
+ <h1 title="AI平台开发工程师">AI平台开发工程师</h1>
+ <span class="salary" style="top: 0px;"><div class="zp-hide-salary" style="font-size: 28px;"><div class="zp-hide-salary-text"> <div class="zp-hide-salary-unit">元</div></div> <div class="zp-hide-salary-icon"></div></div></span>
+ </div>
+ <p><a class="text-desc text-city" href="/shenzhen/">深圳</a> <span class="text-desc text-experiece">5-10年</span>
+<span class="text-desc text-degree">本科</span></p>
+ <div class="job-op">
+ <div class="btn-container">
+ <a class="btn btn-interest " href="javascript:;">感兴趣</a>
+
+
+ <div class="btn btn-startchat-wrap">
+ <a class="btn btn-startchat" href="javascript:;">
+ 立即沟通
+ </a>
+ </div>
+ </div>
+ <div class="op-container">
+ </div>
+ </div>
+ </div>
+ <div class="tag-container-new" style="padding-right: 43px;">
+ <div class="tag-more" style="opacity: 1; display: block; left: auto; right: 0px;">
+ <span class="link-more">...</span>
+ <div class="tag-all job-tags">
+ <span>节日福利</span><span>团建聚餐</span><span>零食下午茶</span><span>带薪年假</span><span>年终奖</span><span>五险一金</span>
+ </div>
+ </div>
+ <div class="job-tags">
+ <span>节日福利</span><span>团建聚餐</span><span>零食下午茶</span><span>带薪年假</span><span>年终奖</span><span>五险一金</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div><div class="job-detail">
+
+
+ <div class="job-detail-section" style="user-select: none;">
+ <div class="detail-section-operate">
+ <div class="op-links">
+ <a href="javascript:;" class="link-wechat-share">微信扫码分<span class="REaMfKfDKAs">享</span></a>
+ <a href="javascript:;" class="link-report">举<span class="JfhWMZPjJa">kanzhun</span>报</a>
+ </div>
+ </div>
+ <div class="detail-content-header">
+ <h3>职位<span class="pfZdnW">BOSS直聘</span>描述</h3>
+ </div>
+ <ul class="job-keyword-list">
+ <li>Golang</li>
+ <li>Java</li>
+ <li>Python</li>
+ </ul>
+ <div class="job-sec-text"><span class="bFEQDSdaD">岗</span>位可选工作地点:<span class="NsFsYiCeEN">boss</span>杭州、深圳、郑州。<br>1、负责AI平台(包括模型服务平台和应用使能平台)运维相关功能需求分析,包括平台的安装部署、升级、监控告警等特性。调研分析友商产品,完成方案设计、代码开发和需求交付,并持续跟踪业界最优实现,通过最佳方案实现产品性能和易⽤性的持续提升。<br> 2、负责AI应⽤使能平台相关功能需求分析,⽅案设计与开发,包括MCP、工作流、知识库解析、RAG、多模态agent应用架构与开发。<br> 3、负责运维需求⽅案关键技术验证,确保所负责的软件架构能支撑产品业务的长期发展,避免软件框架与代码腐化、频繁重构;持续提升平台和产品的综合竞争力。<br> 4、负责AI项目技术攻关,一线项目技术支撑等。<br>技能:<br>1、计算机、软件、通信等相关专业本科及<div class="zp-more-info-layer-wrapper"><div class="zp-more-info-layer-content"><div class="zp-more-info-layer-main"><span class="zp-more-info-layer-text">登录查看完整内容</span> <div class="zp-more-info-layer-icon"></div></div> <div class="zp-more-info-layer-mask"></div></div></div></div>
+
+ </div>
+
+
+
+
+
+ <div class="job-detail-section job-detail-company">
+ <div class="detail-section-item company-info-box">
+ <h3>公司介绍</h3>
+ <div class="job-sec-text fold-text">超聚变数字技术有限公司是一家全球领先的算力基础设施与算力服务提供者。我们坚持“以客户为中心,以奋斗者为本,长期坚持艰苦奋斗,合作共赢”的核心价值观,持续为客户和伙伴创造价值,加速行业数字化转型。超聚变在全球设立了11个研究中心和7个地区部、5大供应中心,目前服务于全球130个国家和地区客户,包括全球211家财富500强企业,覆盖金融、运营商、互联网、交通能源等行业。</div>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" target="_blank" class="look-all" style="display: inline;">查看全部</a>
+ </div>
+ <div class="detail-section-item business-info-box">
+ <h3>工商信息</h3>
+ <div class="level-list-box">
+ <ul class="level-list">
+ <li class="company-name"><span>公司名称</span>超聚变数字技术股份有限公司</li>
+ <li class="company-user"><span>法定代表人</span>马剑平</li>
+ <li class="res-time"><span>成立日期</span>2021-09-13</li>
+ <li class="company-type"><span>企业类型</span>股份有限公司(外商投资、未上市)</li>
+ <li class="manage-state"><span>经营状态</span>正常</li>
+ <li class="company-fund"><span>注册资金</span>88032.1048万</li>
+ </ul>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" target="_blank" class="look-all">查看全部</a>
+ </div>
+ </div>
+ <div class="detail-section-item company-address">
+ <h3>工作地址</h3>
+ <div class="job-location">
+ <div class="location-address">深圳福田区博今国际A座</div>
+
+ </div>
+ </div>
+ </div>
+
+
+
+
+
+
+
+
+ <div class="pos-bread city-job-guide">
+ <a href="/">首页</a><span class="link-collect"><a href="/c101280600/">深圳招聘</a>·<a href="/p100101/">Java招聘</a></span><a href="/c101280600-p100101/">深圳Java招聘</a><a href="/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html">超聚变技术有限公司Java招聘</a>
+ </div>
+ <p class="gray">页面更新时间:2026-10-12</p>
+
+ </div><div class="sider-company">
+ <p class="title">公司基本信息</p>
+ <div class="company-info">
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" title="超聚变技术有限公司" target="_blank">
+ <img src="https://img.bosszhipin.com/beijin/upload/com/workfeel/20220528/7bf6f160950405e9ea0696a3e3ebe0d55e3a2e4a7523c09964252d795e98e9fbc36d56f85a889e8c.jpg?x-oss-process=image/resize,w_120,limit_0" alt="">
+ </a>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" title="超聚变技术有限公司" target="_blank">
+ 超聚变技术有限公司
+ </a>
+ </div>
+ <p><i class="icon-stage"></i>未融资</p>
+ <p><i class="icon-scale"></i>1000-9999人</p>
+ <p><i class="icon-industry"></i><a href="/i100024/">通信/网络设备</a></p>
+ <a href="/gongsi/job/e2fe28e0d540d3241n1z29y0E1s~.html" class="look-all">查看全部职位</a>
+ </div>
+</body></html>
diff --git a/apps/extension/fixtures/platforms/boss.html b/apps/extension/fixtures/platforms/boss.html
new file mode 100644
index 00000000..39813bdc
--- /dev/null
+++ b/apps/extension/fixtures/platforms/boss.html
@@ -0,0 +1,104 @@
+<!doctype html><html><head><meta charset="utf-8"><link rel="canonical" href="https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html"></head><body><div class="job-banner">
+ <div class="inner home-inner">
+ <div class="job-primary detail-box">
+ <div class="info-primary">
+ <div class="job-status"><span>招聘中</span></div>
+ <div class="name">
+ <h1 title="AI平台开发工程师">AI平台开发工程师</h1>
+ <span class="salary">25-50K·13薪</span>
+ </div>
+ <p><a class="text-desc text-city" href="/shenzhen/">深圳</a> <span class="text-desc text-experiece">5-10年</span>
+<span class="text-desc text-degree">本科</span></p>
+ <div class="job-op">
+ <div class="btn-container">
+ <a class="btn btn-interest " href="javascript:;">感兴趣</a>
+
+
+ <div class="btn btn-startchat-wrap">
+ <a class="btn btn-startchat" href="javascript:;">
+ 立即沟通
+ </a>
+ </div>
+ </div>
+ <div class="op-container">
+ <a href="/web/geek/resume" class="fl icon-resume-login"><i class="icon"></i>完善在线简历</a>
+ <a href="javascript:;" class="fr icon-upload-login attachment-resume-upload"><i class="icon"></i>新增附件简历</a>
+ </div>
+ </div>
+ </div>
+ <div class="tag-container-new">
+ <div class="tag-more">
+ <span class="link-more">...</span>
+ <div class="tag-all job-tags" hidden="">
+ <span>节日福利</span><span>团建聚餐</span><span>零食下午茶</span><span>带薪年假</span><span>年终奖</span><span>五险一金</span>
+ </div>
+ </div>
+ <div class="job-tags">
+ <span>节日福利</span><span>团建聚餐</span><span>零食下午茶</span><span>带薪年假</span><span>年终奖</span><span>五险一金</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div><div class="job-detail-section">
+ <div class="detail-section-operate">
+ <div class="op-links">
+ <a href="javascript:;" class="link-wechat-share">微信<span class="NexPcCBAe">扫</span>码分享</a>
+ <a href="javascript:;" class="link-report"><span class="YjshpZcbi" hidden="">来自BOSS直聘</span>举报</a>
+ </div>
+ </div>
+ <div class="detail-content-header">
+ <h3>职位描<span class="sWXJQpwKKBD" hidden="">BOSS直聘</span>述</h3>
+ </div>
+ <ul class="job-keyword-list">
+ <li>Golang</li>
+ <li>Java</li>
+ <li>Python</li>
+ </ul>
+ <div class="job-sec-text">岗位可选工作地<span class="EwbTeTaaiZA" hidden="">boss</span>点:<span class="cJetGAWdyh" hidden="">boss</span>杭州、深圳、郑州。<br>1、负责AI平台(包括模型服务平台和应用使能平台)运维相关功能需求分析,包括平台的安装部署、升级、监控告警等特性。调研分析友商产品,完成方案设计、代码开发和需求交付,并持续跟踪业界最优实现,通过最佳方案实现产品性能和易⽤性的持续提升。<br> 2、负责AI应⽤使能平台相关功能需求分析,⽅案设计与开发,包括MCP、工作流、知识库解析、RAG、多模态agent应用架构与开发。<br> 3、负责运维需求⽅案关键技术验证,确保所负责的软件架构能支撑产品业务的长期发展,避免软件框架与代码腐化、频繁重构;持续提升平台和产品的综合竞争力。<br> 4、负责AI项目技术攻关,一线项目技术支撑等。<br>技能:<br>1、计算机、软件、通信等相关专业本科及以上学历,具备扎实的计算机体系结构、编程语言(Java/Python/Go)基础,具有良好的编程风格,熟悉常用设计模式。<br> 2、熟悉Docker/Kubernetes,有微服务的开发、部署或运维经验,熟悉云原生技术栈(K8s、Docker、Prometheus),了解主流 AI 框架(TensorFlow/PyTorch)。<br> 3、熟悉模型服务平台核心技术(微调、预训练、数据清洗、量化、剪枝、算子优化、分布式推理等),有AI平台开发经验。<br> 4、熟悉langchain、dify、ragflow等AI应用框架,有Agent工作流设计与开发经验,掌握RAG、MCP内部原理及机制,具备agent开发经验。<br> 5、熟悉OCR技术,有多模态模型和应用处理经验。</div>
+
+ </div><div class="job-detail-section job-detail-company">
+ <div class="detail-section-item company-info-box">
+ <h3>公司介绍</h3>
+ <div class="job-sec-text fold-text">超聚变数字技术有限公司是一家全球领先的算力基础设施与算力服务提供者。我们坚持“以客户为中心,以奋斗者为本,长期坚持艰苦奋斗,合作共赢”的核心价值观,持续为客户和伙伴创造价值,加速行业数字化转型。超聚变在全球设立了11个研究中心和7个地区部、5大供应中心,目前服务于全球130个国家和地区客户,包括全球211家财富500强企业,覆盖金融、运营商、互联网、交通能源等行业。</div>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" target="_blank" class="look-all">查看全部</a>
+ </div>
+ <div class="detail-section-item business-info-box">
+ <h3>工商信息</h3>
+ <div class="level-list-box">
+ <ul class="level-list">
+ <li class="company-name"><span>公司名称</span>超聚变数字技术股份有限公司</li>
+ <li class="company-user"><span>法定代表人</span>马剑平</li>
+ <li class="res-time"><span>成立日期</span>2021-09-13</li>
+ <li class="company-type"><span>企业类型</span>股份有限公司(外商投资、未上市)</li>
+ <li class="manage-state"><span>经营状态</span>正常</li>
+ <li class="company-fund"><span>注册资金</span>88032.1048万</li>
+ </ul>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" target="_blank" class="look-all">查看全部</a>
+ </div>
+ </div>
+ <div class="detail-section-item company-address">
+ <h3>工作地址</h3>
+ <div class="job-location">
+ <div class="location-address">深圳福田区博今国际A座</div>
+ <div class="job-location-map js-open-map">
+ <img src="https://img.bosszhipin.com/beijin/upload/amap_proxy/20250710/48ba41acc9cef1bf3a8df47894d5265c9362f3ebcf7ec2786bb61e3b7bce0931da574d19d1d82c88.png.webp" alt="公司地址">
+ <p>点击查看地图</p>
+ </div>
+ </div>
+ </div>
+ </div><div class="sider-company">
+ <p class="title">公司基本信息</p>
+ <div class="company-info">
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" title="超聚变技术有限公司" target="_blank">
+ <img src="https://img.bosszhipin.com/beijin/upload/com/workfeel/20220528/7bf6f160950405e9ea0696a3e3ebe0d55e3a2e4a7523c09964252d795e98e9fbc36d56f85a889e8c.jpg?x-oss-process=image/resize,w_120,limit_0" alt="">
+ </a>
+ <a href="/gongsi/e2fe28e0d540d3241n1z29y0E1s~.html" title="超聚变技术有限公司" target="_blank">
+ 超聚变技术有限公司
+ </a>
+ </div>
+ <p><i class="icon-stage"></i>未融资</p>
+ <p><i class="icon-scale"></i>1000-9999人</p>
+ <p><i class="icon-industry"></i><a href="/i100024/">通信/网络设备</a></p>
+ <a href="/gongsi/job/e2fe28e0d540d3241n1z29y0E1s~.html" class="look-all">查看全部职位</a>
+ </div>
+</body></html>
diff --git a/apps/extension/fixtures/platforms/douban-book.html b/apps/extension/fixtures/platforms/douban-book.html
new file mode 100644
index 00000000..5595ad5a
--- /dev/null
+++ b/apps/extension/fixtures/platforms/douban-book.html
@@ -0,0 +1,256 @@
+<!doctype html><html><head><meta><title>行走在文字间,是我与这个世界达成的和解(散步)书评</title><meta property="og:title" content="行走在文字间,是我与这个世界达成的和解" hidden="">
+<meta property="og:site_name" content="豆瓣" hidden="">
+<meta property="og:url" content="https://book.douban.com/review/16093028/" hidden="">
+<meta property="og:type" content="article" hidden="">
+<meta property="og:description" content="了解世界蕞好的方法就是出去走走,看一看大千世界、风土人情;了解自己蕞好的方法..." hidden="">
+<meta property="og:image" content="https://img2.doubanio.com/view/thing_review/large/public/p11097731.jpg" hidden=""></head><body><div id="content">
+
+ <div class="grid-16-8 clearfix">
+
+
+ <div class="article">
+
+ <h1>
+ <span property="v:summary">行走在文字间,是我与这个世界达成的和解</span>
+ </h1>
+
+ <div>
+ <div class="main" id="16093028">
+ <a class="avatar author-avatar left" href="https://www.douban.com/people/269892910/"><img src="https://img2.doubanio.com/icon/u269892910-1.jpg"></a>
+
+
+
+
+ <header class="main-hd">
+ <a href="https://www.douban.com/people/269892910/">
+ <span>完颜打骨折</span>
+ </a>
+ 评论
+ <a href="https://book.douban.com/subject/36864764/">散步</a>
+
+ <span class="allstar40 main-title-rating" title="推荐"></span>
+ <span class="main-title-hide" hidden="">4</span>
+
+
+ <div class="main-meta">
+ <span content="2024-07-31">2024-07-31 17:37:35</span>
+ <span>已编辑</span>
+
+ <span>天津</span>
+ </div>
+
+
+
+
+
+
+
+
+ </header>
+
+
+
+
+ <div class="main-bd" id="review-16093028-content">
+
+
+
+
+
+ <div id="link-report-16093028">
+ <div class="review-content clearfix" data-original="0">
+
+ <div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img2.doubanio.com/view/thing_review/l/public/p11097731.webp"></div></div><p>了解世界蕞好的方法就是出去走走,看一看大千世界、风土人情;了解自己蕞好的方法就是出去走走,品一品人情世故,把认识的、不认识的人放在心里腹诽一下,为他们在自己精神版图里找一个合适的位置。
+
+在路上,我遇到了瓦尔泽,一个精神矍铄、眼神犀利、风度翩翩的绅士,一个愿意兴致高昂地出门遛达又更擅于在稿纸上用文字带我们一起遛达的奇妙有趣的人。</p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img9.doubanio.com/view/thing_review/l/public/p11097735.webp"></div></div><p>《散步》是瓦尔泽开始创作的一种方式,这与坐在屋子里面对空白文档就能神游环宇的作家本质上是类似的,他眼里看到的是真实的世界,头脑中呈现出的却是经过解析与重新认知之后的并不能算真实的艺术形象,是只有他自己能看到的维一的一个人或一件事,所以散步对他来说其实是一件级为私人的事,也是让他能够感受到这个世界是美好的维一途径。
+
+读瓦尔泽的作品,你会被他的文字所吸引,每一句对话都像一张延时绘画作品,既完整的构建出恰如其分的场景,又将人物的内心戏展现得一览无遗,让你不由得忽略了好久也看不到的标点符号而沉醉于每一句冗长的对话中包含的丰富内容。
+
+瓦尔泽是一个善于调节气氛的天才,他会在为你描述了一个有趣的场景或是讽刺了一个并不好笑的人之后礼貌地问一句:我可以说一下自己的事吗?想说你就说呗,我也拦不住啊!于是我们就看着他欢快的将富有年代感且充满烟火气的生活图景展现在我们眼前,如此生动又如此令人向往。
+
+他同样擅长自嘲,也很懂得给别人加戏来暗讽自己内心的小心机,但他并不妄图用这种方式来取悦读者,而是让你觉得一切的一切都是时代的错,是这个社会造就了我们内心的阴暗和行为的不智。只能说,他很聪明,个中滋味,留待你细品。
+
+有人说,他写的是西方的散文,实在是很贴切,一边走一边看一边想,人在哪里思想就在哪里,能讲成一个故事也好,不成也无所谓,只要一直走下去,直到精疲力尽。</p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p11097733.webp"></div></div><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img9.doubanio.com/view/thing_review/l/public/p11097736.webp"></div></div><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img9.doubanio.com/view/thing_review/l/public/p11097734.webp"></div></div><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p11097732.webp"></div></div>
+ </div>
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ <div class="main-author">
+ <span>来自豆瓣App</span>
+
+
+
+ </div>
+
+
+
+
+ <div class="main-panel-useful">
+ <button class="btn useful_count j a_show_login">
+ 有用 2
+ </button>
+ <button class="btn useless_count j a_show_login">
+ 没用 0
+ </button>
+ <span class="spoiler not-reported j a_show_login"> 有关键情节透露 </span>
+</div>
+
+ </div>
+
+
+ <div class="main-ft">
+ <div class="main-panel">
+ <div class="main-sharing">
+
+
+
+
+
+
+
+
+<div class="review-bar">
+ <div class="footer-sharing">
+
+
+
+
+ </div>
+
+</div>
+
+ </div>
+ </div>
+ </div>
+
+
+ <div id="dale_book_review_after_readmore"></div>
+
+ </div>
+ </div>
+
+
+
+
+
+
+
+<div id="comments" class="comment-list"><div class="comments-app-wrapper"><div class="no-comments">暂无回复</div><a class="show_login" href="https://accounts.douban.com/passport/login?redir=https%3A%2F%2Fbook.douban.com%2Freview%2F16093028%2F">&gt; 我来回复</a></div></div>
+
+
+
+
+
+
+
+ </div>
+ <div class="aside">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <!-- douban ad begin -->
+ <div id="dale_book_review_top_right"></div>
+ <div id="dale_book_review_middle_mini"></div>
+ <!-- douban ad end -->
+
+ <div class="sidebar-info-wrapper">
+ <div class="sidebar-copy">
+
+
+
+
+
+
+ </div>
+
+
+ <div class="subject-title">
+ <a href="https://book.douban.com/subject/36864764/">&gt;&nbsp;散步</a>
+ </div>
+
+ <div class="subject-img">
+ <a href="https://book.douban.com/subject/36864764/">
+ <img alt="散步" title="散步" src="https://img3.doubanio.com/view/subject/l/public/s34842903.jpg" rel="v:image">
+ </a>
+ </div>
+
+ <div class="subject-info book-info">
+ <ul class="info-list">
+
+
+ <li class="info-item">
+ <span class="info-item-key">作者:</span>
+ <span class="info-item-val">[瑞士]罗伯特·瓦尔泽</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">出版:</span>
+ <span class="info-item-val">上海文艺出版社</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">定价:</span>
+ <span class="info-item-val">52.00</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">装帧:</span>
+ <span class="info-item-val">平装</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">页数:</span>
+ <span class="info-item-val">292</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">时间:</span>
+ <span class="info-item-val">2024-6</span>
+ </li>
+
+ </ul>
+ </div>
+
+
+ </div>
+
+
+
+
+
+
+ </div>
+ <div class="extra">
+
+ </div>
+ </div>
+ </div></body></html>
diff --git a/apps/extension/fixtures/platforms/douban-comments.html b/apps/extension/fixtures/platforms/douban-comments.html
new file mode 100644
index 00000000..a426905d
--- /dev/null
+++ b/apps/extension/fixtures/platforms/douban-comments.html
@@ -0,0 +1,726 @@
+<!doctype html><html><head><meta><title>散步 短评</title></head><body><div id="content">
+
+ <h1>散步 短评</h1>
+
+ <div class="grid-16-8 clearfix">
+
+ <div class="article">
+<div class="comments-wrapper">
+
+ <div class="clearfix Comments-hd">
+ <ul class="fleft CommentTabs">
+ <li class="is-active">
+ <span>读过(137)</span>
+ </li>
+ <li>
+ <a href="https://book.douban.com/subject/36864764/comments?status=N">在读(3)</a>
+ </li>
+
+ <li>
+ <a href="https://book.douban.com/subject/36864764/comments?status=F">想读(26)</a>
+ </li>
+ </ul>
+ <div class="fright">
+
+ <a href="javascript:;" class="comment_btn j a_show_login">我来写短评</a>
+ </div>
+ </div>
+
+
+ <div class="title_line clearfix color_gray">
+ <div class="fleft Comments-sortby">
+ <span>热门</span>
+
+ <!-- 登录用户可见 -->
+
+ </div>
+ </div>
+
+ <!-- 分数分布筛选 -->
+
+ <div id="comments">
+
+
+
+
+
+
+ <div class="comment-list score " id="">
+ <ul>
+
+ <li class="comment-item" data-cid="4237804504">
+ <div class="avatar">
+ <a title="就绪雀" href="https://www.douban.com/people/132796449/">
+ <img src="https://img3.doubanio.com/icon/u132796449-53.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4237804504" class="vote-count">17</span>
+ <a id="btn-4237804504" href="/" class="j a_show_login" data-cid="4237804504">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/132796449/">就绪雀</a>
+ <span class="user-stars allstar30 rating" title="还行"></span>
+ <a class="comment-time" href="/comment/4237804504/">2024-07-09 10:02:18</a>
+ <span class="comment-location">上海</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">有很多没必要写的句子,一些呓语,不理解为什么会出现在笔下和出版物里;另外读来不适的一点,是关于女人的想象与欲望投射,原来从男作家视角看凝视,使用一种冠冕堂皇的“赏美”话术。另外不知道是不是翻译的问题,还是原文就是这样,表述被过分修饰,似乎瓦尔泽自称的那种平实。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4259416906">
+ <div class="avatar">
+ <a title="遊憂" href="https://www.douban.com/people/Lesliedxy/">
+ <img src="https://img3.doubanio.com/icon/u149106968-97.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4259416906" class="vote-count">14</span>
+ <a id="btn-4259416906" href="/" class="j a_show_login" data-cid="4259416906">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/Lesliedxy/">遊憂</a>
+ <span class="user-stars allstar30 rating" title="还行"></span>
+ <a class="comment-time" href="/comment/4259416906/">2024-08-15 00:18:16</a>
+ <span class="comment-location">吉林</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">翻译的存在感太明显了,而且是一种老学究气的明显,令人非常不适,我猜我甚至没有看到五分瓦尔泽的影子。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4210781061">
+ <div class="avatar">
+ <a title="冬至" href="https://www.douban.com/people/xiachaodongzhi/">
+ <img src="https://img3.doubanio.com/icon/u3093799-30.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4210781061" class="vote-count">12</span>
+ <a id="btn-4210781061" href="/" class="j a_show_login" data-cid="4210781061">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/xiachaodongzhi/">冬至</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4210781061/">2024-06-09 11:06:20</a>
+ <span class="comment-location">上海</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">昨晚失眠翻读这本,一半篇目之前读过,就细细看了没读过的小短篇,《一个什么都无所谓的人》和《陌生人》写得太好了,像《致纽扣》一样,充满细腻的温柔和轻盈的想象力。《六则小故事》有几则也耐读。许多篇目正如本雅明所言:瓦尔泽的故事不同寻常地温柔,没有颓废的神经紧张,只有生活痊愈后纯粹和活跃的情绪。期待能读到更多这类小短篇。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4167582778">
+ <div class="avatar">
+ <a title="Y" href="https://www.douban.com/people/164598409/">
+ <img src="https://img3.doubanio.com/icon/u164598409-10.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4167582778" class="vote-count">8</span>
+ <a id="btn-4167582778" href="/" class="j a_show_login" data-cid="4167582778">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/164598409/">Y</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4167582778/">2024-04-23 09:27:39</a>
+ <span class="comment-location">上海</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">你好哇,瓦尔泽。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4217532364">
+ <div class="avatar">
+ <a title="塔可夫手撕鸭" href="https://www.douban.com/people/RonnySun/">
+ <img src="https://img3.doubanio.com/icon/u162256854-13.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4217532364" class="vote-count">8</span>
+ <a id="btn-4217532364" href="/" class="j a_show_login" data-cid="4217532364">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/RonnySun/">塔可夫手撕鸭</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4217532364/">2024-06-16 22:10:42</a>
+ <span class="comment-location">浙江</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">瓦尔泽真的好会用文字达成电影语言般的切换效果,我就像个提线木偶:一会儿被他拽着走、一会儿随着他的手指看过去、一会儿又坐在那乖乖听他讲…… 他转换的是如此的丝滑,我被操纵的心甘情愿。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4265584163">
+ <div class="avatar">
+ <a title="小保不想上班" href="https://www.douban.com/people/169778829/">
+ <img src="https://img3.doubanio.com/icon/u169778829-10.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4265584163" class="vote-count">8</span>
+ <a id="btn-4265584163" href="/" class="j a_show_login" data-cid="4265584163">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/169778829/">小保不想上班</a>
+ <span class="user-stars allstar20 rating" title="较差"></span>
+ <a class="comment-time" href="/comment/4265584163/">2024-08-07 15:45:07</a>
+ <span class="comment-location">广东</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">我只喜欢瓦尔泽散步时对景物的描写,其他那些起伏的心绪非他本人不能体会。他的大部分书写都让我想起我以前在意林杂志上读过的那种空话散文,最让人受不了的还是那个时代特有的动不动就高亢的夸张的吟诵语气,什么高贵的夫人,可爱的少女,请允许我亲吻您的手指。老天,你们这些破烂作家都少喝点酒,清醒一下吧。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4307996276">
+ <div class="avatar">
+ <a title="汪汪昂" href="https://www.douban.com/people/marukinokou/">
+ <img src="https://img3.doubanio.com/icon/u3469645-59.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4307996276" class="vote-count">4</span>
+ <a id="btn-4307996276" href="/" class="j a_show_login" data-cid="4307996276">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/marukinokou/">汪汪昂</a>
+ <span class="user-stars allstar20 rating" title="较差"></span>
+ <a class="comment-time" href="/comment/4307996276/">2024-09-24 13:28:44</a>
+ <span class="comment-location">北京</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">真有点受不了他的散步散文,诠释了放一个ADHD当作家,且他的写作习惯是一字不改,会是什么样子。可怕可怕。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4448918202">
+ <div class="avatar">
+ <a title="siusiu" href="https://www.douban.com/people/4528348/">
+ <img src="https://img9.doubanio.com/icon/u4528348-4.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4448918202" class="vote-count">4</span>
+ <a id="btn-4448918202" href="/" class="j a_show_login" data-cid="4448918202">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/4528348/">siusiu</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4448918202/">2025-02-14 23:02:05</a>
+ <span class="comment-location">浙江</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">可爱的闲言碎语,像是我们内倾者平常脑内叽里咕噜的os,最喜欢的一句大概就是“每当星期天我就会发愁,愁自己无法上街,因为我没有星期天穿的礼服。在稳定、节俭的生活中我像是一只大耗子,任何一只小鸟都会比本报告人或本纳税人更有发财致富的前景。”</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4315937858">
+ <div class="avatar">
+ <a title="pupu" href="https://www.douban.com/people/70835407/">
+ <img src="https://img3.doubanio.com/icon/u70835407-89.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4315937858" class="vote-count">2</span>
+ <a id="btn-4315937858" href="/" class="j a_show_login" data-cid="4315937858">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/70835407/">pupu</a>
+ <span class="user-stars allstar30 rating" title="还行"></span>
+ <a class="comment-time" href="/comment/4315937858/">2024-10-03 18:23:34</a>
+ <span class="comment-location">日本</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">这本选的呀 只有同名那篇和前言是好看的…其他的精致小短篇 真的差点意思 看瓦尔泽还是去看那几个长篇吧 新版装帧封面摸着手感挺奇妙 别的我就不赘述了</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4224993585">
+ <div class="avatar">
+ <a title="Jonathan" href="https://www.douban.com/people/jonathan331/">
+ <img src="https://img9.doubanio.com/icon/u58222498-194.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4224993585" class="vote-count">2</span>
+ <a id="btn-4224993585" href="/" class="j a_show_login" data-cid="4224993585">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/jonathan331/">Jonathan</a>
+ <span class="user-stars allstar40 rating" title="推荐"></span>
+ <a class="comment-time" href="/comment/4224993585/">2024-06-25 13:36:49</a>
+ <span class="comment-location">北京</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">瓦尔泽的写作像是一个摄影机,会让读者像看电影跟着他的描述不断的发现新的人和物,流动的同时却又像是某种空间内的不动,所有微小的人和事都能在他的笔墨下成为一幅画作下不可或缺的因素,然后整合在一起你会觉得这就是生活。这次再版《散步》再一次让人体会到了这位文学大师幽默又精湛的写作能力,散漫的、发散的、随意的、漫无目的的,却都是有意的、凝聚的、用心观察的。这个古怪的人其实有一颗特别美丽的心灵。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4380699565">
+ <div class="avatar">
+ <a title="虚拟机" href="https://www.douban.com/people/125683694/">
+ <img src="https://img3.doubanio.com/icon/u125683694-8.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4380699565" class="vote-count">3</span>
+ <a id="btn-4380699565" href="/" class="j a_show_login" data-cid="4380699565">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/125683694/">虚拟机</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4380699565/">2024-12-13 00:49:33</a>
+ <span class="comment-location">贵州</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">紧张至极,像一根绷直了的弦,再也没有振动的余地,平常、自然又稳固。失去语音的语言更好地在纸面上决堤。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4291053719">
+ <div class="avatar">
+ <a title="周栀年" href="https://www.douban.com/people/68299242/">
+ <img src="https://img9.doubanio.com/icon/u68299242-16.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4291053719" class="vote-count">2</span>
+ <a id="btn-4291053719" href="/" class="j a_show_login" data-cid="4291053719">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/68299242/">周栀年</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4291053719/">2024-09-04 10:43:09</a>
+ <span class="comment-location">重庆</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">第一句“我现在开讲”就很像佛经里的“如是我闻”,就通过这样一种表述让大家觉得这个东西是可信的,但不一定完全可信。如果说我有闲暇,那我就是个无所事事的人;但我说我总没时间,就好像我是一个忙碌的人;而谈到散步,就是说我既能谋生,也有时间才会去散步......</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4462466159">
+ <div class="avatar">
+ <a title="女巫" href="https://www.douban.com/people/dreamernation/">
+ <img src="https://img3.doubanio.com/icon/u1803678-319.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4462466159" class="vote-count">3</span>
+ <a id="btn-4462466159" href="/" class="j a_show_login" data-cid="4462466159">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/dreamernation/">女巫</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4462466159/">2025-02-26 18:17:36</a>
+ <span class="comment-location">重庆</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">热气腾腾的城市和神经病的我(这风格我还蛮喜欢的</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4373524664">
+ <div class="avatar">
+ <a title="after" href="https://www.douban.com/people/3825348/">
+ <img src="https://img3.doubanio.com/icon/u3825348-30.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4373524664" class="vote-count">3</span>
+ <a id="btn-4373524664" href="/" class="j a_show_login" data-cid="4373524664">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/3825348/">after</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4373524664/">2025-03-05 22:06:20</a>
+ <span class="comment-location">山东</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">1.你看,兄弟,你又在大白天闲逛了。2. 一只鸟在笼子里叽叽喳喳地叫着,试图营造出某些田园风情来。3.天地之大、事无巨细,所有喜怒哀乐的事情对他来说都有同等的价值,都是一样的可爱,一样的美妙。4.按照我们的观点,一个绅士脑子里通常转悠的是虚荣和愚蠢,他善于把主要精力放在想象中。比如,他想象自己的鼻子比其他任何理性完美的人鼻子都要好得多,因此,绅士潇酒举止的主要目之一,就在于千方百计地提醒别人,他拥有这么一个特殊的鼻子。5.就这样,我现在要把我的理想变成事实,仅仅就这个要实现理想的想法,就是我最大的满足。6.只有在快乐中、坚忍不拔的忍耐中,生活才会显得如游戏般的轻松。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4421672232">
+ <div class="avatar">
+ <a title="silhouette" href="https://www.douban.com/people/190168151/">
+ <img src="https://img9.doubanio.com/icon/u190168151-16.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4421672232" class="vote-count">2</span>
+ <a id="btn-4421672232" href="/" class="j a_show_login" data-cid="4421672232">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/190168151/">silhouette</a>
+ <span class="user-stars allstar40 rating" title="推荐"></span>
+ <a class="comment-time" href="/comment/4421672232/">2025-01-26 01:27:51</a>
+ <span class="comment-location">湖南</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">散步、音乐、仆人或职员的生活是频繁出现的主题,虽然瓦尔泽极尽反讽之能事,但仍然因为叙事的不加雕琢而显得诚恳。看似随意冗余的文字,是对经典的、深思熟虑的文学的反抗。在更minor的意义上,这种呈现随意性和最微小的现实的写作也是一种minor literature.</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4452004679">
+ <div class="avatar">
+ <a title="天才小蛋糕" href="https://www.douban.com/people/foreverinspring/">
+ <img src="https://img3.doubanio.com/icon/u226865675-28.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4452004679" class="vote-count">2</span>
+ <a id="btn-4452004679" href="/" class="j a_show_login" data-cid="4452004679">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/foreverinspring/">天才小蛋糕</a>
+ <span class="user-stars allstar40 rating" title="推荐"></span>
+ <a class="comment-time" href="/comment/4452004679/">2025-02-17 13:43:10</a>
+ <span class="comment-location">北京</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">瓦尔泽像个水仙,不过他似乎平等地讨厌一切人类。可惜现在不止剧院过时,电影院也不算什么新生事物了…生活总是不停兜圈。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4424808212">
+ <div class="avatar">
+ <a title="momo" href="https://www.douban.com/people/171616691/">
+ <img src="https://img3.doubanio.com/icon/u171616691-2.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4424808212" class="vote-count">3</span>
+ <a id="btn-4424808212" href="/" class="j a_show_login" data-cid="4424808212">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/171616691/">momo</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4424808212/">2025-01-26 20:46:46</a>
+ <span class="comment-location">上海</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">不久以前我从一个寒冷、悲惨、贫困、生着重病、完全没有信仰、没有希冀和信赖的地方来到这里,我对那个世界以及对我自己感到完全陌生,并且相互仇视。恐惧和彼此间的互不信任让我感到困惑,它们伴随着我的每一个脚步。我努力一步一步地走出那低下、丑陋的偏见。在这里,我重新呼吸到了宁静和自由的空气,重新变成一个热情和幸福的人。过去我内心充满的恐惧在逐渐地消失,心中的悲哀和荒凉,无边的失望,渐渐变成一种快乐的自足,变成一种舒适的、活生生的东西,我要从头开始去感觉它。我曾经死去过,现在就好像有人把我从地狱里解救上来。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4450049973">
+ <div class="avatar">
+ <a title="那朵花儿💞🐕" href="https://www.douban.com/people/LoveyoyoANDluca/">
+ <img src="https://img2.doubanio.com/icon/u169870379-11.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4450049973" class="vote-count">3</span>
+ <a id="btn-4450049973" href="/" class="j a_show_login" data-cid="4450049973">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/LoveyoyoANDluca/">那朵花儿💞🐕</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4450049973/">2025-02-27 23:25:43</a>
+ <span class="comment-location">浙江</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">漫不经心的絮絮叨似微风拂过我的嘴角,瓦尔泽的幽默太温柔优雅了。范老师的翻译传神入微,打破语言隔阂给读者带来无与伦比的阅读享受。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4213199822">
+ <div class="avatar">
+ <a title="苏安的馒头" href="https://www.douban.com/people/154583926/">
+ <img src="https://img3.doubanio.com/icon/u154583926-12.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4213199822" class="vote-count">2</span>
+ <a id="btn-4213199822" href="/" class="j a_show_login" data-cid="4213199822">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/154583926/">苏安的馒头</a>
+ <span class="user-stars allstar50 rating" title="力荐"></span>
+ <a class="comment-time" href="/comment/4213199822/">2024-07-07 20:02:11</a>
+ <span class="comment-location">上海</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">还会很多次读。</span>
+ </p>
+ </div>
+ </li>
+
+
+ <li class="comment-item" data-cid="4280747290">
+ <div class="avatar">
+ <a title="thger" href="https://www.douban.com/people/183346378/">
+ <img src="https://img9.doubanio.com/icon/u183346378-16.jpg">
+ </a>
+ </div>
+ <div class="comment">
+ <h3>
+ <span class="comment-vote">
+ <span id="c-4280747290" class="vote-count">1</span>
+ <a id="btn-4280747290" href="/" class="j a_show_login" data-cid="4280747290">有用</a>
+
+ </span>
+ <span class="comment-info">
+ <a href="https://www.douban.com/people/183346378/">thger</a>
+ <span class="user-stars allstar30 rating" title="还行"></span>
+ <a class="comment-time" href="/comment/4280747290/">2024-08-23 20:13:22</a>
+ <span class="comment-location">浙江</span>
+ </span>
+ </h3>
+ <p class="comment-content">
+
+ <span class="short">礼貌的唠叨</span>
+ </p>
+ </div>
+ </li>
+
+ </ul>
+ </div>
+
+<div class="paginator-wrapper">
+
+<div id="paginator" class="center">
+ <span class="first">&lt;&lt; 首页</span>
+ <span class="prev">&lt; 前页</span>
+ <a href="/?status=P&amp;sort=score&amp;percent_type=&amp;start=20&amp;limit=20">后页 &gt;</a>
+</div>
+
+</div>
+
+
+ </div>
+
+</div>
+
+
+</div>
+ <div class="aside">
+
+
+
+<div class="sidebar-wrapper">
+
+
+ <p class="pl2 side-bar-link">
+ &gt; <a href="https://book.douban.com/subject/36864764/">散步</a>
+ </p>
+ <div class="indent subject-info">
+
+
+
+
+
+
+
+
+
+
+
+
+<div>
+ <a href="https://book.douban.com/subject/36864764/">
+ <img class="fil" alt="散步" title="散步" src="https://img3.doubanio.com/view/subject/s/public/s34842903.jpg" rel="v:image">
+ </a>
+<br>
+
+ <span class="pl">作者:</span> [瑞士]罗伯特·瓦尔泽<br>
+
+
+
+ <span class="pl">原作名:</span> Der Spaziergang<br>
+
+
+
+
+
+ <span class="pl">isbn:</span> 7532189627<br>
+
+
+
+ <span class="pl">书名:</span> 散步<br>
+
+
+
+ <span class="pl">页数:</span> 292<br>
+
+
+
+
+ <span class="pl">出品方:</span> 字句文化<br>
+
+
+
+
+
+
+
+
+ <span class="pl">译者:</span> <a href="https://book.douban.com/search/%E8%8C%83%E6%8D%B7%E5%B9%B3">范捷平</a><br>
+
+
+
+ <span class="pl">定价:</span> 52.00<br>
+
+
+
+
+
+ <span class="pl">出版社:</span> 上海文艺出版社<br>
+
+
+
+ <span class="pl">出版年:</span> 2024-6<br>
+
+
+
+ <span class="pl">装帧:</span> 平装<br>
+
+
+
+
+
+</div>
+
+ </div>
+
+</div>
+
+ </div>
+ <div class="extra">
+
+ </div>
+ </div>
+ </div></body></html>
diff --git a/apps/extension/fixtures/platforms/douban-movie.html b/apps/extension/fixtures/platforms/douban-movie.html
new file mode 100644
index 00000000..4c0d479c
--- /dev/null
+++ b/apps/extension/fixtures/platforms/douban-movie.html
@@ -0,0 +1,249 @@
+<!doctype html><html><head><meta><title>假如没有越狱成功,安迪也仍是自由的(肖申克的救赎)影评</title><meta property="og:title" content="假如没有越狱成功,安迪也仍是自由的" hidden="">
+<meta property="og:site_name" content="豆瓣" hidden="">
+<meta property="og:url" content="https://movie.douban.com/review/17798662/" hidden="">
+<meta property="og:type" content="article" hidden="">
+<meta property="og:description" content="To be honest,我一直不甚理解《肖申克的救赎》为什么有那么高的评分、那么高的排..." hidden="">
+<meta property="og:image" content="https://img3.doubanio.com/view/thing_review/large/public/p13668617.jpg" hidden=""></head><body><div id="content">
+
+ <div class="grid-16-8 clearfix">
+
+
+ <div class="article">
+
+ <h1>
+ <span property="v:summary">假如没有越狱成功,安迪也仍是自由的</span>
+ </h1>
+
+ <div>
+ <div class="main" id="17798662">
+ <a class="avatar author-avatar left" href="https://www.douban.com/people/123252296/"><img src="https://img2.doubanio.com/icon/u123252296-1.jpg"></a>
+
+
+
+
+ <header class="main-hd">
+ <a href="https://www.douban.com/people/123252296/">
+ <span>希音</span>
+ </a>
+ 评论
+ <a href="https://movie.douban.com/subject/1292052/">肖申克的救赎</a>
+
+ <span class="allstar40 main-title-rating" title="推荐"></span>
+ <span class="main-title-hide" hidden="">4</span>
+
+
+ <div class="main-meta">
+ <span content="2026-09-01">2026-09-01 19:32:11</span>
+ <span>已编辑</span>
+
+ <span>河南</span>
+ </div>
+
+
+
+
+
+
+
+
+ </header>
+
+
+
+
+ <div class="main-bd" id="review-17798662-content">
+ <p class="main-title-tip">
+ 这篇影评可能有剧透
+ </p>
+
+
+
+
+
+ <div id="link-report-17798662">
+ <div class="review-content clearfix" data-original="1">
+
+ <div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p13668617.webp"></div></div><p>To be honest,我一直不甚理解《肖申克的救赎》为什么有那么高的评分、那么高的排名。虽然,我承认它绝对是部优秀的电影,故事精彩,叙事一流,编、导、演俱佳,但满足这一标准的电影在影史中不能说是一抓一大把吧,却也还是有很多的,而这样一部在我看来是8.5分的片子竟然长期位于IMDB的Top榜首,《教父》《公民凯恩》皆在其下,我总觉得有些过誉,属于影迷们迷影的“冲动”行为。直到,三十多年后的今天,当活久见的32年首映让我可以用真正看电影的方式重温它时,我才看出“影史最佳”的动人之处。
+
+
+多年以来,影迷中一直津津乐道地传颂着《肖申克的救赎》中瑞德那句著名的旁白:“这些高墙很有趣。刚入狱的时候,你痛恨周围的高墙;慢慢地,你习惯了生活在其中;最终你会发现自己不得不依靠它而生存。这就是体制化。”这句旁白是对在监狱里服刑了50多年的老布出狱后无法适应外面的生活,最终选择自杀,这样一个支线故事的总结,我相信很多人都有和我当初第一次看到这样一个故事时一样的反应——震惊,唏嘘,继而陷入深深的思考,重新审视体制究竟是什么。我们最初认为老布的自杀是因为常年高墙内的与世隔绝,与社会脱节,所以出狱后难以适应,只能自杀。我们甚至一度认为老布太羸弱了,如果他再坚强些,再适应一段时间,可能就会融入社会了。但其实,老布只有也只可能有这一种结局。因为,体制的可怕并不在于它囚禁了你的身体、限制了你的自由,而在于体制用一张密不透风的大网潜移默化地改变了你的头脑、你的思想、你的认知,体制下、高墙内的你早已被规训成了脱离了独立个体的另一个样子。</p><p>而这,也正是安迪的可贵之处。片中曾借用瑞德的视角描述安迪的气质:他身上有一种沉静的气质,言谈举止,跟这里的所有人都格格不入。仿佛身披一件无形的外衣,把监狱的一切隔绝在外。安迪的可贵不是数十年如一日挖掘通道、最终逃出监狱,而是纵使像其他人一样被剥夺了身份、剥夺了自由,却难得地坚守着思想的自由、灵魂的自由,以及对人世间一切美好的追求。其实,人人都渴盼自由,但在追求自由的道路上,人却分成了很多种。由于自由太不易,追寻它太难,而拥有它又要付出巨大的代价,大多数向往自由的人都在追寻它的路上停了下来,逃回那个虽然剥夺了自己的自由但能给自己暂时安全的体制,或默默屈从体制,或在体制中浑水摸鱼,最后都依存了体制。而只有极少数人,能够始终坚守内心,并最终追寻到真正的自由。肉体虽身陷牢笼,但精神、姿态、内心的自由没有被监狱被高墙被体制磨灭,这层“无形的外衣”就是安迪的精神内核,也是真正拥有思想拥有灵魂的人虽然沉静但极为强大的力量之源。安迪一直在做大家认为“毫无意义”的事,这些事对于越狱毫无意义,对于其他可能要在监狱里度过余生的人来说也毫无意义,甚至也无法改变监狱的现状,无法改变狱友的境遇。但,这些事真的没有改变什么吗?那桶冰啤酒,让狱友们像坐在自家阳台上般沉醉在夕阳中,哪怕只有那么片刻也重温了阔别已久的普通人的感觉,即使下了阳台他们还是毫无自由的犯人;那首《费加罗的婚礼》,让所有人都停下手中的活儿,驻足凝神,即使完全听不懂唱的什么,也在片刻让音乐穿透了内心;那间改造的图书馆,让犯人们可以通过文字看到世界的样子,即使这个样子离自己很远,远到自己之前一直都没有意识到。这些改变,很小,很细,微不足道到似乎“没有意义”,但这种“看过”、“听过”、“品尝过”就是一颗颗细微的种子,它悄悄地来过,然后留在了每一个人的心中,慢慢发芽,慢慢长大,直到长成参天大树的那一刻,你才会明白,原来,改变从最初那个不经意的“无意义”的片刻就已经开始了。所以,我们会看到曾经的狱友变了,他们从不认几个字母到考取了一个个同等学力,他们从吃饭时讨论怎么欺负新来的犯人到张口闭口都是安迪的传奇,而他们嘴中的传奇并不是安迪如何在二十年里用一个小凿子成功地越了狱,而是他如何让大家在监狱里喝上了冰啤酒、如何让大家在高墙内听到了《费加罗》。如果没有安迪,这些当初麻木的、恃强凌弱的犯人会像现在这样积极、鲜活、生动吗?我们也看到瑞德变了,瑞德在三次假释听证会上的陈词完整地勾勒出一个被体制驯服的人从依附于体制甚至从体制中牟利慢慢开始独立思考、精神渐渐觉醒的全过程,直至出狱后抛下“被规定好”的现实主动选择做一个“自由人”。如果没有安迪,这个八面玲珑地活在体制内的人离开了体制后,要不然就是另一个老布,留给世间唯一的痕迹就是屋梁上的那句“到此一游”,要不然就是一直做着规定好的工作、在规定好的公寓里浑浑噩噩孤独终老。见识到这些改变后,再回过头来看安迪当初做的那些事情,以及这些事情对周遭、对周围的人产生的影响,你又怎能说它们是“无意义”的,又怎能说它们“没有用”呢?!这个世界上最好的最稀缺的东西,永远都是这个世界上的真正聪明的人坚持用最笨最傻最慢的方法一点点一寸寸磨出来的、用孤独地坚守维护下来的。</p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p13668623.webp"></div></div><p>关于希望,瑞德曾严厉地警告安迪不要抱有希望。因为在瑞德看来,抱有“迟早有一天我可以离开监狱”这一希望对于断无可能离开监狱的人来说与其说是希望,不如说是完全不切实际的幻梦,梦碎的那一天,做梦的人会被撕得粉碎。所以,瑞德说希望不是个好东西,因为瑞德以为的希望是逃离监狱这样一个有形的、可以看见的东西,这也是狱中所有人以及我们这些观众一直以来认为的,而这样一个毫无可能的希望是不会带给人振奋的,它只会杀死抱有希望的人。但后来,在与安迪相处了近20年,尤其是亲眼目睹了安迪如何沉静地一以贯之地做自己的事、坚持自己的坚持后,他终于明白安迪抱有的“希望”并不是越狱,而是在毫无自由可言毫无尊严可言的荒诞甚至是荒谬、邪恶的环境中,仍然对自由、对美好、对独立的思想、对可贵的灵魂、对人之所以为人的那份看不见却执着的坚守。这样一种“无形的外衣”,纵使穿着同样的囚服,仍然可以卓尔不群;纵使身处泥潭,仍然可以洁净无瑕;纵使囿于漆黑的禁闭室,仍然能够光彩夺目!
+
+
+因此,《肖申克的救赎》的好不是好在它讲了一个如此激动人心又跌宕起伏的越狱励志故事,而是可贵在它告诉我们即使改变不了环境对抗不了体制,但永远不要忘记阳光和美好,也永远不要忘记自己是谁,永远不要忘了精神的自由、灵魂的轻盈,不要忘了人之所以为人的那些美好。三十多年了,我终于在内心最深处共鸣了《肖申克的救赎》,它用一个更温和更通俗更商业化的故事实现了更普世的《飞越疯人院》,而安迪逃没逃离那座监狱,真的一点都不重要,一如安迪所言:“两周的禁闭一点也不难熬,因为我的心里一直有莫扎特”。</p>
+ </div>
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ <div class="main-author">
+
+
+
+ </div>
+
+
+
+
+
+ <div class="main-panel-useful">
+ <button class="btn useful_count j a_show_login">
+ 有用 0
+ </button>
+ <button class="btn useless_count j a_show_login">
+ 没用 0
+ </button>
+</div>
+
+ </div>
+
+
+ <div class="main-ft">
+ <div class="main-panel">
+ <div class="main-sharing">
+
+
+
+
+
+
+
+
+<div class="review-bar">
+ <div class="footer-sharing">
+
+
+
+
+ </div>
+
+</div>
+
+ </div>
+ </div>
+ </div>
+
+
+ <div id="dale_movie_review_after_readmore"></div>
+
+ </div>
+ </div>
+
+
+
+
+
+
+
+<div id="comments" class="comment-list"><div class="comments-app-wrapper"><div class="no-comments">暂无回复</div><a class="show_login" href="https://accounts.douban.com/passport/login?redir=https%3A%2F%2Fmovie.douban.com%2Freview%2F17798662%2F">&gt; 我来回复</a></div></div>
+
+
+
+
+
+
+
+ </div>
+ <div class="aside">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <!-- douban ad begin -->
+ <div id="dale_movie_review_top_right"></div>
+ <div id="dale_movie_review_middle_mini"></div>
+ <div id="dale_movie_review_right_guess_you_like"></div>
+ <!-- douban ad end -->
+
+ <div class="sidebar-info-wrapper">
+ <div class="sidebar-copy">
+
+
+
+
+
+
+ </div>
+
+
+ <div class="subject-title">
+ <a href="https://movie.douban.com/subject/1292052/">&gt;&nbsp;肖申克的救赎</a>
+ </div>
+
+ <div class="subject-img">
+ <a href="https://movie.douban.com/subject/1292052/">
+ <img alt="肖申克的救赎" title="肖申克的救赎" src="https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2934829882.webp" rel="v:image">
+ </a>
+ </div>
+
+ <div class="subject-info movie-info">
+ <ul class="info-list">
+
+
+ <li class="info-item">
+ <span class="info-item-key">导演:</span>
+ <span class="info-item-val">弗兰克·德拉邦特</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">主演:</span>
+ <span class="info-item-val">蒂姆·罗宾斯 / 摩根·弗里曼 / 鲍勃·冈顿</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">类型:</span>
+ <span class="info-item-val">犯罪 / 剧情</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">地区:</span>
+ <span class="info-item-val">美国</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">上映:</span>
+ <span class="info-item-val">1994-09-10(多伦多电影节) / 1994-10-14(美国) / 2026-08-28(中国大陆)</span>
+ </li>
+
+ </ul>
+ </div>
+
+
+ </div>
+
+
+
+ <div id="dale_movie_review_bottom_right"></div>
+
+
+
+ </div>
+ <div class="extra">
+
+ </div>
+ </div>
+ </div></body></html>
diff --git a/apps/extension/fixtures/platforms/douban-music.html b/apps/extension/fixtures/platforms/douban-music.html
new file mode 100644
index 00000000..dfc0ed8c
--- /dev/null
+++ b/apps/extension/fixtures/platforms/douban-music.html
@@ -0,0 +1,247 @@
+<!doctype html><html><head><meta><title>回来击穿他的肚脐眼(飞狗)乐评</title><meta property="og:title" content="回来击穿他的肚脐眼" hidden="">
+<meta property="og:site_name" content="豆瓣" hidden="">
+<meta property="og:url" content="https://music.douban.com/review/17855287/" hidden="">
+<meta property="og:type" content="article" hidden="">
+<meta property="og:description" content="Ink乐评:崔健《飞狗》(本篇较长) 评分:9.2/10 评语: 我直到去年才把这张专辑..." hidden="">
+<meta property="og:image" content="https://img3.doubanio.com/view/thing_review/large/public/p13742959.jpg" hidden=""></head><body><div id="content">
+
+ <div class="grid-16-8 clearfix">
+
+
+ <div class="article">
+
+ <h1>
+ <span property="v:summary">回来击穿他的肚脐眼</span>
+ </h1>
+
+ <div>
+ <div class="main" id="17855287">
+ <a class="avatar author-avatar left" href="https://www.douban.com/people/293276049/"><img src="https://img2.doubanio.com/icon/u293276049-1.jpg"></a>
+
+
+
+
+ <header class="main-hd">
+ <a href="https://www.douban.com/people/293276049/">
+ <span>墨盒</span>
+ </a>
+ 评论
+ <a href="https://music.douban.com/subject/35398647/">飞狗</a>
+
+ <span class="allstar50 main-title-rating" title="力荐"></span>
+ <span class="main-title-hide" hidden="">5</span>
+
+
+ <div class="main-meta">
+ <span content="2026-10-14">2026-10-14 10:13:33</span>
+ <span>已编辑</span>
+
+ <span>江苏</span>
+ </div>
+
+
+
+
+
+
+
+
+ </header>
+
+
+
+
+ <div class="main-bd" id="review-17855287-content">
+
+
+
+
+
+ <div id="link-report-17855287">
+ <div class="review-content clearfix" data-original="0">
+
+ <div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p13742959.webp"></div></div><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/thing_review/l/public/p13742960.webp"></div></div><p>Ink乐评:崔健《飞狗》(本篇较长)
+评分:9.2/10
+评语:
+ 我直到去年才把这张专辑从头到尾听了一遍,最直观的感受是老崔依旧是那么硬,在音乐的编排方面依旧是游刃有余,出道近四十年后还能够做出不重复、有新意的作品。就创作状态而言,拥有着好过99%的同龄音乐创作人的年轻感和时尚感(个人来看好过近年的左小、伍佰)。
+ 《末日海滩》低音萨克斯的点睛、节奏更复杂更抢眼的鼓、《兔子牛》中抓耳又趣味性十足的吉他尾奏、以及《半边儿天》中对于“儿化音”富有新意的运用都能看出崔健乐队依然是现如今最有新意和活力的几支乐队之一。</p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img2.doubanio.com/view/thing_review/l/public/p13742961.webp"></div></div><p> 不过,在词作方面,崔健的姿态更加撕裂也更加显现出迷惑。
+ 《末日海滩》《兔子牛》中抽象、凸显矛盾感的歌词令人想到《光冻》,虽在更加根源与爵士的编排中呈现出更加外放、强硬的姿态,但对于现实的指代模糊难免使听众在听完后感到晦涩与迷惑。
+ 《飞狗》《时间的B面》作为开篇两首与最后一首《继续》拥有最强的现实指涉性。《飞狗》用黑洞、宇宙、草原的意象来写电脑网络,更大的概念很容易带来震撼感与宏大感,崔健个人的态度却在“玩宇宙的黑”“和草原逆天行走”中变得模糊而指向不明;《时间的B面》有着很清晰直接的表达,和《留守者》《继续》构成了“没变”“留守”“继续”三个语义几乎重叠的词,这可以说是构成了专辑表达的主线。显然,这是崔健在时代下的感悟,可是对于我们这一代,面对科技前所未有的冲击与瞬息万变的世界,怎样“不变”?“留守”什么?拿什么去“继续”……崔健选择了“留守”,我们可以从中感受到坚毅、固执、与超越时间的力量,却再不能像90s那样、像《宽容》《出走》那样“sing for one whole generation”。
+ 这是崔健的局限,不过丝毫不影响他的伟大和勇敢。
+ 至此搁笔。另外,《继续》推荐听一万遍。
+
+</p>
+ </div>
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+ <div class="main-author">
+
+
+
+ </div>
+
+
+
+
+ <div class="main-panel-useful">
+ <button class="btn useful_count j a_show_login">
+ 有用 0
+ </button>
+ <button class="btn useless_count j a_show_login">
+ 没用 0
+ </button>
+</div>
+
+ </div>
+
+
+ <div class="main-ft">
+ <div class="main-panel">
+ <div class="main-sharing">
+
+
+
+
+
+
+
+
+<div class="review-bar">
+ <div class="footer-sharing">
+
+
+
+
+ </div>
+
+</div>
+
+ </div>
+ </div>
+ </div>
+
+
+ <div id="dale_music_review_after_readmore"></div>
+
+ </div>
+ </div>
+
+
+
+
+
+
+
+<div id="comments" class="comment-list"><div class="comments-app-wrapper"><div class="no-comments">暂无回复</div><a class="show_login" href="https://accounts.douban.com/passport/login?redir=https%3A%2F%2Fmusic.douban.com%2Freview%2F17855287%2F">&gt; 我来回复</a></div></div>
+
+
+
+
+
+
+
+ </div>
+ <div class="aside">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <!-- douban ad begin -->
+ <div id="dale_music_review_top_right"></div>
+ <div id="dale_music_review_middle_mini"></div>
+ <!-- douban ad end -->
+
+ <div class="sidebar-info-wrapper">
+ <div class="sidebar-copy">
+
+
+
+
+
+
+ </div>
+
+
+ <div class="subject-title">
+ <a href="https://music.douban.com/subject/35398647/">&gt;&nbsp;飞狗</a>
+ </div>
+
+ <div class="subject-img">
+ <a href="https://music.douban.com/subject/35398647/">
+ <img alt="飞狗" title="飞狗" src="https://img3.doubanio.com/view/subject/m/public/s33979820.jpg" rel="v:image">
+ </a>
+ </div>
+
+ <div class="subject-info music-info">
+ <ul class="info-list">
+
+
+ <li class="info-item">
+ <span class="info-item-key">表演者:</span>
+ <span class="info-item-val"><a href="/search?q=%E5%B4%94%E5%81%A5&amp;sid=35398647">崔健</a></span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">发行时间:</span>
+ <span class="info-item-val">2021-08-27</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">流派:</span>
+ <span class="info-item-val">摇滚</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">出版者:</span>
+ <span class="info-item-val">上海津冻文化艺术创作工作室</span>
+ </li>
+
+
+
+ <li class="info-item">
+ <span class="info-item-key">专辑类型:</span>
+ <span class="info-item-val">专辑</span>
+ </li>
+
+ </ul>
+ </div>
+
+
+ </div>
+
+
+
+
+
+
+ </div>
+ <div class="extra">
+
+ </div>
+ </div>
+ </div></body></html>
diff --git a/apps/extension/fixtures/platforms/douban-note.html b/apps/extension/fixtures/platforms/douban-note.html
new file mode 100644
index 00000000..7957f5d1
--- /dev/null
+++ b/apps/extension/fixtures/platforms/douban-note.html
@@ -0,0 +1,328 @@
+<!doctype html><html><head><meta><title>雨中小镇</title><meta property="og:title" content="雨中小镇" hidden="">
+<meta property="og:site_name" content="豆瓣" hidden="">
+<meta property="og:url" content="https://www.douban.com/note/814698224/" hidden="">
+<meta property="og:type" content="article" hidden="">
+<meta property="og:description" content="休假在家,看了一天书,晚饭后独自出去散步。 平时晚饭后陪父母出来散步,走到风雨桥头时,总是一派喧闹的氛围,广场上跳广场舞的有好几波。现在的小镇淅淅沥沥的下着雨,街上的人比平时少了很多,而这正合我意。 闲散在家时,身边有几件事正在发生。有时候凌晨醒过来时,会不自觉的想起一些事情,当以不同的心境去回顾它们时,得到的结论可能是截然不同的。而现在这种闲适的心情让我能更清晰的看到这些事情之间的联系,以及这些..." hidden="">
+<meta property="og:image" content="https://img3.doubanio.com/view/note/large/public/p85306883.jpg" hidden=""></head><body><div id="content">
+
+
+ <div class="grid-16-8 clearfix">
+
+
+ <div class="article">
+
+
+
+
+
+
+
+
+ <div id="reg-up" hidden="">
+ <a href="https://www.douban.com/accounts/register" class="btn-reg lnk-show-reg">快速注册</a>
+ </div>
+
+
+
+ <div id="note-runtime-config" hidden=""></div>
+
+
+
+ <div id="note-814698224" class="note-container">
+
+
+
+
+
+
+
+
+
+ <div class="note-header note-header-container">
+ <h1>雨中小镇</h1>
+
+
+ <div class="note-header-tab">
+ <a href="https://www.douban.com/people/shuaidefadai/"><img class="note_author_avatar" src="https://img3.doubanio.com/icon/u59571810-8.jpg" alt="孩子气概"></a>
+ <a href="https://www.douban.com/people/shuaidefadai/" class="note-author">孩子气概</a>
+
+ <span class="pub-date">
+ 2021-10-14 22:06:17
+
+
+ </span>
+ </div>
+ </div>
+
+
+
+
+ <div class="note" id="note_814698224_short" hidden=""></div>
+ <div id="note_814698224_full">
+ <div id="link-report">
+
+ <div class="note">
+ <p>休假在家,看了一天书,晚饭后独自出去散步。</p><p>平时晚饭后陪父母出来散步,走到风雨桥头时,总是一派喧闹的氛围,广场上跳广场舞的有好几波。现在的小镇淅淅沥沥的下着雨,街上的人比平时少了很多,而这正合我意。</p><p>闲散在家时,身边有几件事正在发生。有时候凌晨醒过来时,会不自觉的想起一些事情,当以不同的心境去回顾它们时,得到的结论可能是截然不同的。而现在这种闲适的心情让我能更清晰的看到这些事情之间的联系,以及这些联系透露出来的信息。换做是几年前,我可能会意难平,而现在,有些事情不想再去执着了。因为当更清楚的看清那些现象背后的未被言出的原因时,就知道有些执着是无意义的,顺势而为才是明智之举。我和我身边的人,未来会走向何方?</p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/note/l/public/p85306883.webp"></div></div><p></p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img9.doubanio.com/view/note/l/public/p85306886.webp"></div></div><p></p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/note/l/public/p85306889.webp"></div></div><p></p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/note/l/public/p85306897.webp"></div></div><p></p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img3.doubanio.com/view/note/l/public/p85306900.webp"></div></div><p></p><div class="image-container image-float-center"><div class="image-wrapper"><img src="https://img2.doubanio.com/view/note/l/public/p85306901.webp"></div></div><p></p><p></p>
+ </div>
+
+
+
+ <div class="mod-tags">
+ <a href="https://www.douban.com/channel/30168795">人生</a>
+ <a href="https://www.douban.com/channel/30307899">小镇</a>
+ <a href="https://www.douban.com/note/tags/%E6%B9%98%E8%A5%BF?people=shuaidefadai&amp;all=1">湘西</a>
+ <a href="https://www.douban.com/note/tags/%E6%BC%AB%E6%AD%A5?people=shuaidefadai&amp;all=1">漫步</a>
+ </div>
+
+
+ <div id="link-report_note">
+
+
+ </div>
+
+ <div class="copyright-claim original">
+ <p>本文版权归 <a href="https://www.douban.com/people/shuaidefadai/">孩子气概</a> 所有,任何形式转载请联系作者。</p>
+ <p><a href="https://help.douban.com/diary?app=main#t2-qs">了解版权计划</a></p>
+ </div>
+
+
+ </div>
+ </div>
+
+
+
+
+
+
+ <div id="note_814698224_footer" class="note-ft">
+
+
+
+
+
+
+ <div class="note-footer-stat">
+
+ </div>
+
+ <div class="sns-bar">
+
+ <div class="footer-sharing">
+
+
+
+ <div class="action-react">
+ <a class="react-btn react-like j a_show_login" href="https://www.douban.com/accounts/register?reason=like">赞</a>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="sharing">
+ <div class="sharing-button">
+ <div class="sharing-douban">
+
+
+
+ <div class="rec-sec">
+
+
+ <span class="rec">
+
+ <a href="https://www.douban.com/accounts/register?reason=collect" class="j a_show_login lnk-sharing lnk-douban-sharing">
+
+ 转发
+
+ </a>
+ </span>
+
+
+ </div>
+
+ </div>
+ <span class="sharing-indicator"></span>
+ </div>
+
+ <div class="sharing-layer is-hidden" hidden="">
+ <div class="sharing-wechat">
+ <span class="sharing-icon__wechat">微信扫码</span>
+ <div class="sharing-wechat-qrcode"></div>
+ </div>
+
+ <ul class="sharing-list">
+ <li class="sharing-icon__weibo">新浪微博</li>
+ <li class="sharing-icon__qq">QQ好友</li>
+ <li class="sharing-icon__qzone">QQ空间</li>
+ </ul>
+ </div>
+
+
+
+ </div>
+
+
+ </div>
+
+ </div>
+ </div>
+ <!-- douban ad begain -->
+ <div id="dale_note_after_readmore"></div>
+ <!-- douban ad end -->
+
+ </div>
+
+ <div class="clear">
+ </div>
+
+ <div class="tabs" id="sep">
+ <a href="https://www.douban.com/note/814698224/#sep" class="on">回应</a>
+ <a href="https://www.douban.com/note/814698224/?type=rec#sep">转发</a>
+ <a href="https://www.douban.com/note/814698224/?type=like#sep">赞</a>
+ <a href="https://www.douban.com/note/814698224/?type=collect#sep">收藏</a>
+ <a href="https://www.douban.com/note/814698224/?type=donate#sep">赞赏</a>
+ </div>
+
+ <div class="">
+
+
+
+
+<div id="comments" class="comment-list"><div class="comments-app-wrapper"><div class="no-comments">暂无回复</div><a class="show_login" href="https://accounts.douban.com/passport/login?redir=https%3A%2F%2Fwww.douban.com%2Fnote%2F814698224%2F">&gt; 我来回复</a></div></div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </div>
+
+
+
+
+
+
+ </div>
+ <div class="aside">
+
+
+
+
+
+
+
+
+<div class="mod mod-usercard">
+ <div class="pic">
+ <a href="https://www.douban.com/people/shuaidefadai/"><img src="https://img3.doubanio.com/icon/up59571810-8.jpg" alt="孩子气概"></a>
+ </div>
+ <div class="content">
+ <a href="https://www.douban.com/people/shuaidefadai/">孩子气概</a>
+ <span class="usercard-loc">(湖南长沙)</span>
+ <p>朝悟道,夕死可矣。</p>
+ <div class="ft">
+ </div>
+ </div>
+</div>
+
+
+
+
+
+
+
+
+
+ <div class="mod">
+ <div id="dale_personal_note_top_right"></div>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<div class="mod" id="hot-topics-mod">
+
+
+ <h2>
+ 热门话题
+ &nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·
+ <span class="pl">&nbsp;(
+
+ <a href="/gallery/">去话题广场</a>
+ ) </span>
+ </h2>
+
+
+ <ul id="hot-topics">
+
+ <li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667687/" class="rec_topics_name">生活再难,也不要让自己一直困在“受苦感”里</a><div class="rec_topics_subtitle">2502篇内容 · 441.0万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667717/" class="rec_topics_name">总有一些微小的快乐,让我爱上这日复一日的生活</a><div class="rec_topics_subtitle">1010篇内容 · 110.4万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667746/" class="rec_topics_name">桂花飘香的时候,秋意就浓了</a><div class="rec_topics_subtitle">1.0万+篇内容 · 9.1万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667727/" class="rec_topics_name">你受过的委屈,身体一直都记得</a><div class="rec_topics_subtitle">342篇内容 · 62.7万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667471/" class="rec_topics_name">事过即过,人不回望</a><div class="rec_topics_subtitle">1218篇内容 · 230.7万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/search?q=%23%E7%94%9F%E6%B4%BB%E8%BF%98%E6%98%AF%E8%A6%81%E5%8F%AF%E5%8F%AF%E7%88%B1%E7%88%B1%23" class="rec_topics_name">生活还是要可可爱爱</a><div class="rec_topics_subtitle">19篇内容 · 2945次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667756/" class="rec_topics_name">加拿大诗人安妮·卡森获2026年诺贝尔文学奖</a><div class="rec_topics_subtitle">108篇内容 · 83.4万次浏览</div></li><li class="rec_topics"><a href="https://www.douban.com/gallery/topic/3667760/" class="rec_topics_name">那些没有如愿的事,后来把你带去了哪里?</a><div class="rec_topics_subtitle">26篇内容 · 1888次浏览</div></li></ul>
+
+</div>
+
+
+
+
+ <!-- douban ad begin -->
+ <div id="dale_personal_note_middle_right"></div>
+ <!-- douban ad end -->
+
+
+
+<div class="mod">
+</div>
+
+ <!-- douban app begin -->
+ <div id="dale_personal_note_inner_bottom"></div>
+ <!-- douban app end -->
+
+ </div>
+ <div class="extra">
+
+
+<!-- douban ad begin -->
+<div id="dale_personal_note_bottom_super_banner"></div>
+
+<!-- douban ad end -->
+
+
+ </div>
+ </div>
+</div></body></html>
diff --git a/apps/extension/fixtures/platforms/jike-feed.html b/apps/extension/fixtures/platforms/jike-feed.html
new file mode 100644
index 00000000..ab3d7b2a
--- /dev/null
+++ b/apps/extension/fixtures/platforms/jike-feed.html
@@ -0,0 +1 @@
+<!doctype html><html><head><title>AI探索站 - 即刻App</title></head><body><ul class="post-list"><li class="jsx-2193720232 post-item-li"><div class="jsx-1823662304"><div class="jsx-3802438259 wrap"><a class="jsx-4100394151 avatar " href="/users/C53E9127-90D4-4474-A31D-061A218FD360"></a><div class="jsx-3802438259 info"><div class="jsx-3802438259 title">陈皮皮屁</div><div class="jsx-3802438259 subtitle">1天前</div></div><div class="jsx-3802438259"></div></div><div class="jsx-1330250023 wrap"><div class="jsx-1330250023 text"><div class="jsx-3930310120 wrap">新播客,请<a class="jsx-3930310120" href="/users/90f48ae7-bdca-422f-ad22-c37383575469">@莫子皓Peter </a>分享了些做新产品 Ambi 的思考:<br class="jsx-3930310120"><br class="jsx-3930310120">1/ 前段时间很火的各种 PA 产品,其实都还缺两块:线下 context 和更好的交互。<br class="jsx-3930310120"><br class="jsx-3930310120">这两件事之所以重要,是因为大家可能只是想做一件小事,调用 agent 却要交代一堆背景、花很多时间,自然会嫌麻烦。<br class="jsx-3930310120"><br class="jsx-3930310120">举个例子。AI 眼镜是很好的形态,但很多产品的交互很奇怪:明明一直戴在脸上,想让它帮忙做件事,却还得先唤醒它,把刚刚看到、听到的东西复述一遍。<br class="jsx-3930310120"><br class="jsx-3930310120">但足够好用的 personal agent 应该是 always-on 的,让人有「言出法随」的感觉:时刻看到你看到的、听到你听到的,你一说需求,它就能给你 deliver 结果。<br class="jsx-3930310120"><br class="jsx-3930310120">2/ 相比于纯软件,硬件有几个特点:<br class="jsx-3930310120"><br class="jsx-3930310120">- 分发不必依附封闭的社交平台,建立起自己的渠道后,不必每次都向上游买流量。<br class="jsx-3930310120">这也是纯做软件面临的一个巨大卡点:如果获客渠道依赖有强网络效应的上游,就很难长成独立的巨无霸。<br class="jsx-3930310120"><br class="jsx-3930310120">- 有独占性。电脑上可以同时跑十几个软件,身体的同一个部位通常只会戴一个设备。<br class="jsx-3930310120"><br class="jsx-3930310120">- 不容易被一家垄断,强如苹果也没做到。<br class="jsx-3930310120"><br class="jsx-3930310120">3/ 用户在使用 personal agent 时,在意的是成功率、速度和质量。目前看来,速度可以适当让步,而且大家更在意能不能把事情做成,不那么在意背后用的是什么模型。所以理论上,是有机会把商业模式跑通的。<br class="jsx-3930310120"><br class="jsx-3930310120">不过 proactive 是另一笔难算的账。很多产品靠 connector 的变化或定时扫描,去猜用户此刻需要什么,花了大量推理成本,推过来的东西却未必合时宜,还可能造成打扰。偶尔的一次 aha moment,究竟能不能换来留存和付费呢?<br class="jsx-3930310120"><br class="jsx-3930310120">4/ 有点唏嘘的是,AI 时代的国内大厂好像少了移动互联网时代那种成为世界第一、领先全球的雄心,更多是在做「中国的某某」。过去一段时间,也鲜有国人做出的、让人眼前一亮的 AI 产品跑出来。我们也不知道背后的原因到底是什么。</div></div><div class="jsx-3630992031 audio-mini-player "><audio src="https://media.xyzcdn.net/648b0b641c48983391a63f98/lkR2rf-l-fT_P_I6f-TaY5vLNT6e.m4a" class="jsx-3630992031" hidden="">您的浏览器不支持 audio 标签。</audio><div class="jsx-3630992031 cover"><button class="jsx-3630992031 op-btn"></button></div><div class="jsx-3630992031 info"><h1 class="jsx-3630992031 title">一个 Personal Agent 创业者的思考|对谈 Ambi 创始人子皓</h1><h3 class="jsx-3630992031 author">42章经</h3></div><div class="jsx-3630992031 progress"><div class="jsx-3630992031"></div></div></div></div><div class="jsx-2348414216 wrap"><svg><path></path></svg><span class="jsx-2348414216 like-count">24</span><svg><path></path></svg><span class="jsx-2348414216 comment-count"> <!-- -->2</span><svg><path></path><path></path><path></path></svg><span class="jsx-2348414216 repost-count">11</span></div></div></li><li class="jsx-2193720232 post-item-li"><div class="jsx-1823662304"><div class="jsx-3802438259 wrap"><a class="jsx-4100394151 avatar " href="/users/BD79269E-585E-4D5D-8DEF-1822B733E10B"></a><div class="jsx-3802438259 info"><div class="jsx-3802438259 title">JimHuiHui</div><div class="jsx-3802438259 subtitle">1天前</div></div><div class="jsx-3802438259"></div></div><div class="jsx-1330250023 wrap"><div class="jsx-1330250023 text"><div class="jsx-3930310120 wrap">今天和朋友聊了很久,关于<!-- --> <!-- -->AI<!-- --> <!-- -->对游戏、影视以及整个内容行业的影响。越聊越觉得,我们现在正站在一个很有意思的历史节点上。<br class="jsx-3930310120">聊天内容过长,我已经重新整理,补充部分论证例子,讨论如下:<br class="jsx-3930310120"><br class="jsx-3930310120">01|我们正在经历一场被压缩到<!-- --> <!-- -->1–2<!-- --> <!-- -->年的“雅达利大崩溃”。<br class="jsx-3930310120"><br class="jsx-3930310120">1983<!-- --> <!-- -->年的北美游戏市场崩溃,原因非常复杂,但其中一个重要因素,就是大量低质量产品涌入市场,消费者逐渐失去信任,零售渠道也难以消化过剩的游戏。<br class="jsx-3930310120"><br class="jsx-3930310120">今天<!-- --> <!-- -->AI<!-- --> <!-- -->带来的变化,某种程度上与之相似。过去,制作一款游戏、一部动画,至少需要相当的技术、资金与团队门槛。现在,这些门槛正在被快速降低。<br class="jsx-3930310120"><br class="jsx-3930310120">Steam<!-- --> <!-- -->上独立游戏的数量早已非常庞大;AI<!-- --> <!-- -->辅助开发又进一步降低了程序、美术、音效甚至游戏设计的实现成本。未来,一个人制作过去需要十几人完成的产品,并不是不可想象的事情。<br class="jsx-3930310120"><br class="jsx-3930310120">但问题是:生产能力的爆发,并不意味着消费能力也会同步增长。用户每天依然只有<!-- --> <!-- -->24<!-- --> <!-- -->小时。当所有人都能够生产内容时,内容本身就不再是稀缺品。我们也许会看到大量新项目出现,大量项目快速死亡,以及一轮又一轮的注意力争夺。<br class="jsx-3930310120"><br class="jsx-3930310120">02|AI<!-- --> <!-- -->不会立刻摧毁传统内容公司,但会极大压缩它们的生存空间。<br class="jsx-3930310120"><br class="jsx-3930310120">雅达利大崩溃之后,并不是电子游戏消失了,而是整个产业重新洗牌,任天堂<!-- --> <!-- -->FC<!-- --> <!-- -->等新体系逐渐建立起来。值得注意的是,FC<!-- --> <!-- -->的成功不仅来自硬件和游戏,更来自平台对内容品质、发行和渠道的重新组织。<br class="jsx-3930310120"><br class="jsx-3930310120">今天的<!-- --> <!-- -->AI<!-- --> <!-- -->时代也可能如此。传统大型团队、资本密集型制作模式,依然有技术、管理、品牌与发行优势。但与此同时,过去需要数年、数千万成本才能完成的某些工作,未来可能被压缩到几个月甚至几周。<br class="jsx-3930310120"><br class="jsx-3930310120">这会产生一个很残酷的结果:资本投入不再天然构成竞争壁垒,甚至可能成为沉重的历史包袱。当然,低成本不等于好产品。技术门槛下降后,审美、创意、决策与产品能力反而会成为更加直接的竞争因素。<br class="jsx-3930310120"><br class="jsx-3930310120">03|我不认为<!-- --> <!-- -->AI<!-- --> <!-- -->时代的内容市场,会简单变成“谁便宜谁赢”。<br class="jsx-3930310120"><br class="jsx-3930310120">看看今天的短剧市场,尤其是红果这样的免费短剧平台。它们带来的变化,不仅是制作成本和发行模式的变化,更重要的是重新组织了内容消费的方式。用户通过免费内容进入平台,平台通过广告等方式变现,而内容创作者则需要在这一套新的分发与商业体系中寻找自己的位置。<br class="jsx-3930310120"><br class="jsx-3930310120">这提醒了一个问题:未来,真正掌握商业价值的,究竟是生产内容的人,还是掌握用户入口、分发机制与商业转化的平台?当内容越来越容易被生产时,流量并不会自动转化为创作者的利润。甚至有可能出现内容供给越来越丰富,而单个创作者的议价能力却越来越弱的局面。<br class="jsx-3930310120"><br class="jsx-3930310120">04|AI<!-- --> <!-- -->时代,低成本是一种生存优势,但流量不是最终目的。<br class="jsx-3930310120"><br class="jsx-3930310120">我最近看到不少<!-- --> <!-- -->AI<!-- --> <!-- -->辅助开发的独立游戏<!-- --> <!-- -->Demo,其中有些已经有相当不错的完成度。我认为,这类项目现阶段并不一定要急于证明自己能够成为下一款百万销量的游戏。它们完全可以先以低成本方式持续迭代,作为产品<!-- --> <!-- -->Demo<!-- --> <!-- -->吸引注意力、获取用户反馈,逐渐建立自己的核心受众。如果能够获得持续流量,相比过去需要投入大量营销预算,这本身就已经构成了一种成本优势。<br class="jsx-3930310120"><br class="jsx-3930310120">但这里还有一个非常关键的问题:流量必须具有持续性,而且不能轻易被替代。靠一个爆款视频、一段<!-- --> <!-- -->AI<!-- --> <!-- -->视觉奇观获取的注意力,很容易被下一个更新鲜的作品夺走。而一款真正有趣的游戏、一个让人牵挂的角色、一套能够持续扩展的世界观,才有机会让用户主动回来。所以我越来越觉得,创作者应该从追求一次性传播,逐渐转向建立长期的用户关系。<br class="jsx-3930310120"><br class="jsx-3930310120">05|我们真正需要警惕的是:创作成本下降了,但创作者的生存问题并没有被解决。<br class="jsx-3930310120"><br class="jsx-3930310120">假设未来一个独立团队只需要<!-- --> <!-- -->3<!-- --> <!-- -->个人,就能够完成过去<!-- --> <!-- -->30<!-- --> <!-- -->人的工作。看上去成本降低了<!-- --> <!-- -->90%。但如果市场上的同类产品数量增加了<!-- --> <!-- -->100<!-- --> <!-- -->倍,获客难度不断提高,那么这个团队真的比过去更容易生存吗?<br class="jsx-3930310120"><br class="jsx-3930310120">不一定。甚至,AI<!-- --> <!-- -->越普及,用户的注意力越昂贵。这可能让创作者陷入一个新的循环:制作越来越快,竞争越来越激烈,作品的商业生命周期越来越短,不得不持续生产内容来维持曝光。在这种情况下,低成本只能解决“如何活下去”的一部分问题,却无法自动回答“为什么用户要选择你”。<br class="jsx-3930310120"><br class="jsx-3930310120">换个比喻,现在的内容创作面临的挑战,堪比在川渝新开一家火锅店,并存活3年以上。<br class="jsx-3930310120"><br class="jsx-3930310120">06|我更期待<!-- --> <!-- -->AI<!-- --> <!-- -->时代的下一台<!-- --> <!-- -->FC,而不是一万台更便宜的雅达利。<br class="jsx-3930310120"><br class="jsx-3930310120">这里说的<!-- --> <!-- -->FC,未必是某一台硬件。它可能是新的内容平台、新的游戏交互方式、AI<!-- --> <!-- -->原生的娱乐形态,甚至是今天我们还无法定义的东西。下一代内容未必只是更便宜的电影、更快速生产的动画,或者更容易开发的游戏。正如早期电子游戏并不是简单复制电影,未来的<!-- --> <!-- -->AI<!-- --> <!-- -->原生内容,可能也不会停留在模仿今天的影视与游戏。<br class="jsx-3930310120"><br class="jsx-3930310120">我自己非常期待这样的变化。但在那个节点到来之前,我认为内容创作者可能要做好一个现实准备:<br class="jsx-3930310120"><br class="jsx-3930310120">深挖洞,广积粮。<br class="jsx-3930310120"><br class="jsx-3930310120">尽可能降低成本,维持创作自由,积累自己的作品、技术、审美体系与核心用户。不要因为<!-- --> <!-- -->AI<!-- --> <!-- -->让生产变得容易,就误以为建立一个能够长期生存的创作事业也会变得容易。未来真正值得关注的,不是谁能生产最多内容,而是谁能够在无限内容的时代,让用户仍然愿意为他的作品付出时间。这可能才是<!-- --> <!-- -->AI<!-- --> <!-- -->时代内容创作者真正的护城河。</div></div><div class="jsx-1271604522 wrap single "><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FpxBWAHgh3YkmrnX83pA8R5_4glTv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div></div></div><div class="jsx-2348414216 wrap"><svg><path></path></svg><span class="jsx-2348414216 like-count">24</span><svg><path></path></svg><span class="jsx-2348414216 comment-count"> <!-- -->8</span><svg><path></path><path></path><path></path></svg><span class="jsx-2348414216 repost-count">12</span></div></div></li></ul><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"posts":[{"id":"6aceee92141b85b292eb4e27","type":"ORIGINAL_POST","content":"新播客,请@莫子皓Peter 分享了些做新产品 Ambi 的思考:\n\n1/ 前段时间很火的各种 PA 产品,其实都还缺两块:线下 context 和更好的交互。\n\n这两件事之所以重要,是因为大家可能只是想做一件小事,调用 agent 却要交代一堆背景、花很多时间,自然会嫌麻烦。\n\n举个例子。AI 眼镜是很好的形态,但很多产品的交互很奇怪:明明一直戴在脸上,想让它帮忙做件事,却还得先唤醒它,把刚刚看到、听到的东西复述一遍。\n\n但足够好用的 personal agent 应该是 always-on 的,让人有「言出法随」的感觉:时刻看到你看到的、听到你听到的,你一说需求,它就能给你 deliver 结果。\n\n2/ 相比于纯软件,硬件有几个特点:\n\n- 分发不必依附封闭的社交平台,建立起自己的渠道后,不必每次都向上游买流量。\n这也是纯做软件面临的一个巨大卡点:如果获客渠道依赖有强网络效应的上游,就很难长成独立的巨无霸。\n\n- 有独占性。电脑上可以同时跑十几个软件,身体的同一个部位通常只会戴一个设备。\n\n- 不容易被一家垄断,强如苹果也没做到。\n\n3/ 用户在使用 personal agent 时,在意的是成功率、速度和质量。目前看来,速度可以适当让步,而且大家更在意能不能把事情做成,不那么在意背后用的是什么模型。所以理论上,是有机会把商业模式跑通的。\n\n不过 proactive 是另一笔难算的账。很多产品靠 connector 的变化或定时扫描,去猜用户此刻需要什么,花了大量推理成本,推过来的东西却未必合时宜,还可能造成打扰。偶尔的一次 aha moment,究竟能不能换来留存和付费呢?\n\n4/ 有点唏嘘的是,AI 时代的国内大厂好像少了移动互联网时代那种成为世界第一、领先全球的雄心,更多是在做「中国的某某」。过去一段时间,也鲜有国人做出的、让人眼前一亮的 AI 产品跑出来。我们也不知道背后的原因到底是什么。","createdAt":"2026-10-14T02:53:06.531Z","user":{"id":"6336e01f3f356bbbae2b4f7e","screenName":"陈皮皮屁","username":"C53E9127-90D4-4474-A31D-061A218FD360"},"pictures":[]},{"id":"6ace942f756bbb66581c3f96","type":"ORIGINAL_POST","content":"今天和朋友聊了很久,关于 AI 对游戏、影视以及整个内容行业的影响。越聊越觉得,我们现在正站在一个很有意思的历史节点上。\n聊天内容过长,我已经重新整理,补充部分论证例子,讨论如下:\n\n01|我们正在经历一场被压缩到 1–2 年的“雅达利大崩溃”。\n\n1983 年的北美游戏市场崩溃,原因非常复杂,但其中一个重要因素,就是大量低质量产品涌入市场,消费者逐渐失去信任,零售渠道也难以消化过剩的游戏。\n\n今天 AI 带来的变化,某种程度上与之相似。过去,制作一款游戏、一部动画,至少需要相当的技术、资金与团队门槛。现在,这些门槛正在被快速降低。\n\nSteam 上独立游戏的数量早已非常庞大;AI 辅助开发又进一步降低了程序、美术、音效甚至游戏设计的实现成本。未来,一个人制作过去需要十几人完成的产品,并不是不可想象的事情。\n\n但问题是:生产能力的爆发,并不意味着消费能力也会同步增长。用户每天依然只有 24 小时。当所有人都能够生产内容时,内容本身就不再是稀缺品。我们也许会看到大量新项目出现,大量项目快速死亡,以及一轮又一轮的注意力争夺。\n\n02|AI 不会立刻摧毁传统内容公司,但会极大压缩它们的生存空间。\n\n雅达利大崩溃之后,并不是电子游戏消失了,而是整个产业重新洗牌,任天堂 FC 等新体系逐渐建立起来。值得注意的是,FC 的成功不仅来自硬件和游戏,更来自平台对内容品质、发行和渠道的重新组织。\n\n今天的 AI 时代也可能如此。传统大型团队、资本密集型制作模式,依然有技术、管理、品牌与发行优势。但与此同时,过去需要数年、数千万成本才能完成的某些工作,未来可能被压缩到几个月甚至几周。\n\n这会产生一个很残酷的结果:资本投入不再天然构成竞争壁垒,甚至可能成为沉重的历史包袱。当然,低成本不等于好产品。技术门槛下降后,审美、创意、决策与产品能力反而会成为更加直接的竞争因素。\n\n03|我不认为 AI 时代的内容市场,会简单变成“谁便宜谁赢”。\n\n看看今天的短剧市场,尤其是红果这样的免费短剧平台。它们带来的变化,不仅是制作成本和发行模式的变化,更重要的是重新组织了内容消费的方式。用户通过免费内容进入平台,平台通过广告等方式变现,而内容创作者则需要在这一套新的分发与商业体系中寻找自己的位置。\n\n这提醒了一个问题:未来,真正掌握商业价值的,究竟是生产内容的人,还是掌握用户入口、分发机制与商业转化的平台?当内容越来越容易被生产时,流量并不会自动转化为创作者的利润。甚至有可能出现内容供给越来越丰富,而单个创作者的议价能力却越来越弱的局面。\n\n04|AI 时代,低成本是一种生存优势,但流量不是最终目的。\n\n我最近看到不少 AI 辅助开发的独立游戏 Demo,其中有些已经有相当不错的完成度。我认为,这类项目现阶段并不一定要急于证明自己能够成为下一款百万销量的游戏。它们完全可以先以低成本方式持续迭代,作为产品 Demo 吸引注意力、获取用户反馈,逐渐建立自己的核心受众。如果能够获得持续流量,相比过去需要投入大量营销预算,这本身就已经构成了一种成本优势。\n\n但这里还有一个非常关键的问题:流量必须具有持续性,而且不能轻易被替代。靠一个爆款视频、一段 AI 视觉奇观获取的注意力,很容易被下一个更新鲜的作品夺走。而一款真正有趣的游戏、一个让人牵挂的角色、一套能够持续扩展的世界观,才有机会让用户主动回来。所以我越来越觉得,创作者应该从追求一次性传播,逐渐转向建立长期的用户关系。\n\n05|我们真正需要警惕的是:创作成本下降了,但创作者的生存问题并没有被解决。\n\n假设未来一个独立团队只需要 3 个人,就能够完成过去 30 人的工作。看上去成本降低了 90%。但如果市场上的同类产品数量增加了 100 倍,获客难度不断提高,那么这个团队真的比过去更容易生存吗?\n\n不一定。甚至,AI 越普及,用户的注意力越昂贵。这可能让创作者陷入一个新的循环:制作越来越快,竞争越来越激烈,作品的商业生命周期越来越短,不得不持续生产内容来维持曝光。在这种情况下,低成本只能解决“如何活下去”的一部分问题,却无法自动回答“为什么用户要选择你”。\n\n换个比喻,现在的内容创作面临的挑战,堪比在川渝新开一家火锅店,并存活3年以上。\n\n06|我更期待 AI 时代的下一台 FC,而不是一万台更便宜的雅达利。\n\n这里说的 FC,未必是某一台硬件。它可能是新的内容平台、新的游戏交互方式、AI 原生的娱乐形态,甚至是今天我们还无法定义的东西。下一代内容未必只是更便宜的电影、更快速生产的动画,或者更容易开发的游戏。正如早期电子游戏并不是简单复制电影,未来的 AI 原生内容,可能也不会停留在模仿今天的影视与游戏。\n\n我自己非常期待这样的变化。但在那个节点到来之前,我认为内容创作者可能要做好一个现实准备:\n\n深挖洞,广积粮。\n\n尽可能降低成本,维持创作自由,积累自己的作品、技术、审美体系与核心用户。不要因为 AI 让生产变得容易,就误以为建立一个能够长期生存的创作事业也会变得容易。未来真正值得关注的,不是谁能生产最多内容,而是谁能够在无限内容的时代,让用户仍然愿意为他的作品付出时间。这可能才是 AI 时代内容创作者真正的护城河。","createdAt":"2026-10-13T20:27:27.795Z","user":{"id":"67cfe70c5a39aebb33354b0b","screenName":"JimHuiHui","username":"BD79269E-585E-4D5D-8DEF-1822B733E10B"},"pictures":[{"picUrl":"https://cdnv2.ruguoapp.com/FpxBWAHgh3YkmrnX83pA8R5_4glTv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FpxBWAHgh3YkmrnX83pA8R5_4glTv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FpxBWAHgh3YkmrnX83pA8R5_4glTv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"}]}]}},"query":{"id":"63579abb6724cc583b9bba9a"}}</script></body></html>
\ No newline at end of file
diff --git a/apps/extension/fixtures/platforms/jike-grid.html b/apps/extension/fixtures/platforms/jike-grid.html
new file mode 100644
index 00000000..99b8fc69
--- /dev/null
+++ b/apps/extension/fixtures/platforms/jike-grid.html
@@ -0,0 +1,4 @@
+<!doctype html><html><head><meta><title>又凑了九张赤坎游客照📷 - 即刻App</title><meta property="og:type" content="website" class="jsx-2695884299" hidden="">
+<meta property="og:title" content="又凑了九张赤坎游客照📷 - 即刻App" class="jsx-2695884299" hidden="">
+<meta property="og:description" content="即刻App,享受探索、表达和创造" class="jsx-2695884299" hidden="">
+<meta property="og:image" content="https://cdnv2.ruguoapp.com/Fomudd4aWipvYdXwMtMYKOXvEppGv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1" class="jsx-2695884299" hidden=""></head><body><div class="jsx-2063150089 post-page"><div class="jsx-2063150089 post-wrap"><div class="jsx-3802438259 wrap"><a class="jsx-4100394151 avatar " href="https://m.okjike.com/users/af47ed7e-38d4-4798-acd6-04e3cc8d131c"></a><div class="jsx-3802438259 info"><div class="jsx-3802438259 title">彗星咻咻咻</div><div class="jsx-3802438259 subtitle">2年前</div></div><div class="jsx-3802438259"></div></div><div class="jsx-1330250023 wrap"><div class="jsx-1330250023 text"><div class="jsx-3930310120 wrap">又凑了九张赤坎游客照📷</div></div><div class="jsx-1271604522 wrap "><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/Fomudd4aWipvYdXwMtMYKOXvEppGv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FmmM5l3zszBUITIKXQEEPGI8Z8otv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FtQZcVzgBTg-lJOuradPQVC2dvrBv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FqNFXlt2QiHTkOSWB6ummLSRpKaHv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FrtUdbr1JCqYIG2givgfyz52Ctgov3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FjhivZ8rKIw_BhGFAEJ8JJaMB_S7v3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/Fr9g82zEL3GmAGzYjwBJY9Nt7lfjv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FjhSV8EBySlvHm6OgKk65uX-mACvv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FmcmZEXd8etEueSU09Zy9_gLaYe9v3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1" class="jsx-3757717757 image"></div></div></div></div><div class="jsx-2348414216 wrap"><svg><path></path></svg><span class="jsx-2348414216 like-count">82</span><svg><path></path></svg><span class="jsx-2348414216 comment-count"> <!-- -->8</span><svg><path></path><path></path><path></path></svg><span class="jsx-2348414216 repost-count">3</span></div></div><h2 class="jsx-2063150089">来自圈子</h2><a class="jsx-4202418277 wrap" href="https://m.okjike.com/topics/5b7d2e3aaa31960017c5a206"><img src="https://cdnv2.ruguoapp.com/Fv0CkVUdvO5fB4IzpQ9GURztJKtz.png?imageMogr2/auto-orient/heic-exif/1/format/jpeg/thumbnail/120x120%3E" alt="圈子图片" class="jsx-4202418277"><div class="jsx-4202418277 content"><h3 class="jsx-4202418277">一起拍写真</h3><p class="jsx-4202418277 subtitle">440338<!-- -->人已经加入</p></div><button class="jsx-4202418277">加入</button></a><div class="jsx-1441003726 wrap"><h2 class="jsx-1441003726">热门评论</h2><ul class="jsx-1441003726"><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/135dea24-7b21-4000-b884-85579f7761ea"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">Nep兔</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">啊,我好喜欢这种真实的身材长相,然后又好有气质好干净的小姐姐🦄穿搭也是大大方方,针织衫和小兔子吊带的链接能发一下么哈哈哈哈哈哈哈</div></div><div class="jsx-1271604522 wrap "></div><div class="jsx-3537737692 hot-replies"><div class="jsx-3537737692 hot-reply"><div class="jsx-3537737692"><span class="jsx-3537737692 primary">彗星咻咻咻</span>: 都是好久之前买的 店铺都下架了 你可以识图试试</div></div><div class="jsx-3537737692"> </div></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/A644A8A5-9A0D-4EF5-9A9C-E3A0ED5A91FC"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">吃螃蟹不蘸醋</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">图7太好看了</div></div><div class="jsx-1271604522 wrap "></div><div class="jsx-3537737692 hot-replies"><div class="jsx-3537737692 hot-reply"><div class="jsx-3537737692"><span class="jsx-3537737692 primary">彗星咻咻咻</span>: Get到了妈妈最爱的风格</div></div><div class="jsx-3537737692"> </div></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/25d08d54-1be5-4eea-9f76-8970b30e665d"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">深水清</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">开平赤坎</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/396379D0-E2A2-4AF0-AC59-6265D9D38A6C"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">橘色晚风</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">真美</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/E3443653-FB48-4B95-9F4E-5235EEECD132"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">正气天蝎</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">九宫格照片真是好看,我也是感觉最美不过图七呢!甜美御姐风哟!</div></div><div class="jsx-1271604522 wrap "></div></div></li></ul></div><div class="jsx-1441003726 more-comments-wrap">查看更多<span class="jsx-1441003726"> 8 条</span>评论</div></div><script id="__NEXT_DATA__" type="application/json">{"query":{"postType":"originalPosts","id":"6715e824d9dc81724c2ec74d"},"props":{"pageProps":{"post":{"id":"6715e824d9dc81724c2ec74d","content":"又凑了九张赤坎游客照📷","createdAt":"2024-10-21T05:35:32.711Z","pictures":[{"picUrl":"https://cdnv2.ruguoapp.com/Fomudd4aWipvYdXwMtMYKOXvEppGv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/Fomudd4aWipvYdXwMtMYKOXvEppGv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/Fomudd4aWipvYdXwMtMYKOXvEppGv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FmmM5l3zszBUITIKXQEEPGI8Z8otv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FmmM5l3zszBUITIKXQEEPGI8Z8otv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FmmM5l3zszBUITIKXQEEPGI8Z8otv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FtQZcVzgBTg-lJOuradPQVC2dvrBv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FtQZcVzgBTg-lJOuradPQVC2dvrBv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FtQZcVzgBTg-lJOuradPQVC2dvrBv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FqNFXlt2QiHTkOSWB6ummLSRpKaHv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FqNFXlt2QiHTkOSWB6ummLSRpKaHv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FqNFXlt2QiHTkOSWB6ummLSRpKaHv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FrtUdbr1JCqYIG2givgfyz52Ctgov3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FrtUdbr1JCqYIG2givgfyz52Ctgov3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FrtUdbr1JCqYIG2givgfyz52Ctgov3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FjhivZ8rKIw_BhGFAEJ8JJaMB_S7v3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FjhivZ8rKIw_BhGFAEJ8JJaMB_S7v3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FjhivZ8rKIw_BhGFAEJ8JJaMB_S7v3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/Fr9g82zEL3GmAGzYjwBJY9Nt7lfjv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/Fr9g82zEL3GmAGzYjwBJY9Nt7lfjv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/Fr9g82zEL3GmAGzYjwBJY9Nt7lfjv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FjhSV8EBySlvHm6OgKk65uX-mACvv3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FjhSV8EBySlvHm6OgKk65uX-mACvv3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FjhSV8EBySlvHm6OgKk65uX-mACvv3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"},{"picUrl":"https://cdnv2.ruguoapp.com/FmcmZEXd8etEueSU09Zy9_gLaYe9v3.jpg","middlePicUrl":"https://cdnv2.ruguoapp.com/FmcmZEXd8etEueSU09Zy9_gLaYe9v3.jpg?imageMogr2/auto-orient/thumbnail/1500x2000%3E/interlace/1","thumbnailUrl":"https://cdnv2.ruguoapp.com/FmcmZEXd8etEueSU09Zy9_gLaYe9v3.jpg?imageMogr2/auto-orient/thumbnail/300x2000%3E/quality/70/interlace/1"}]}}}}</script></body></html>
diff --git a/apps/extension/fixtures/platforms/jike-long.html b/apps/extension/fixtures/platforms/jike-long.html
new file mode 100644
index 00000000..8213f754
--- /dev/null
+++ b/apps/extension/fixtures/platforms/jike-long.html
@@ -0,0 +1,4 @@
+<!doctype html><html><head><meta><title>我在即刻写东西的核心原则是,怕什么真理无穷,进一步有一步的欢 - 即刻App</title><meta property="og:type" content="website" class="jsx-2695884299" hidden="">
+<meta property="og:title" content="我在即刻写东西的核心原则是,怕什么真理无穷,进一步有一步的欢 - 即刻App" class="jsx-2695884299" hidden="">
+<meta property="og:description" content="即刻App,享受探索、表达和创造" class="jsx-2695884299" hidden="">
+<meta property="og:image" content="https://cdnv2.ruguoapp.com/Fh0tWuiBG-hzO2d2ywmm8nrhh_gEv3.jpg?imageMogr2/auto-orient/heic-exif/1/format/jpeg/thumbnail/!120x120r/gravity/Center/crop/!120x120a0a0" class="jsx-2695884299" hidden=""></head><body><div class="jsx-2063150089 post-page"><div class="jsx-2063150089 post-wrap"><div class="jsx-3802438259 wrap"><a class="jsx-4100394151 avatar " href="https://m.okjike.com/users/5e6497e7-a69f-422b-af6e-baf0fc07b512"></a><div class="jsx-3802438259 info"><div class="jsx-3802438259 title">泛函</div><div class="jsx-3802438259 subtitle">3年前</div></div><div class="jsx-3802438259"></div></div><div class="jsx-1330250023 wrap"><div class="jsx-1330250023 text"><div class="jsx-3930310120 wrap">我在即刻写东西的核心原则是,怕什么真理无穷,进一步有一步的欢喜。<br class="jsx-3930310120"><br class="jsx-3930310120">当我每次取得一点点微小的进步,我都会快速地将自己的方法、启发和心得分享出来。<br class="jsx-3930310120"><br class="jsx-3930310120">这才是即刻涨粉的正道,既有利于你的成长,又有利于平台的发展,互利共赢。<br class="jsx-3930310120"><br class="jsx-3930310120">希望能激励到更多人分享自己的所思所想,我整理了一下自己曾写过的所有关于职业规划和个人成长的帖子,给伙计们做个示范😉<br class="jsx-3930310120"><br class="jsx-3930310120">探索出了一个超级高效的小红书内容生产方法:<a href="https://m.okjike.com/originalPosts/64c91b7dd8f8e55bd9760382" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">热爱的增长飞轮:<a href="https://m.okjike.com/originalPosts/6348375b0f59f6888d1aa9ee" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">最简单的找到你的优势的方法:<a href="https://m.okjike.com/originalPosts/6518e89f05145f31e5d2e32c" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">寻找自身优势的两条路径:探险家模式和科学家模式:<a href="https://m.okjike.com/originalPosts/64b416fc63e42a95c4b2dc78" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">和<a class="jsx-3930310120" href="https://m.okjike.com/users/d8313af9-e32a-4a28-bb65-19bbabc7f417">@凌空小鱼儿 </a>一起录的一期播客--《用少年心气抵御职业迷茫》:<a href="https://m.okjike.com/originalPosts/63894f2694ab4dc5baf2df47" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">“所有教你赚钱的人,都想赚你的钱。”我发现大伙儿对这句话有极大的误解 :<a href="https://m.okjike.com/originalPosts/64c7c0320b3c21926fddabf6" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">那些学历背景并不是很出色的人,是怎么取得职业成功的?<br class="jsx-3930310120"><a href="https://m.okjike.com/originalPosts/64a8d0bee54c189738e96a92" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">我是如何在即刻找了四份工作的?用社交媒体,构建你的职场品牌:<a href="https://m.okjike.com/originalPosts/6462fbd9f81d2c81bb734131" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">社交媒体与职业机会蓝海,类比搜索电商和兴趣电商:<a href="https://m.okjike.com/originalPosts/6462ffed502f200faee80cd6" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">既然大学与职场脱节严重,那为什么不把大学当成一个为期四年的兴趣班呢:<a href="https://m.okjike.com/originalPosts/6491c14460db290560bff338" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">在每份工作开始之前,先想明白自己的核心课题:<a href="https://m.okjike.com/originalPosts/6491c14460db290560bff338" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">如何找到「非共识职业机会」:<a href="https://m.okjike.com/originalPosts/6491c14460db290560bff338" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">适合于任何聊天的四个要素:人生节点、风口浪尖、江湖故人、心路历程:<a href="https://m.okjike.com/originalPosts/650515ae2a0c03ca13cd588f" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">系统的知识管理方法---PARA 体系:<a href="https://m.okjike.com/originalPosts/646e23389536223e2810be9c" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">反向构建你的信息茧房:<a href="https://m.okjike.com/originalPosts/655b184df9a492630b117163" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">用了多年的极简时间管理方法:<a href="https://m.okjike.com/originalPosts/64b69e09b1d391675d40d566" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">在学习新技能时,先想明白你最后想做成什么事情:<a href="https://m.okjike.com/originalPosts/63e0780f74aa215f91d5dda9" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">我离毕业还有一年,实习时长已超过了一年:<a href="https://m.okjike.com/originalPosts/63d34669b05829a8ee8081ce" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">成功化解了一次职场危机,复盘一下:<a href="https://m.okjike.com/originalPosts/6381a4caad185c8e63a427ce" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">对齐目标,与强者互赖:<a href="https://m.okjike.com/originalPosts/636884e57dc5011ff1b2286b" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">怎么区分老板是在 PUA 你,还是在严格管理:<a href="https://m.okjike.com/originalPosts/6360ff79057dc6dae5ed1b01" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">我目前最高赞的一条即刻动态:《职业生涯冷启动 SOP》:<a href="https://m.okjike.com/originalPosts/635a7c218d72f270dbdc14af" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">浅谈产品经理和产品营销的区别:<a href="https://m.okjike.com/originalPosts/635a7c218d72f270dbdc14af" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">我在大二那年,删掉了所有的课程,去字节实习:<a href="https://m.okjike.com/originalPosts/633cdae7532d83046c2268f0" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">我是团队中学历最低的那个,所以我真的好开心:<a href="https://m.okjike.com/originalPosts/633aff8dfd99f5f3bf2af333" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">在大厂是不是会沦为螺丝钉,只能干一些简单且无聊的杂活?<br class="jsx-3930310120"><a href="https://m.okjike.com/originalPosts/631d56654a6867af60b055a0" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">分享一个提升工作幸福感的小技巧!建一个自己的夸夸群:<a href="https://m.okjike.com/originalPosts/631ac474e565d7e69fb7afb2" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">大学四年,疫情三年,该如何破局?<br class="jsx-3930310120"><a href="https://m.okjike.com/originalPosts/62f7b8df231541bb568e20a7" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">打造你的简历中台:通过写简历的方式,来复盘工作。<br class="jsx-3930310120"><a href="https://m.okjike.com/originalPosts/62d3bbf6c69bb0d14741ff00" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">适用于各种活动运营的沟通原则:<a href="https://m.okjike.com/originalPosts/61fe53055865e700100d9e49" class="jsx-3930310120">m.okjike.com</a><br class="jsx-3930310120"><br class="jsx-3930310120">《世界尽头的咖啡馆》和《斯坦福大学人生设计课》:<a href="https://m.okjike.com/originalPosts/61ed0f92c7f0e70011d194c0" class="jsx-3930310120">m.okjike.com</a></div></div><div class="jsx-884992693 is-article"><img src="https://cdnv2.ruguoapp.com/FkNLTdkTP-IkR24J__5T2kaPUyg6v3.jpg" class="jsx-884992693 hero"><div class="jsx-884992693 body"><h3 class="jsx-884992693 title">泛函 - Yellow Page</h3><a href="https://jike.city/fanhan" class="jsx-884992693">点击阅读原文</a></div></div></div><div class="jsx-2348414216 wrap"><svg><path></path></svg><span class="jsx-2348414216 like-count">79</span><svg><path></path></svg><span class="jsx-2348414216 comment-count"> <!-- -->5</span><svg><path></path><path></path><path></path></svg><span class="jsx-2348414216 repost-count">47</span></div></div><h2 class="jsx-2063150089">来自圈子</h2><a class="jsx-4202418277 wrap" href="https://m.okjike.com/topics/55b30e4c00b0bb80c43bf532"><img src="https://cdnv2.ruguoapp.com/FqnqSGYjjMtvU4CBkJ7cdeuHkodN.png?imageMogr2/auto-orient/heic-exif/1/format/jpeg/thumbnail/120x120%3E" alt="圈子图片" class="jsx-4202418277"><div class="jsx-4202418277 content"><h3 class="jsx-4202418277">职场那些事儿</h3><p class="jsx-4202418277 subtitle">100万+<!-- -->人已经加入</p></div><button class="jsx-4202418277">加入</button></a><div class="jsx-1441003726 wrap"><h2 class="jsx-1441003726">热门评论</h2><ul class="jsx-1441003726"><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/d97a3fd7-25b4-410e-832c-ed577a05d587"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">孙易燃</span><span class="jsx-1441003726 time">3年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">太赞了</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/4e32c9dc-b62d-4a46-88b8-58bef599ecc2"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">知我AI</span><span class="jsx-1441003726 time">3年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">居然是00后</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/7D4331A5-7A8B-45C4-ADFE-C090703B4245"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">林厂长聊餐饮</span><span class="jsx-1441003726 time">3年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">00后优秀代表</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/BC9ED080-B004-46E2-8159-1BBE54B20968"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">丘卓</span><span class="jsx-1441003726 time">3年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">感谢泛函的分享,有视野有启发,还通过你连接到了天真老师😺</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/1b5e6b55-d9ec-48ce-aab8-ba9cad5810af"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">罗小布</span><span class="jsx-1441003726 time">3年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">这位老师的小红书账号,货很干‼️❗</div></div><div class="jsx-1271604522 wrap "></div></div></li></ul></div></div><script id="__NEXT_DATA__" type="application/json">{"query":{"postType":"originalPosts","id":"64c9dd9a2edae6abdc610605"},"props":{"pageProps":{"post":{"id":"64c9dd9a2edae6abdc610605","content":"我在即刻写东西的核心原则是,怕什么真理无穷,进一步有一步的欢喜。\n\n当我每次取得一点点微小的进步,我都会快速地将自己的方法、启发和心得分享出来。\n\n这才是即刻涨粉的正道,既有利于你的成长,又有利于平台的发展,互利共赢。\n\n希望能激励到更多人分享自己的所思所想,我整理了一下自己曾写过的所有关于职业规划和个人成长的帖子,给伙计们做个示范😉\n\n探索出了一个超级高效的小红书内容生产方法:https://m.okjike.com/originalPosts/64c91b7dd8f8e55bd9760382?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n热爱的增长飞轮:https://m.okjike.com/originalPosts/6348375b0f59f6888d1aa9ee?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n最简单的找到你的优势的方法:https://m.okjike.com/originalPosts/6518e89f05145f31e5d2e32c?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n寻找自身优势的两条路径:探险家模式和科学家模式:https://m.okjike.com/originalPosts/64b416fc63e42a95c4b2dc78?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n和@凌空小鱼儿 一起录的一期播客--《用少年心气抵御职业迷茫》:https://m.okjike.com/originalPosts/63894f2694ab4dc5baf2df47?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n“所有教你赚钱的人,都想赚你的钱。”我发现大伙儿对这句话有极大的误解 :https://m.okjike.com/originalPosts/64c7c0320b3c21926fddabf6?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n那些学历背景并不是很出色的人,是怎么取得职业成功的?\nhttps://m.okjike.com/originalPosts/64a8d0bee54c189738e96a92?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n我是如何在即刻找了四份工作的?用社交媒体,构建你的职场品牌:https://m.okjike.com/originalPosts/6462fbd9f81d2c81bb734131?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n社交媒体与职业机会蓝海,类比搜索电商和兴趣电商:https://m.okjike.com/originalPosts/6462ffed502f200faee80cd6?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n既然大学与职场脱节严重,那为什么不把大学当成一个为期四年的兴趣班呢:https://m.okjike.com/originalPosts/6491c14460db290560bff338?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n在每份工作开始之前,先想明白自己的核心课题:https://m.okjike.com/originalPosts/6491c14460db290560bff338?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n如何找到「非共识职业机会」:https://m.okjike.com/originalPosts/6491c14460db290560bff338?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n适合于任何聊天的四个要素:人生节点、风口浪尖、江湖故人、心路历程:https://m.okjike.com/originalPosts/650515ae2a0c03ca13cd588f?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n系统的知识管理方法---PARA 体系:https://m.okjike.com/originalPosts/646e23389536223e2810be9c?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n反向构建你的信息茧房:https://m.okjike.com/originalPosts/655b184df9a492630b117163?s=ewoidSI6ICI2MThlOWExODE4MTkwNjAwMTAyNTcyN2UiCn0=\n\n用了多年的极简时间管理方法:https://m.okjike.com/originalPosts/64b69e09b1d391675d40d566?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n在学习新技能时,先想明白你最后想做成什么事情:https://m.okjike.com/originalPosts/63e0780f74aa215f91d5dda9?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n我离毕业还有一年,实习时长已超过了一年:https://m.okjike.com/originalPosts/63d34669b05829a8ee8081ce?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n成功化解了一次职场危机,复盘一下:https://m.okjike.com/originalPosts/6381a4caad185c8e63a427ce?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n对齐目标,与强者互赖:https://m.okjike.com/originalPosts/636884e57dc5011ff1b2286b?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n怎么区分老板是在 PUA 你,还是在严格管理:https://m.okjike.com/originalPosts/6360ff79057dc6dae5ed1b01?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n我目前最高赞的一条即刻动态:《职业生涯冷启动 SOP》:https://m.okjike.com/originalPosts/635a7c218d72f270dbdc14af?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n浅谈产品经理和产品营销的区别:https://m.okjike.com/originalPosts/635a7c218d72f270dbdc14af?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n我在大二那年,删掉了所有的课程,去字节实习:https://m.okjike.com/originalPosts/633cdae7532d83046c2268f0?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n我是团队中学历最低的那个,所以我真的好开心:https://m.okjike.com/originalPosts/633aff8dfd99f5f3bf2af333?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n在大厂是不是会沦为螺丝钉,只能干一些简单且无聊的杂活?\nhttps://m.okjike.com/originalPosts/631d56654a6867af60b055a0?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n分享一个提升工作幸福感的小技巧!建一个自己的夸夸群:https://m.okjike.com/originalPosts/631ac474e565d7e69fb7afb2?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n大学四年,疫情三年,该如何破局?\nhttps://m.okjike.com/originalPosts/62f7b8df231541bb568e20a7?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n打造你的简历中台:通过写简历的方式,来复盘工作。\nhttps://m.okjike.com/originalPosts/62d3bbf6c69bb0d14741ff00?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n适用于各种活动运营的沟通原则:https://m.okjike.com/originalPosts/61fe53055865e700100d9e49?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D\n\n《世界尽头的咖啡馆》和《斯坦福大学人生设计课》:https://m.okjike.com/originalPosts/61ed0f92c7f0e70011d194c0?s=eyJ1IjoiNjE4ZTlhMTgxODE5MDYwMDEwMjU3MjdlIn0%3D","createdAt":"2023-08-02T04:37:46.137Z","pictures":[]}}}}</script></body></html>
diff --git a/apps/extension/fixtures/platforms/jike.html b/apps/extension/fixtures/platforms/jike.html
new file mode 100644
index 00000000..e8040523
--- /dev/null
+++ b/apps/extension/fixtures/platforms/jike.html
@@ -0,0 +1,4 @@
+<!doctype html><html><head><meta><title>AI 分析了我的即刻动态,给出了这个结论。 绝了。 @评论尸 - 即刻App</title><meta property="og:type" content="website" class="jsx-2695884299" hidden="">
+<meta property="og:title" content="AI 分析了我的即刻动态,给出了这个结论。 绝了。 @评论尸 - 即刻App" class="jsx-2695884299" hidden="">
+<meta property="og:description" content="即刻App,享受探索、表达和创造" class="jsx-2695884299" hidden="">
+<meta property="og:image" content="https://cdnv2.ruguoapp.com/FuBGhxoA1116N-djx_Y0qbIpXPGFv3.png?imageMogr2/auto-orient/thumbnail/300x2000%3E" class="jsx-2695884299" hidden=""></head><body><div class="jsx-2063150089 post-page"><div class="jsx-2063150089 post-wrap"><div class="jsx-3802438259 wrap"><a class="jsx-4100394151 avatar " href="https://m.okjike.com/users/bb9f32a4-a2ee-40a7-af01-a9b4949cd365"></a><div class="jsx-3802438259 info"><div class="jsx-3802438259 title">汐笺</div><div class="jsx-3802438259 subtitle">2年前</div></div><div class="jsx-3802438259"></div></div><div class="jsx-1330250023 wrap"><div class="jsx-1330250023 text"><div class="jsx-3930310120 wrap">AI 分析了我的即刻动态,给出了这个结论。<br class="jsx-3930310120">绝了。<br class="jsx-3930310120"><a class="jsx-3930310120" href="https://m.okjike.com/users/6d3698d6-0970-49a6-a19d-f8d3cfa33a6f">@评论尸 </a>提供的 Prompt。</div></div><div class="jsx-1271604522 wrap single "><div class="jsx-1271604522 image-item"><div class="jsx-3757717757 image-wrap fixed-ratio"><img src="https://cdnv2.ruguoapp.com/FuBGhxoA1116N-djx_Y0qbIpXPGFv3.png?imageMogr2/auto-orient/thumbnail/1500x2000%3E" class="jsx-3757717757 image"></div></div></div></div><div class="jsx-2348414216 wrap"><svg><path></path></svg><span class="jsx-2348414216 like-count">34</span><svg><path></path></svg><span class="jsx-2348414216 comment-count"> <!-- -->7</span><svg><path></path><path></path><path></path></svg><span class="jsx-2348414216 repost-count">2</span></div></div><h2 class="jsx-2063150089">来自圈子</h2><a class="jsx-4202418277 wrap" href="https://m.okjike.com/topics/63579abb6724cc583b9bba9a"><img src="https://cdnv2.ruguoapp.com/Ftblo4H7hiyVYfZ4XLd3mP2ktJqyv3.jpg?imageMogr2/auto-orient/heic-exif/1/format/jpeg/thumbnail/120x120%3E" alt="圈子图片" class="jsx-4202418277"><div class="jsx-4202418277 content"><h3 class="jsx-4202418277">AI探索站</h3><p class="jsx-4202418277 subtitle">119766<!-- -->人已经加入</p></div><button class="jsx-4202418277">加入</button></a><div class="jsx-1441003726 wrap"><h2 class="jsx-1441003726">热门评论</h2><ul class="jsx-1441003726"><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/4430f725-b962-4886-b7b4-fd0589b3fa11"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">我叽莫叽莫就好</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">我声称自己是les避免骚扰哈哈</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/9099cf1d-dacd-4d07-b449-8ba7fd7dd4b5"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">AIGC进行时</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">求prompt</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/1e801722-aa61-4992-8858-8997533edf8e"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">苍斯基</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">这个好玩</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/77c8fd3b-7165-40f6-9c93-b29a30073008"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">tool.aren</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">准</div></div><div class="jsx-1271604522 wrap "></div></div></li><li class="jsx-1441003726"><div class="jsx-1441003726 header"><div class="jsx-1441003726 avatar"><a class="jsx-998771207 avatar " href="https://m.okjike.com/users/78c32f45-d550-4f57-a36f-03b825278010"></a></div><div class="jsx-1441003726 info"><span class="jsx-1441003726 username">ChampionCheung</span><span class="jsx-1441003726 time">2年前</span></div><div class="jsx-1441003726 like"><span class="jsx-1441003726">0</span><svg><path></path></svg></div></div><div class="jsx-1441003726 body"><div class="jsx-1441003726 text"><div class="jsx-3930310120 wrap">带反贼倾向的粉红?胡总?</div></div><div class="jsx-1271604522 wrap "></div></div></li></ul></div><div class="jsx-1441003726 more-comments-wrap">查看更多<span class="jsx-1441003726"> 7 条</span>评论</div></div><script id="__NEXT_DATA__" type="application/json">{"page":"/[postType]/[id]","query":{"postType":"originalPosts","id":"66ac89b0314f5cced41012d3"},"props":{"pageProps":{"post":{"id":"66ac89b0314f5cced41012d3","createdAt":"2024-08-02T07:24:32.341Z","pictures":[{"picUrl":"https://cdnv2.ruguoapp.com/FuBGhxoA1116N-djx_Y0qbIpXPGFv3.png?imageMogr2/meta-keep-list/ZXhpZixVc2VyQ29tbWVudA==/auto-orient","thumbnailUrl":"https://cdnv2.ruguoapp.com/FuBGhxoA1116N-djx_Y0qbIpXPGFv3.png?imageMogr2/auto-orient/thumbnail/300x2000%3E","middlePicUrl":"https://cdnv2.ruguoapp.com/FuBGhxoA1116N-djx_Y0qbIpXPGFv3.png?imageMogr2/auto-orient/thumbnail/1500x2000%3E"}],"content":"AI 分析了我的即刻动态,给出了这个结论。\n绝了。\n@评论尸 提供的 Prompt。","user":{"screenName":"汐笺"}}}}}</script></body></html>
diff --git a/apps/extension/fixtures/platforms/juejin.html b/apps/extension/fixtures/platforms/juejin.html
new file mode 100644
index 00000000..fb785bed
--- /dev/null
+++ b/apps/extension/fixtures/platforms/juejin.html
@@ -0,0 +1,257 @@
+<!doctype html><html><head><meta><title>JavaScript异步发展历史作者将以实际样例阐述异步发展历史,介绍每种实现方式的优势与不足,以期帮助读者熟悉历史进程 - 掘金</title><link rel="canonical" href="https://juejin.cn/post/6972051526416072717" hidden=""></head><body><article itemscope="itemscope" itemtype="http://schema.org/Article" class="article"><!----> <meta itemprop="headline" content="JavaScript异步发展历史" hidden=""> <meta itemprop="keywords" content="JavaScript" hidden=""> <meta itemprop="datePublished" content="2021-06-10T06:41:24.000Z" hidden=""> <meta itemprop="image" content="https://p1-jj.byteimg.com/tos-cn-i-t2oaga2asx/gold-assets/icon/icon-128.png~tplv-t2oaga2asx-image.image" hidden=""> <div itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person"><meta itemprop="name" content="小和山的菜鸟们" hidden=""> <meta itemprop="url" content="https://juejin.cn/user/2991114829434237" hidden=""></div> <div itemprop="publisher" itemscope="itemscope" itemtype="http://schema.org/Organization"><meta itemprop="name" content="掘金" hidden=""> <div itemprop="logo" itemscope="itemscope" itemtype="https://schema.org/ImageObject"><meta itemprop="url" content="https://p1-jj.byteimg.com/tos-cn-i-t2oaga2asx/gold-assets/icon/icon-white-180.png~tplv-t2oaga2asx-image.image" hidden=""> <meta itemprop="width" content="180" hidden=""> <meta itemprop="height" content="180" hidden=""></div></div> <h1 class="article-title">
+ JavaScript异步发展历史
+ <!----> <!----></h1> <div class="author-info-block"><div class="author-info-box"><div class="author-name"><a href="/user/2991114829434237/posts" rel="" class="jj-link username username ellipsis"><span class="name">
+ 小和山的菜鸟们
+ </span> <!----> <!----> <!----> </a></div> <div class="meta-box"><time datetime="2021-06-10T06:41:24.000Z" title="Thu Jun 10 2021 14:41:24 GMT+0800 (中国标准时间)" class="time">
+ 2021-06-10
+ </time> <svg class="read-icon"><path></path><circle></circle></svg> <span class="views-count">
+ 1,054
+ </span> <span class="read-time"><svg class=""><rect></rect><circle></circle><path></path></svg>
+ 阅读6分钟
+ </span> <div class="first-column"><div class="gap"></div> <div class="word"><svg class=""><path></path><path></path><path></path></svg>
+ 专栏:&nbsp;
+ </div> <div class="title">
+ 前端博客
+ </div></div></div></div> <div></div> <!----> <button class="jj-follow-button follow" hidden=""><span class="text">关注</span></button></div> <!----> <!----> <!----> <!----> <div id="article-root" itemprop="articleBody" class="main"><div class="article-viewer markdown-body cache result"><blockquote>
+<p>"小和山的菜鸟们",为前端开发者提供技术相关资讯以及系列基础文章。为更好的用户体验,请您移至我们官网小和山的菜鸟们 (<a href="https://link.juejin.cn?target=https%3A%2F%2Fxhs-rookies.com%2F" title="https://xhs-rookies.com/">xhs-rookies.com/</a>) 进行学习,及时获取最新文章。</p>
+</blockquote>
+<h2>前言</h2>
+<p>在 MDN 的 JavaScript 系列中我们已经学习了 callback、promise、generator、async/await。而在这一篇文章中,作者将以实际样例阐述异步发展历史,介绍每种实现方式的优势与不足,以期帮助读者熟悉历史进程并把握异步发展的脉络。 <img alt="异步发展历史" src="" class="medium-zoom-image"></p>
+<h2>异步</h2>
+<p>几十年前的导航网站,清爽又简单,没有什么特别的功能,只是单纯的展示,现成的网页在服务器上静静躺着,高效毫无压力,让人很喜欢。</p>
+<p>几十年后的今天,静态页面远不能满足用户的需求,网站变得复杂起来,用户交互越来越频繁,从而产生大量复杂的内部交互,为了解决这种复杂,出现了各种系统“模式”,从而很容易的在外部获取数据,并实时展示给用户。</p>
+<p>获取外部数据实际上就是“网络调用”,这个时候“<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FGlossary%2FAsynchronous" title="https://developer.mozilla.org/en-US/docs/Glossary/Asynchronous">异步</a>”这个词汇出现了。</p>
+<blockquote>
+<p><a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FGlossary%2FAsynchronous" title="https://developer.mozilla.org/en-US/docs/Glossary/Asynchronous">异步</a>指两个或两个以上的对象或事件不同时存在或发生(或多个相关事物的发生无需等待其前一事物的完成)</p>
+</blockquote>
+<p><img src="https://img-blog.csdnimg.cn/2021011621291494.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzMzY0ODA2,size_16,color_FFFFFF,t_70" alt="image-20210116210456133" class="medium-zoom-image"></p>
+<h2>异步 callbacks</h2>
+<blockquote>
+<p><a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2Flearn%2FJavaScript%2F%25E5%25BC%2582%25E6%25AD%25A5%2F%25E7%25AE%2580%25E4%25BB%258B" title="https://developer.mozilla.org/zh-CN/docs/learn/JavaScript/%E5%BC%82%E6%AD%A5/%E7%AE%80%E4%BB%8B">异步 callbacks</a>其实就是函数,只不过是作为参数传递给那些在后台执行的其他函数。当那些后台运行的代码结束,就调用 callbacks 函数,通知你工作已经完成,或者其他有趣的事情发生了。</p>
+</blockquote>
+<p><strong>场景</strong></p>
+<pre><div class="code-block-extension-header"><div class="code-block-extension-headerLeft"><div class="code-block-extension-foldBtn"><svg><path></path></svg></div><span class="code-block-extension-lang">javascript</span></div><div class="code-block-extension-headerRight"><div class="render"><svg class="icon"><path></path><defs><radialGradient id="paint0_radial_370_13481"><stop></stop><stop></stop><stop></stop><stop></stop></radialGradient></defs></svg> <span class="txt">代码解读</span></div><div class="code-block-extension-copyCodeBtn">复制代码</div></div></div><code class="hljs language-javascript code-block-extension-codeShowNum" lang="javascript"><span class="code-block-extension-codeLine"><span class="hljs-keyword">let</span> <span class="hljs-title function_">readFile</span> = (<span class="hljs-params">path, callBack</span>) =&gt; {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-built_in">setTimeout</span>(<span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">callBack</span>(path)</span>
+<span class="code-block-extension-codeLine"> }, <span class="hljs-number">1000</span>)</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"></span>
+<span class="code-block-extension-codeLine"><span class="hljs-title function_">readFile</span>(<span class="hljs-string">'first'</span>, <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'first readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'second'</span>, <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'second readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'third'</span>, <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'third readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fourth'</span>, <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'fourth readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fifth'</span>, <span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'fifth readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine">})</span>
+</code></pre>
+<p><strong>优点:</strong></p>
+<ul>
+<li>解决了同步问题(即解决了一个任务时间长时,后面的任务排队,耗时太久,使程序的执行变慢问题)</li>
+</ul>
+<p><strong>缺点:</strong></p>
+<ul>
+<li>回调地狱(多层级嵌套),会导致逻辑混乱,耦合性高,改动一处就会导致全部变动,嵌套多时,错误处理复杂</li>
+<li>不能使用 try...catch 来抓取错误</li>
+<li>不能 return</li>
+<li>可读性差</li>
+</ul>
+<hr>
+<h2>Promise</h2>
+<blockquote>
+<p>一个<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FReference%2FGlobal_Objects%2FPromise" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>对象代表一个在这个 promise 被创建出来时不一定已知的值。它让您能够把异步操作最终的成功返回值或者失败原因和相应的处理程序关联起来。 这样使得异步方法可以像同步方法那样返回值:异步方法并不会立即返回最终的值,而是会返回一个 promise,以便在未来某个时候把值交给使用者。</p>
+</blockquote>
+<p><strong>场景</strong></p>
+<pre><div class="code-block-extension-header"><div class="code-block-extension-headerLeft"><div class="code-block-extension-foldBtn"><svg><path></path></svg></div><span class="code-block-extension-lang">javascript</span></div><div class="code-block-extension-headerRight"><div class="render"><svg class="icon"><path></path><defs><radialGradient id="paint0_radial_370_13481"><stop></stop><stop></stop><stop></stop><stop></stop></radialGradient></defs></svg> <span class="txt">代码解读</span></div><div class="code-block-extension-copyCodeBtn">复制代码</div></div></div><code class="hljs language-javascript code-block-extension-codeShowNum" lang="javascript"><span class="code-block-extension-codeLine"><span class="hljs-keyword">let</span> <span class="hljs-title function_">readFile</span> = (<span class="hljs-params">path</span>) =&gt; {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Promise</span>(<span class="hljs-function">(<span class="hljs-params">resolve, reject</span>) =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">if</span> (!path) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">reject</span>(<span class="hljs-string">'error!!!'</span>)</span>
+<span class="code-block-extension-codeLine"> } <span class="hljs-keyword">else</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(path + <span class="hljs-string">' readFile success'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">resolve</span>()</span>
+<span class="code-block-extension-codeLine"> }</span>
+<span class="code-block-extension-codeLine"> }, <span class="hljs-number">1000</span>)</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"></span>
+<span class="code-block-extension-codeLine"><span class="hljs-title function_">readFile</span>(<span class="hljs-string">'first'</span>)</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'second'</span>))</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'third'</span>))</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fourth'</span>))</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fifth'</span>))</span>
+</code></pre>
+<p><strong>优点:</strong></p>
+<ul>
+<li>状态改变后,就不会再变,任何时候都可以得到这个结果</li>
+<li>可以将异步操作以同步操作的流程表达出来,避免了层层嵌套的回调函数</li>
+<li>一定程度上解决了回调地狱的可读性问题</li>
+</ul>
+<p><strong>缺点:</strong></p>
+<ul>
+<li>无法取消 promise</li>
+<li>当处于 pending 状态时,无法得知目前进展到哪一个阶段</li>
+<li>代码冗余,有一堆任务时也会使语义不清晰</li>
+</ul>
+<hr>
+<h2>Generator</h2>
+<blockquote>
+<p><a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FReference%2FGlobal_Objects%2FGenerator" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Generator">Generator</a>函数是 ES6 中提供的一种<strong>异步编程解决方案</strong>。语法上,首先可以把它理解成,<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FReference%2FGlobal_Objects%2FGenerator" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Generator">Generator</a>函数是一个<strong>状态机</strong>,封装了多个内部状态,需要使用<strong>next()函数</strong>来继续执行下面的代码。</p>
+</blockquote>
+<p><strong>特征</strong></p>
+<ul>
+<li>function 与函数名之间带有(*)</li>
+<li>函数体内部使用 yield 表达式,函数执行遇到 yield 就返回</li>
+</ul>
+<p><strong>场景</strong></p>
+<pre><div class="code-block-extension-header"><div class="code-block-extension-headerLeft"><div class="code-block-extension-foldBtn"><svg><path></path></svg></div><span class="code-block-extension-lang">javascript</span></div><div class="code-block-extension-headerRight"><div class="render"><svg class="icon"><path></path><defs><radialGradient id="paint0_radial_370_13481"><stop></stop><stop></stop><stop></stop><stop></stop></radialGradient></defs></svg> <span class="txt">代码解读</span></div><div class="code-block-extension-copyCodeBtn">复制代码</div></div></div><code class="hljs language-javascript code-block-extension-codeShowNum" lang="javascript"><span class="code-block-extension-codeLine"><span class="hljs-keyword">var</span> readFile = <span class="hljs-keyword">function</span> (<span class="hljs-params">name, ms</span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Promise</span>(<span class="hljs-function">(<span class="hljs-params">resolve, reject</span>) =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(name + <span class="hljs-string">'读完了'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">resolve</span>()</span>
+<span class="code-block-extension-codeLine"> }, ms)</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"></span>
+<span class="code-block-extension-codeLine"><span class="hljs-keyword">var</span> gen = <span class="hljs-keyword">function</span>* () {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'指定generator'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">yield</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'first'</span>, <span class="hljs-number">1000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">yield</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'second'</span>, <span class="hljs-number">2000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">yield</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'third'</span>, <span class="hljs-number">3000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">yield</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'forth'</span>, <span class="hljs-number">4000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">yield</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fifth'</span>, <span class="hljs-number">5000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">return</span> <span class="hljs-string">'完成了'</span></span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"><span class="hljs-keyword">var</span> g = <span class="hljs-title function_">gen</span>()</span>
+<span class="code-block-extension-codeLine"><span class="hljs-keyword">var</span> result = g.<span class="hljs-title function_">next</span>()</span>
+<span class="code-block-extension-codeLine">result.<span class="hljs-property">value</span></span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> g.<span class="hljs-title function_">next</span>()</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> g.<span class="hljs-title function_">next</span>()</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> g.<span class="hljs-title function_">next</span>()</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine"> .<span class="hljs-title function_">then</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> g.<span class="hljs-title function_">next</span>()</span>
+<span class="code-block-extension-codeLine"> })</span>
+</code></pre>
+<p><strong>优点:</strong></p>
+<ul>
+<li>可以控制函数的执行,可以配合 co 函数库使用</li>
+</ul>
+<p><strong>缺点:</strong></p>
+<ul>
+<li>流程管理却不方便(即何时执行第一阶段、何时执行第二阶段)</li>
+</ul>
+<hr>
+<h2>async 和 await</h2>
+<blockquote>
+<p><a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FReference%2FStatements%2Fasync_function" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/async_function">async functions</a> 和 <a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FReference%2FOperators%2Fawait" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/await">await</a> 关键字是最近添加到 JavaScript 语言里面的。它们是 ECMAScript 2017 JavaScript 版的一部分(参见<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FECMAScript_7_support_in_Mozilla" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/ECMAScript_7_support_in_Mozilla">ECMAScript Next support in Mozilla</a>)。简单来说,它们是基于 promises 的语法糖,使异步代码更易于编写和阅读。通过使用它们,异步代码看起来更像是老式同步代码,因此它们非常值得学习。</p>
+</blockquote>
+<p><img src="https://img-blog.csdnimg.cn/20210116212853823.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzMzY0ODA2,size_16,color_FFFFFF,t_70" alt="image-20210116211018846" class="medium-zoom-image"></p>
+<p><strong>场景 1</strong></p>
+<pre><div class="code-block-extension-header"><div class="code-block-extension-headerLeft"><div class="code-block-extension-foldBtn"><svg><path></path></svg></div><span class="code-block-extension-lang">javascript</span></div><div class="code-block-extension-headerRight"><div class="render"><svg class="icon"><path></path><defs><radialGradient id="paint0_radial_370_13481"><stop></stop><stop></stop><stop></stop><stop></stop></radialGradient></defs></svg> <span class="txt">代码解读</span></div><div class="code-block-extension-copyCodeBtn">复制代码</div></div></div><code class="hljs language-javascript code-block-extension-codeShowNum" lang="javascript"><span class="code-block-extension-codeLine"><span class="hljs-keyword">var</span> readFile = <span class="hljs-keyword">function</span> (<span class="hljs-params">name, ms</span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Promise</span>(<span class="hljs-function">(<span class="hljs-params">resolve, reject</span>) =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(name + <span class="hljs-string">'读完了'</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-title function_">resolve</span>()</span>
+<span class="code-block-extension-codeLine"> }, ms)</span>
+<span class="code-block-extension-codeLine"> })</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"></span>
+<span class="code-block-extension-codeLine"><span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">useAsyncAwait</span>(<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'first'</span>, <span class="hljs-number">1000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'second'</span>, <span class="hljs-number">2000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'third'</span>, <span class="hljs-number">3000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'forth'</span>, <span class="hljs-number">4000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fifth'</span>, <span class="hljs-number">5000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'async文件阅读完毕'</span>)</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"><span class="hljs-title function_">useAsyncAwait</span>()</span>
+</code></pre>
+<p><strong>优点</strong></p>
+<ul>
+<li>
+<p>内置执行器。意味着不需要像 generator 一样调用 next 函数或 co 模块</p>
+</li>
+<li>
+<p>更广的适用性。async 和 await 后面跟的都是 promise 函数,原始数据类型会被转为 promise</p>
+</li>
+<li>
+<p>语义更清晰、简洁</p>
+<p><strong>缺点</strong></p>
+</li>
+<li>
+<p>大量的 await 代码会阻塞(程序并不会等在原地,而是继续<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FEventLoop" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/EventLoop">事件循环</a>,等到响应后继续往下走)程序运行,每个 await 都会等待前一个完成</p>
+</li>
+</ul>
+<p><strong>场景 2</strong> 场景 1 中的代码,其实 second,third 的伪请求其实并不依赖于 first,second 的结果,但它们必须等待前一个的完成才能继续,而我们想要的是它们同时进行,所以正确的操作应该是这样的。</p>
+<pre><div class="code-block-extension-header"><div class="code-block-extension-headerLeft"><div class="code-block-extension-foldBtn"><svg><path></path></svg></div><span class="code-block-extension-lang">javascript</span></div><div class="code-block-extension-headerRight"><div class="render"><svg class="icon"><path></path><defs><radialGradient id="paint0_radial_370_13481"><stop></stop><stop></stop><stop></stop><stop></stop></radialGradient></defs></svg> <span class="txt">代码解读</span></div><div class="code-block-extension-copyCodeBtn">复制代码</div></div></div><code class="hljs language-javascript code-block-extension-codeShowNum" lang="javascript"><span class="code-block-extension-codeLine"><span class="hljs-keyword">async</span> <span class="hljs-keyword">function</span> <span class="hljs-title function_">useAsyncAwait</span>(<span class="hljs-params"></span>) {</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">const</span> first = <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'first'</span>, <span class="hljs-number">1000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">const</span> second = <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'second'</span>, <span class="hljs-number">2000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">const</span> third = <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'third'</span>, <span class="hljs-number">3000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">const</span> forth = <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'forth'</span>, <span class="hljs-number">4000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">const</span> fifth = <span class="hljs-title function_">readFile</span>(<span class="hljs-string">'fifth'</span>, <span class="hljs-number">5000</span>)</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">'async文件阅读完毕'</span>)</span>
+<span class="code-block-extension-codeLine"></span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> first</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> second</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> third</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> forth</span>
+<span class="code-block-extension-codeLine"> <span class="hljs-keyword">await</span> fifth</span>
+<span class="code-block-extension-codeLine">}</span>
+<span class="code-block-extension-codeLine"><span class="hljs-title function_">useAsyncAwait</span>()</span>
+</code></pre>
+<p>在这里,我们将三个 promise 对象存储在变量中,这样可以同时启动它们关联的进程。</p>
+<h2>总结</h2>
+<p>在这篇文章中,我们已经介绍了 JavaScript 异步发展史中 --- callback、promise、generator、async/await 的使用方式、优点与缺点。</p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<table><thead><tr><th>发展史</th><th>优点</th><th>缺点</th></tr></thead><tbody><tr><td>callback</td><td>解决了同步问题</td><td>回调地狱、可读性差、无法 try / catch 、无法 return</td></tr><tr><td>promise</td><td>一定程度上解决了回调地狱的可读性</td><td>无法取消、任务多时,同样存在语义不清晰</td></tr><tr><td>generator</td><td>可以控制函数的执行,可以配合 co 函数库使用</td><td>流程管理却不方便(即何时执行第一阶段、何时执行第二阶段</td></tr><tr><td>async/await</td><td>语义更清晰、简洁,内置执行器</td><td>认知不清晰可能会造成大量 await 阻塞(程序并不会等在原地,而是继续<a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2FWeb%2FJavaScript%2FEventLoop" title="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/EventLoop">事件循环</a>,等到响应后继续往下走)情况</td></tr></tbody></table>
+<p>而在现有的异步解决方案中,async/await 是使用人数最多的,它带给我们最大的好处即同步代码的风格,语义简洁、清晰。</p>
+<h2>相关文章</h2>
+<ul>
+<li><a href="https://link.juejin.cn?target=https%3A%2F%2Fdeveloper.mozilla.org%2Fzh-CN%2Fdocs%2Flearn%2FJavaScript%2F%25E5%25BC%2582%25E6%25AD%25A5" title="https://developer.mozilla.org/zh-CN/docs/learn/JavaScript/%E5%BC%82%E6%AD%A5">MDN-异步 JavaScript</a></li>
+<li><a href="https://link.juejin.cn?target=https%3A%2F%2Fwww.ruanyifeng.com%2Fblog%2F2012%2F12%2Fasynchronous%25EF%25BC%25BFjavascript.html" title="https://www.ruanyifeng.com/blog/2012/12/asynchronous%EF%BC%BFjavascript.html">阮一峰-JavaScript 异步编程的 4 种方法</a></li>
+<li><a href="https://link.juejin.cn?target=https%3A%2F%2Fsegmentfault.com%2Fa%2F1190000019254694" title="https://segmentfault.com/a/1190000019254694">掘金-细说 JavaScript 异步的发展历程</a></li>
+<li><a href="https://juejin.cn/post/6844903620043866126" title="https://juejin.cn/post/6844903620043866126">掘金-async/await 的优点、陷阱以及如何使用</a></li>
+<li><a href="https://link.juejin.cn?target=https%3A%2F%2Fwww.williamife.com%2F2018%2F12%2F05%2FJS%25E5%25BC%2582%25E6%25AD%25A5%25E5%258F%2591%25E5%25B1%2595%25E6%25B5%2581%25E7%25A8%258B%2F" title="https://www.williamife.com/2018/12/05/JS%E5%BC%82%E6%AD%A5%E5%8F%91%E5%B1%95%E6%B5%81%E7%A8%8B/">JS 异步发展流程</a></li>
+</ul></div></div></article></body></html>
diff --git a/apps/extension/fixtures/platforms/linkedin-person.html b/apps/extension/fixtures/platforms/linkedin-person.html
new file mode 100644
index 00000000..95ba6dea
--- /dev/null
+++ b/apps/extension/fixtures/platforms/linkedin-person.html
@@ -0,0 +1 @@
+<html><head></head><body><div role="listitem" componentkey="update-card-focusZXPgZn9LBikl-VbTPItNS3n7dAHA20fc_dVSScNyjWsFeedType_FEED_DETAIL"><div class="hv4krs hv4anj hv4g8y hv4h9m hv4gx2 hv4hbu hv4hca hv4lg2"><a tabindex="0" class="hv4jrs hv4jx8 hv4f8v hv4gk1 hv4hbm hv4lsh hv4lsg hv4jqg hv4jxk hv4j4o hv4kbs hv4su hv4f6r hv4k0p hv4anj" href="https://www.linkedin.com/in/maddyahmad/" componentkey="73f254ce-ec57-449f-90ce-08dde50f02db"><figure class="hv4lj4 hv4lj7 hv4lj5 hv48k hv4g9m hv4arr hv4gm4 hv4gay hv4lg2" componentkey="73f254ce-ec57-449f-90ce-08dde50f02db"></figure></a><div class="hv4g9m hv4jrs hv4jx8 hv4j5s hv4kcg hv4ijm hv4aqv hv4ga7 hv4gnd hv4lg2"><div class="hv4lh2 hv4anj hv4g8i hv4h9m hv4gyi hv4hbu hv4hca hv4jnu hv4iiq hv4lg2"><div class="hv4ijm hv4aqv hv4ga7 hv4gm1 hv4lg2"><div class="hv4aqv hv4ga7 hv4gnd hv4jkq hv4jnu hv4iiq hv4lg2"><a tabindex="0" class="hv4ga7 hv4gnd hv4jnu hv4iiq hv4lsh hv4lsg hv4jqg hv4jxk hv4j4o hv4kbs hv4su hv4f6r hv4k0p hv4anj" href="https://www.linkedin.com/in/maddyahmad/" componentkey="8d64b066-31d9-4244-b614-e8ca37c96901"><div class="hv4g9m hv4aqv hv4lg2" componentkey="8d64b066-31d9-4244-b614-e8ca37c96901"><div class="hv4anj hv4g8y hv4h9m hv4gxe hv4hbu hv4hca hv4gnd hv4jnu hv4iiq hv4lg2" aria-label="Mohammad Ahmed,在找工作 Premium职业档案3 度+"><div class="hv4g9m hv4aqv hv4ga7 hv4gnd hv4lg2"><div class="hv4kx0 hv4kzc hv4kzi hv4kzl hv4kz3 hv4jnu hv4iiq hv4fc9 hv4k0k"><p class="hv4k0m hv4kyf hv4k8g hv4k8f hv4k8e hv4arr hv4k0l hv4ga7 hv4k79 hv4k8d" style="--hv4k8a: var(--hv4ew); --hv4k8b: var(--hv4ep); --hv4k8c: var(--hv4ep);"><span>Mohammad Ahmed</span></p></div></div><div class="hv4kx0 hv4kzc hv4kzf hv4kzl hv4kz3 hv4fd9 hv4k0k"><p class="hv4k0m hv4kx9 hv4k8g hv4k8f hv4k8e hv4arr hv4k0l hv4ga7 hv4k78"><span><span class="hv4k0j hv4lg2"> </span><span class="hv4iju hv4an7 hv4lg2" aria-hidden="true"></span><span class="hv4k0j hv4lg2"> </span>• 3 度+</span></p></div></div></div></a></div></div><div class="hv4kx0 hv4kzc hv4kzf hv4kzl hv4kz3 hv4fd9 hv4k0k"><p class="hv4k0m hv4kx9 hv4k8g hv4k8f hv4k8e hv4arr hv4k0l hv4ga7 hv4k78"><span>Technical Lead - Backend at Dizzaract</span></p></div><div class="hv4ijm hv4aqv hv4ga7 hv4gnd hv4gze hv4lg2"><div class="hv4aqv hv4ga7 hv4gnd hv4jkq hv4jnu hv4iiq hv4lg2"></div></div><div class="hv4kx0 hv4kzc hv4kzf hv4kzl hv4kz3 hv4fd9 hv4k0k"><p class="hv4k0m hv4kx9 hv4k8h hv4k8f hv4k8e hv4arr hv4k0l hv4ga7 hv4k78" componentkey="7c54abcb-ed04-47e6-9932-efdca9524a84"><span>5 个月前</span></p></div><a tabindex="0" class="hv4ga7 hv4gm1 hv4lsh hv4lsg hv4jqg hv4jxk hv4j4o hv4kbs hv4su hv4f6r hv4k0p hv4anj" href="https://www.linkedin.com/in/maddyahmad/" componentkey="deecb440-f6cf-4fc6-adc7-5a848239c30c"><div class="hv4g9m hv4aqv hv4jnm hv4lg2" componentkey="deecb440-f6cf-4fc6-adc7-5a848239c30c" aria-label="Mohammad Ahmed,在找工作 Premium职业档案3 度+"></div></a></div></div><div class="hv4anb hv4lg2" data-display-contents="true"><div class="hv4aqv hv4ga7 hv4gnd hv4lg2" componentkey="081fdce9-f94f-4be4-9f71-b264c70a872b"><div class="hv4anb hv4lg2" data-display-contents="true"></div></div></div></div><div><div class="hv4k01 hv4aq3 hv4lg2" id="translatable-commentary-FeTranslationUrn(contentUrnCommentUrn=null, contentUrnGroupPostUrn=null, contentUrnShareUrn=ContentUrnShareUrn(shareUrn=ShareUrn(shareId=7456582751698190336)), contentUrnUgcPostUrn=null, detectedLocale=, targetLocale=zh_CN)" componentkey="translatable-commentary-FeTranslationUrn(contentUrnCommentUrn=null, contentUrnGroupPostUrn=null, contentUrnShareUrn=ContentUrnShareUrn(shareUrn=ShareUrn(shareId=7456582751698190336)), contentUrnUgcPostUrn=null, detectedLocale=, targetLocale=zh_CN)"><p class="hv4k0m hv4kyc hv4kx0 hv4kzc hv4kzf hv4kzu hv4kz3 hv4fc9 hv4k0k hv4k79" componentkey="e971dbf0-809e-44c2-8ee2-b582e2ffce32" style="--hv4jt: 1.4285999536514282;"><span class="hv4le8 hv4am3 hv4ijm hv4lg2" tabindex="-1" data-testid="expandable-text-box">AI isn't coming for software engineers, but it is definitely reshaping what great engineers look like.<br><br>The next few years will reward developers who can combine strong fundamentals with AI fluency. Writing code will still matter, but designing systems, asking the right questions, and solving real business problems will matter even more.<br><br>As someone working across React, Next.js, Node.js, Spring Boot, cloud platforms, and modern frontend ecosystems, I've been thinking a lot about the skills that will define the next generation of developers.<br><br>Here are the areas I believe every modern engineer should focus on:<br><br>🚀 Core Skills That Will Never Go Out of Style<br>• Data Structures &amp; Algorithms<br>• System Design<br>• Clean Architecture<br>• Performance Optimization<br>• Security Best Practices<br><br>These remain the foundation. AI can generate code, but it cannot replace engineering judgment.<br><br>🤖 AI Skills That Are Becoming Essential<br>• Prompt Engineering<br>• Building with LLM APIs (OpenAI, Claude, Gemini)<br>• RAG (Retrieval-Augmented Generation)<br>• AI Agents &amp; Workflow Automation<br>• Vector Databases<br>• AI Observability and Evaluation<br><br>The future belongs to developers who can integrate intelligence into products.<br><br>☁️ Cloud &amp; Infrastructure<br>• AWS and Azure<br>• Docker &amp; Kubernetes<br>• CI/CD Pipelines<br>• Infrastructure as Code<br>• Monitoring with Grafana, Prometheus, and OpenTelemetry<br><br>Applications are no longer just built—they are operated continuously.<br><br>🌐 Frontend Evolution<br>• Server Components<br>• Edge Computing<br>• Web Performance<br>• Accessibility<br>• Micro Frontends<br>• AI-Powered User Experiences<br><br>Frontend is moving far beyond UI rendering.<br><br>📊 Data Skills Matter More Than Ever<br>• SQL Mastery<br>• Analytics Engineering<br>• Real-Time Data Processing<br>• Event-Driven Architectures<br><br>Every application is becoming data-intensive.<br><br>🔐 Security Is Non-Negotiable<br>• Secure Coding<br>• API Security<br>• Identity &amp; Access Management<br>• OWASP Best Practices<br><br>Security can no longer be treated as an afterthought.<br><br>The engineers who thrive won't be the ones who resist AI.<br><br>They'll be the ones who learn how to collaborate with it.<br><br>What technology are you focusing on in 2026 to stay ahead?<br><br><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #softwareengineering" href="https://www.linkedin.com/search/results/all/?keywords=%23softwareengineering&amp;origin=HASH_TAG_FROM_FEED"><strong>#SoftwareEngineering</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #artificialintelligence" href="https://www.linkedin.com/search/results/all/?keywords=%23artificialintelligence&amp;origin=HASH_TAG_FROM_FEED"><strong>#ArtificialIntelligence</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #reactjs" href="https://www.linkedin.com/search/results/all/?keywords=%23reactjs&amp;origin=HASH_TAG_FROM_FEED"><strong>#ReactJS</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #nextjs" href="https://www.linkedin.com/search/results/all/?keywords=%23nextjs&amp;origin=HASH_TAG_FROM_FEED"><strong>#NextJS</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #nodejs" href="https://www.linkedin.com/search/results/all/?keywords=%23nodejs&amp;origin=HASH_TAG_FROM_FEED"><strong>#NodeJS</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #springboot" href="https://www.linkedin.com/search/results/all/?keywords=%23springboot&amp;origin=HASH_TAG_FROM_FEED"><strong>#SpringBoot</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #typescript" href="https://www.linkedin.com/search/results/all/?keywords=%23typescript&amp;origin=HASH_TAG_FROM_FEED"><strong>#TypeScript</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #webdevelopment" href="https://www.linkedin.com/search/results/all/?keywords=%23webdevelopment&amp;origin=HASH_TAG_FROM_FEED"><strong>#WebDevelopment</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #cloudcomputing" href="https://www.linkedin.com/search/results/all/?keywords=%23cloudcomputing&amp;origin=HASH_TAG_FROM_FEED"><strong>#CloudComputing</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #devops" href="https://www.linkedin.com/search/results/all/?keywords=%23devops&amp;origin=HASH_TAG_FROM_FEED"><strong>#DevOps</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #machinelearning" href="https://www.linkedin.com/search/results/all/?keywords=%23machinelearning&amp;origin=HASH_TAG_FROM_FEED"><strong>#MachineLearning</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #generativeai" href="https://www.linkedin.com/search/results/all/?keywords=%23generativeai&amp;origin=HASH_TAG_FROM_FEED"><strong>#GenerativeAI</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #llm" href="https://www.linkedin.com/search/results/all/?keywords=%23llm&amp;origin=HASH_TAG_FROM_FEED"><strong>#LLM</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #openai" href="https://www.linkedin.com/search/results/all/?keywords=%23openai&amp;origin=HASH_TAG_FROM_FEED"><strong>#OpenAI</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #careergrowth" href="https://www.linkedin.com/search/results/all/?keywords=%23careergrowth&amp;origin=HASH_TAG_FROM_FEED"><strong>#CareerGrowth</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #techleadership" href="https://www.linkedin.com/search/results/all/?keywords=%23techleadership&amp;origin=HASH_TAG_FROM_FEED"><strong>#TechLeadership</strong></a></span><span class="hv4k0j hv4lg2"> </span><span class="hv4fb3 hv4lg2"><a class="hv4f6r hv4ljx" aria-label="查看话题标签: #programming" href="https://www.linkedin.com/search/results/all/?keywords=%23programming&amp;origin=HASH_TAG_FROM_FEED"><strong>#Programming</strong></a></span></span></p></div></div></div></body></html>
diff --git a/apps/extension/fixtures/platforms/medium-article.html b/apps/extension/fixtures/platforms/medium-article.html
index 04004cd5..8dbb28c5 100644
--- a/apps/extension/fixtures/platforms/medium-article.html
+++ b/apps/extension/fixtures/platforms/medium-article.html
@@ -1 +1 @@
-<html><head><meta property="og:site_name" content="Medium"><title>What Should Programmers Do While the AI Writes Code?</title></head><body><article class=""><div class=""><div class=""><span class=""></span><section><div><div class=""></div><div class="speechify-ignore"><aside class=""><div class=""><button class=""><p class="">1</p></button><span class="" aria-hidden="true"><span class="">·</span></span><p class=""><span>Top highlight</span></p></div><div class=""><button class=""><p class="">2</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">2</p></button></div><div class=""><button class=""><p class="">1</p></button></div></aside></div><div><div class="speechify-ignore"><div class=""></div><div class=""><div class=""><div class=""><div class=""><div><a class="" href="https://medium.com/plans?source=upgrade_membership---post_counter--a2ce2e6de88e-----------------------------------------"><div class=""><p class="">This member-only story is on us.</p></div><div class=""><div class=""></div></div></a></div></div></div></div></div><div class=""><div class=""><div class=""><div class=""><div><div class=""><div><div class=""><p class="">Member-only story</p></div></div></div></div></div></div></div></div></div></div><div><div class=""><div class=""><div class="speechify-ignore"><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/ai?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">AI</span></a></div></div></div><button aria-label="Unfollow AI" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/programming?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Programming</span></a></div></div></div><button aria-label="Unfollow Programming" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/ai-agent?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">AI Agent</span></a></div></div></div><button aria-label="Unfollow AI Agent" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/productivity?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Productivity</span></a></div></div></div><button aria-label="Follow Productivity" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/software-development?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Software Development</span></a></div></div></div><button aria-label="Unfollow Software Development" class=""></button></div></div></div></div></div><div class=""><div class=""><div class=""><div><h1 id="15d0" class="pw-post-title" data-testid="storyTitle" data-selectable-paragraph="">What Should Programmers Do While the AI Writes Code?</h1></div><div><h2 id="14b2" class="pw-subtitle-paragraph" data-selectable-paragraph="">Hint: not start another AI coding loop</h2><div><div class="speechify-ignore"><div class="speechify-ignore"><div class=""><div class=""><div class=""><div><div class=""><a href="/?source=post_page---byline--a2ce2e6de88e-----------------------------------------"><div class=""><div class=""><div class=""></div></div></div></a></div></div></div><span class=""><div class=""><div class=""><div class=""><div><div class=""><span class=""><a class="" data-testid="authorName" href="/?source=post_page---byline--a2ce2e6de88e-----------------------------------------">Scott Batson</a></span></div></div></div><div class=""></div><div class=""><button class=""><span class=""><span class="">Follow</span></span></button></div></div></div></span></div><div class=""><span class=""><div class=""><span data-testid="storyReadTime">4 min read</span><div class="" aria-hidden="true"><span class="" aria-hidden="true"><span class="">·</span></span></div><span data-testid="storyPublishDate">Aug 31, 2026</span></div></span></div></div><div class=""><div class=""><div class=""><div class=""><div class=""><div class="pw-multi-vote-icon"><div class=""><div><div class=""><div class=""><button class="" data-testid="headerClapButton"></button></div></div></div></div></div><div class="pw-multi-vote-count"><div><div class=""><div class=""><p class=""><button class="">8.3K<span class=""></span></button></p></div></div></div></div></div></div><div class=""><div><div class=""><div class=""><button class="" aria-label="responses"><p class=""><span class="pw-responses-count">314</span></p></button></div></div></div></div><div class=""><div class=""><div><div class=""><div class=""><div class=""><button aria-label="Repost" class=""><div class=""><div class=""></div></div></button></div></div></div></div></div><div class=""><div><div class=""><div class=""><p class=""><button class="">146</button></p></div></div></div></div></div></div></div><div class=""><div class=""></div><div class=""><div><div class=""><div class=""><div class=""><button aria-label="Add to list bookmark button" data-testid="headerBookmarkButton" class=""></button></div></div></div></div></div><div class=""><div class=""><div class=""><div class=""><div class=""><div><a class="" href="https://medium.com/plans?dimension=post_audio_button&amp;postId=a2ce2e6de88e&amp;source=upgrade_membership---post_audio_button-------------------------------------------"><div><div class=""><div class=""><button aria-label="Listen" data-testid="audioPlayButton" class=""><div class=""><p class="">Listen</p></div></button></div></div></div></a></div></div></div></div></div></div><div class=""><div><div class=""><div class=""><button aria-label="Share Post" data-testid="headerSocialShareButton" class=""><div class=""><p class="">Share</p></div></button></div></div></div></div><div class=""><div class=""><div><div><div class=""><div class=""><button aria-label="More options" data-testid="headerStoryOptionsButton" class=""><div class=""><p class="">More</p></div></button></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class=""><div class=""><div class=""><figure class=""><div role="button" class=""><span class="speechify-ignore">Press enter or click to view image in full size</span><div class=""><picture><source><source data-testid="og"><img alt="" class="" role="presentation" src="https://miro.medium.com/v2/resize:fit:1000/1*fXHxk5foVZAL2ZR58_F5tw.png"></picture></div></div><figcaption class="" data-selectable-paragraph="">My cursor screen (even though I mostly use Claude now… but that’s a boring picture). Photo by me</figcaption></figure></div></div></div><div class=""><div class=""><p id="e271" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">Most every programmer is suffering the same growing pains right now.</mark> We’re Barry Allen (or Jay Garrick, if you’re old) with access to the Speed Force for the first time. Zooming around faster than our intent.</p><p id="4161" class="pw-post-body-paragraph" data-selectable-paragraph="">Like many of you, AI came crashing into my daily work-life. It paid dividends immediately. Things that used to take me days, I was doing in hours. I could take on large, complex, meaty projects and deliver them <em class="">fast</em>.</p><p id="a346" class="pw-post-body-paragraph" data-selectable-paragraph="">I was 5 times as productive. So, the next logical step? Well, I need to work on 5 times as many things, right? And that’s what I did. That’s what a lot of my friends and peers did.</p><p id="4dcc" class="pw-post-body-paragraph" data-selectable-paragraph="">A bug report that hints an infrastructure issue? I’m on it.</p><p id="d1b8" class="pw-post-body-paragraph" data-selectable-paragraph="">A new page for managing user settings? It’s in scope now!</p><p id="15ae" class="pw-post-body-paragraph" data-selectable-paragraph="">An admin tool for block users? Put me in coach!</p><p id="2b5d" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I had </mark><mark class=""><em class="">stacks</em></mark><mark class=""> of stacks of pull requests. AI was writing my linear tickets for me and responding to threads and writing project summaries. I was working on everything, everywhere, all at once.</mark></p><p id="e309" class="pw-post-body-paragraph" data-selectable-paragraph="">But like a raccoon on head of a love-stricken chef, I wasn’t fully in control.</p><figure class=""><div role="button" class=""><span class="speechify-ignore">Press enter or click to view image in full size</span><div class=""><picture><source><source data-testid="og"><img alt="" class="" role="presentation" src="https://miro.medium.com/v2/resize:fit:700/0*pHkr2CclKTmbmjPV.jpeg"></picture></div></div><figcaption class="" data-selectable-paragraph="">Raccacoonie from “Everything, Everywhere, All At Once”</figcaption></figure><p id="4e35" class="pw-post-body-paragraph" data-selectable-paragraph="">And a few months in, I was burnt out. You want to talk about productivity? I managed to burn myself out 10 times faster than before! Now <em class="">that’s</em> speed for you!</p><p id="6f94" class="pw-post-body-paragraph" data-selectable-paragraph="">I had to take a step back and ask myself: what should I do with this new productivity? Because clearly “more work but harder” wasn’t the answer. Context was getting lost. PRs would sit for weeks, forgotten. <mark class="">Reviews weren’t as thorough.</mark></p><h2 id="4262" class="" data-selectable-paragraph="">Slow work</h2><p id="640e" class="pw-post-body-paragraph" data-selectable-paragraph="">Rather than continuing down that path, I took a step back and tried to think of the best ways I spend my time at work.</p><p id="d59d" class="pw-post-body-paragraph" data-selectable-paragraph="">For me, the best times are when I’m learning something or helping someone else learn.</p><p id="5288" class="pw-post-body-paragraph" data-selectable-paragraph="">When my agent starts a loop, spinning up sub agents and self-reviewing and stacking PRs… what if… rather than starting <em class="">another</em> loop of work, I could just… read something?</p><p id="8120" class="pw-post-body-paragraph" data-selectable-paragraph="">What if I just DM’d a friend at work and asked if they wanted to pair on something?</p><p id="cdfe" class="pw-post-body-paragraph" data-selectable-paragraph="">Hell, what if I <em class="">wrote</em> something? (I know, as someone who works at <strong class="">the writing website</strong>, this one should have been obvious).</p><p id="bb0e" class="pw-post-body-paragraph" data-selectable-paragraph="">So that’s what I started doing. I started actually <em class="">reading</em> tech articles and blog posts. I’ve been in web development for over 15 years, and as such, I developed the skill of <em class="">skimming the hell out of every article</em>. I would search for the code snippet I needed, the conclusion, the link out to the library.</p><p id="4b5e" class="pw-post-body-paragraph" data-selectable-paragraph="">Before AI, you <em class="">had</em> to do that. Writing code took too long, so you couldn’t spare time digesting someone else’s rambling blog post.</p><p id="e576" class="pw-post-body-paragraph" data-selectable-paragraph="">And what you missed out on was the very human side of our industry. The funny writers, the shared life experience, the journey.</p><p id="8fde" class="pw-post-body-paragraph" data-selectable-paragraph="">To be fair, most StackOverflow posts are worth skimming… but not all of them!</p><p id="f7b5" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I’m reading documentation more thoroughly now. I’m understanding how a </mark><mark class=""><code class="">ViewTransition</code></mark><mark class=""> in React works, instead of just finding the code snippet, implementing it and debugging from there.</mark></p><p id="0aff" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">That thorough reading has informed how I talk to my agents</mark>. I am more consciously leading them down a path I would have paved myself because I’m taking the time to digest the full scope of a feature.</p><h2 id="7f5d" class="" data-selectable-paragraph="">Writing</h2><p id="d9bf" class="pw-post-body-paragraph" data-selectable-paragraph="">The best way I’ve been spending my time? Writing.</p><p id="ee36" class="pw-post-body-paragraph" data-selectable-paragraph="">I write my <a class="" href="https://tk.xyz/notes/67eb3911-74fe-46cc-b867-f5de1ccd9c10">daily journal on TK most every day</a>. Before, I would have felt too busy to spare 15 minutes to write up some random thoughts.</p><p id="4f89" class="pw-post-body-paragraph" data-selectable-paragraph="">And do you know what happened? People read them! And commented! I talked to <em class="">real users</em> and sparked ideas for new features. The <a class="" href="https://medium.com/blog/two-improvements-for-publication-editors-better-submissions-controls-and-a-clearer-editor-partner-1cb9944af277">submission rules we implemented</a>? The <a class="" href="https://medium.com/blog/editors-welcome-to-your-new-content-calendar-1278d29c19c2">content calendar</a>? The new editors page? Those all came about because people read my work notes and left comments.</p><p id="7e8b" class="pw-post-body-paragraph" data-selectable-paragraph="">I can channel that productivity into something actually useful for real users. That’s worth the token cost.</p><p id="26e5" class="pw-post-body-paragraph" data-selectable-paragraph="">I get the temptation. Your backlog never ends, your managers were wowed by the last thing you shipped in 1 day, so you want to chase that high, and everyone on LinkedIn is talking about the side project they’re launching.</p><p id="0f79" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">But here’s what I learned by going slower and writing out my thoughts: careful work leads to more productivity </mark><mark class=""><strong class="">in the long run</strong></mark><mark class="">. If you take the time think about your decisions, think about your product, write down your thoughts, or reach out to a coworker, you’d be amazed at what you can learn.</mark></p><p id="c1b6" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I’m not shipping 10 times as many things now, but the things I’m shipping are 10 times as meaningful.</mark></p></div></div></div></div></section></div></div></article></body></html>
\ No newline at end of file
+<html><head><meta property="og:site_name" content="Medium"><title>What Should Programmers Do While the AI Writes Code?</title></head><body><article class=""><div class=""><div class=""><span class=""></span><section><div><div class=""></div><div class="speechify-ignore"><aside class=""><div class=""><button class=""><p class="">1</p></button><span class="" aria-hidden="true"><span class="">·</span></span><p class=""><span>Top highlight</span></p></div><div class=""><button class=""><p class="">2</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">1</p></button></div><div class=""><button class=""><p class="">2</p></button></div><div class=""><button class=""><p class="">1</p></button></div></aside></div><div><div class="speechify-ignore"><div class=""></div><div class=""><div class=""><div class=""><div class=""><div><a class="" href="https://medium.com/plans?source=upgrade_membership---post_counter--a2ce2e6de88e-----------------------------------------"><div class=""><p class="">This member-only story is on us.</p></div><div class=""><div class=""></div></div></a></div></div></div></div></div><div class=""><div class=""><div class=""><div class=""><div><div class=""><div><div class=""><p class="">Member-only story</p></div></div></div></div></div></div></div></div></div></div><div><div class=""><div class=""><div class="speechify-ignore"><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/ai?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">AI</span></a></div></div></div><button aria-label="Unfollow AI" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/programming?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Programming</span></a></div></div></div><button aria-label="Unfollow Programming" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/ai-agent?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">AI Agent</span></a></div></div></div><button aria-label="Unfollow AI Agent" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/productivity?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Productivity</span></a></div></div></div><button aria-label="Follow Productivity" class=""></button></div><div class=""><div class=""><div class=""><div class=""><a class="" href="https://medium.com/tag/software-development?source=post_page---header_tags--a2ce2e6de88e-----------------------------------------"><span class="">Software Development</span></a></div></div></div><button aria-label="Unfollow Software Development" class=""></button></div></div></div></div></div><div class=""><div class=""><div class=""><div><h1 id="15d0" class="pw-post-title" data-testid="storyTitle" data-selectable-paragraph="">What Should Programmers Do While the AI Writes Code?</h1></div><div><h2 id="14b2" class="pw-subtitle-paragraph" data-selectable-paragraph="">Hint: not start another AI coding loop</h2><div><div class="speechify-ignore"><div class="speechify-ignore"><div class=""><div class=""><div class=""><div><div class=""><a href="/?source=post_page---byline--a2ce2e6de88e-----------------------------------------"><div class=""><div class=""><div class=""></div></div></div></a></div></div></div><span class=""><div class=""><div class=""><div class=""><div><div class=""><span class=""><a class="" data-testid="authorName" href="/?source=post_page---byline--a2ce2e6de88e-----------------------------------------">Scott Batson</a></span></div></div></div><div class=""></div><div class=""><button class=""><span class=""><span class="">Follow</span></span></button></div></div></div></span></div><div class=""><span class=""><div class=""><span data-testid="storyReadTime">4 min read</span><div class="" aria-hidden="true"><span class="" aria-hidden="true"><span class="">·</span></span></div><span data-testid="storyPublishDate">Aug 31, 2026</span></div></span></div></div><div class=""><div class=""><div class=""><div class=""><div class=""><div class="pw-multi-vote-icon"><div class=""><div><div class=""><div class=""><button class="" data-testid="headerClapButton"></button></div></div></div></div></div><div class="pw-multi-vote-count"><div><div class=""><div class=""><p class=""><button class="">8.3K<span class=""></span></button></p></div></div></div></div></div></div><div class=""><div><div class=""><div class=""><button class="" aria-label="responses"><p class=""><span class="pw-responses-count">314</span></p></button></div></div></div></div><div class=""><div class=""><div><div class=""><div class=""><div class=""><button aria-label="Repost" class=""><div class=""><div class=""></div></div></button></div></div></div></div></div><div class=""><div><div class=""><div class=""><p class=""><button class="">146</button></p></div></div></div></div></div></div></div><div class=""><div class=""></div><div class=""><div><div class=""><div class=""><div class=""><button aria-label="Add to list bookmark button" data-testid="headerBookmarkButton" class=""></button></div></div></div></div></div><div class=""><div class=""><div class=""><div class=""><div class=""><div><a class="" href="https://medium.com/plans?dimension=post_audio_button&amp;postId=a2ce2e6de88e&amp;source=upgrade_membership---post_audio_button-------------------------------------------"><div><div class=""><div class=""><button aria-label="Listen" data-testid="audioPlayButton" class=""><div class=""><p class="">Listen</p></div></button></div></div></div></a></div></div></div></div></div></div><div class=""><div><div class=""><div class=""><button aria-label="Share Post" data-testid="headerSocialShareButton" class=""><div class=""><p class="">Share</p></div></button></div></div></div></div><div class=""><div class=""><div><div><div class=""><div class=""><button aria-label="More options" data-testid="headerStoryOptionsButton" class=""><div class=""><p class="">More</p></div></button></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class=""><div class=""><div class=""><figure class=""><div role="button" class=""><span class="speechify-ignore">Press enter or click to view image in full size</span><div class=""><picture><source><source data-testid="og"><img alt="" class="" role="presentation" src="https://miro.medium.com/v2/resize:fit:1000/1*fXHxk5foVZAL2ZR58_F5tw.png"></picture></div></div><figcaption class="" data-selectable-paragraph="">My cursor screen (even though I mostly use Claude now… but that’s a boring picture). Photo by me</figcaption></figure></div></div></div><div class=""><div class=""><p id="e271" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">Most every programmer is suffering the same growing pains right now.</mark> We’re Barry Allen (or Jay Garrick, if you’re old) with access to the Speed Force for the first time. Zooming around faster than our intent.</p><p id="4161" class="pw-post-body-paragraph" data-selectable-paragraph="">Like many of you, AI came crashing into my daily work-life. It paid dividends immediately. Things that used to take me days, I was doing in hours. I could take on large, complex, meaty projects and deliver them <em class="">fast</em>.</p><p id="a346" class="pw-post-body-paragraph" data-selectable-paragraph="">I was 5 times as productive. So, the next logical step? Well, I need to work on 5 times as many things, right? And that’s what I did. That’s what a lot of my friends and peers did.</p><p id="4dcc" class="pw-post-body-paragraph" data-selectable-paragraph="">A bug report that hints an infrastructure issue? I’m on it.</p><p id="d1b8" class="pw-post-body-paragraph" data-selectable-paragraph="">A new page for managing user settings? It’s in scope now!</p><p id="15ae" class="pw-post-body-paragraph" data-selectable-paragraph="">An admin tool for block users? Put me in coach!</p><p id="2b5d" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I had </mark><mark class=""><em class="">stacks</em></mark><mark class=""> of stacks of pull requests. AI was writing my linear tickets for me and responding to threads and writing project summaries. I was working on everything, everywhere, all at once.</mark></p><p id="e309" class="pw-post-body-paragraph" data-selectable-paragraph="">But like a raccoon on head of a love-stricken chef, I wasn’t fully in control.</p><figure class=""><div role="button" class=""><span class="speechify-ignore">Press enter or click to view image in full size</span><div class=""><picture><source><source data-testid="og"><img alt="" class="" role="presentation" src="https://miro.medium.com/v2/resize:fit:700/0*pHkr2CclKTmbmjPV.jpeg"></picture></div></div><figcaption class="" data-selectable-paragraph="">Raccacoonie from “Everything, Everywhere, All At Once”</figcaption></figure><p id="4e35" class="pw-post-body-paragraph" data-selectable-paragraph="">And a few months in, I was burnt out. You want to talk about productivity? I managed to burn myself out 10 times faster than before! Now <em class="">that’s</em> speed for you!</p><p id="6f94" class="pw-post-body-paragraph" data-selectable-paragraph="">I had to take a step back and ask myself: what should I do with this new productivity? Because clearly “more work but harder” wasn’t the answer. Context was getting lost. PRs would sit for weeks, forgotten. <mark class="">Reviews weren’t as thorough.</mark></p><h2 id="4262" class="" data-selectable-paragraph="">Slow work</h2><p id="640e" class="pw-post-body-paragraph" data-selectable-paragraph="">Rather than continuing down that path, I took a step back and tried to think of the best ways I spend my time at work.</p><p id="d59d" class="pw-post-body-paragraph" data-selectable-paragraph="">For me, the best times are when I’m learning something or helping someone else learn.</p><p id="5288" class="pw-post-body-paragraph" data-selectable-paragraph="">When my agent starts a loop, spinning up sub agents and self-reviewing and stacking PRs… what if… rather than starting <em class="">another</em> loop of work, I could just… read something?</p><p id="8120" class="pw-post-body-paragraph" data-selectable-paragraph="">What if I just DM’d a friend at work and asked if they wanted to pair on something?</p><p id="cdfe" class="pw-post-body-paragraph" data-selectable-paragraph="">Hell, what if I <em class="">wrote</em> something? (I know, as someone who works at <strong class="">the writing website</strong>, this one should have been obvious).</p><p id="bb0e" class="pw-post-body-paragraph" data-selectable-paragraph="">So that’s what I started doing. I started actually <em class="">reading</em> tech articles and blog posts. I’ve been in web development for over 15 years, and as such, I developed the skill of <em class="">skimming the hell out of every article</em>. I would search for the code snippet I needed, the conclusion, the link out to the library.</p><p id="4b5e" class="pw-post-body-paragraph" data-selectable-paragraph="">Before AI, you <em class="">had</em> to do that. Writing code took too long, so you couldn’t spare time digesting someone else’s rambling blog post.</p><p id="e576" class="pw-post-body-paragraph" data-selectable-paragraph="">And what you missed out on was the very human side of our industry. The funny writers, the shared life experience, the journey.</p><p id="8fde" class="pw-post-body-paragraph" data-selectable-paragraph="">To be fair, most StackOverflow posts are worth skimming… but not all of them!</p><p id="f7b5" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I’m reading documentation more thoroughly now. I’m understanding how a </mark><mark class=""><code class="">ViewTransition</code></mark><mark class=""> in React works, instead of just finding the code snippet, implementing it and debugging from there.</mark></p><p id="0aff" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">That thorough reading has informed how I talk to my agents</mark>. I am more consciously leading them down a path I would have paved myself because I’m taking the time to digest the full scope of a feature.</p><h2 id="7f5d" class="" data-selectable-paragraph="">Writing</h2><p id="d9bf" class="pw-post-body-paragraph" data-selectable-paragraph="">The best way I’ve been spending my time? Writing.</p><p id="ee36" class="pw-post-body-paragraph" data-selectable-paragraph="">I write my <a class="" href="https://tk.xyz/notes/67eb3911-74fe-46cc-b867-f5de1ccd9c10">daily journal on TK most every day</a>. Before, I would have felt too busy to spare 15 minutes to write up some random thoughts.</p><p id="4f89" class="pw-post-body-paragraph" data-selectable-paragraph="">And do you know what happened? People read them! And commented! I talked to <em class="">real users</em> and sparked ideas for new features. The <a class="" href="https://medium.com/blog/two-improvements-for-publication-editors-better-submissions-controls-and-a-clearer-editor-partner-1cb9944af277">submission rules we implemented</a>? The <a class="" href="https://medium.com/blog/editors-welcome-to-your-new-content-calendar-1278d29c19c2">content calendar</a>? The new editors page? Those all came about because people read my work notes and left comments.</p><p id="7e8b" class="pw-post-body-paragraph" data-selectable-paragraph="">I can channel that productivity into something actually useful for real users. That’s worth the token cost.</p><p id="26e5" class="pw-post-body-paragraph" data-selectable-paragraph="">I get the temptation. Your backlog never ends, your managers were wowed by the last thing you shipped in 1 day, so you want to chase that high, and everyone on LinkedIn is talking about the side project they’re launching.</p><p id="0f79" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">But here’s what I learned by going slower and writing out my thoughts: careful work leads to more productivity </mark><mark class=""><strong class="">in the long run</strong></mark><mark class="">. If you take the time think about your decisions, think about your product, write down your thoughts, or reach out to a coworker, you’d be amazed at what you can learn.</mark></p><p id="c1b6" class="pw-post-body-paragraph" data-selectable-paragraph=""><mark class="">I’m not shipping 10 times as many things now, but the things I’m shipping are 10 times as meaningful.</mark></p></div></div></div></div></section></div></div></article><script type="application/ld+json">{"@type":"SocialMediaPosting","url":"https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e","headline":"What Should Programmers Do While the AI Writes Code?","author":{"name":"Scott Batson"},"datePublished":"2026-08-31T18:48:46Z"}</script></body></html>
\ No newline at end of file
diff --git a/apps/extension/fixtures/platforms/sources.json b/apps/extension/fixtures/platforms/sources.json
index 7c298f0f..e7729437 100644
--- a/apps/extension/fixtures/platforms/sources.json
+++ b/apps/extension/fixtures/platforms/sources.json
@@ -94,7 +94,7 @@
"url": "https://medium.com/@scott.batson_76410/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e",
"capturedOn": "2026-10-11",
"state": "Redirects to scottbatson.dev, a Medium custom domain with og:site_name=Medium. The browser can read the complete rendered story, with a visible free-story entitlement notice.",
- "expected": "Article title, subtitle, every loaded body block, two images and captions. Exclude highlights UI, member notices, author controls, reaction counts and image-viewer prompts. No hidden paid content or account/session data retained."
+ "expected": "Article title, subtitle, every loaded body block, two images and captions. Exclude highlights UI, member notices, author controls, reaction counts and image-viewer prompts. No hidden paid content or account/session data retained. 2026-10-15: Own public JSON-LD adds Scott Batson and datePublished 2026-08-31T18:48:46Z; article saves web-clip/medium. Visible Aug 31, 2026 remains date precision when schema is absent."
},
{
"file": "substack-note.html",
@@ -108,9 +108,193 @@
"url": "https://www.oneusefulthing.org/p/the-dot-and-the-swarm",
"capturedOn": "2026-10-11",
"state": "Public article on a Substack custom domain. Sanitized structural excerpt retains beginning/final paragraphs, three sections, three images and caption, plus subscription/share UI for exclusion tests.",
- "expected": "Clean article title, subtitle, retained paragraphs, sections, three images and caption. No subscription widgets, Share controls, header anchor buttons or comments; selection still takes priority. Not a full-article fixture or paid-content acceptance."
+ "expected": "Clean article title, subtitle, retained paragraphs, sections, three images and caption. No subscription widgets, Share controls, header anchor buttons or comments; selection still takes priority. Not a full-article fixture or paid-content acceptance. 2026-10-15: Own public JSON-LD adds Ethan Mollick and original datePublished 2026-10-01T18:54:12+08:00; article saves web-clip/substack."
+ },
+ {
+ "file": "boss.html",
+ "url": "https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html",
+ "capturedOn": "2026-10-12",
+ "state": "User-provided job URL, read in Ego Chromium after reload exposed the complete salary, responsibilities, requirements and company text. Relevant rendered DOM only; computed CSS-hidden nodes marked hidden before removing styles and tracking attributes.",
+ "expected": "AI平台开发工程师; 25-50K·13薪; 深圳, 5-10年, 本科; visible benefits including 五险一金; complete requirements through OCR/multimodal experience; company introduction and 深圳福田区博今国际A座. Exclude hidden garbled spans, recruiter avatar, maps, login/communication UI, recommendations and competitiveness. Page update date is not publication time."
+ },
+ {
+ "file": "boss-login-required.html",
+ "url": "https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html",
+ "capturedOn": "2026-10-12",
+ "state": "Same real URL before readable reload: salary is rendered as SVG placeholders and requirements stop at the login-required layer. Irrelevant sections and SVG paths removed.",
+ "expected": "Refuse the truncated preview; create no fallback note. Never derive salary from listing pages or retrieve protected remainder."
+ },
+ {
+ "file": "xueqiu.html",
+ "url": "https://xueqiu.com/5636485254/253443400",
+ "capturedOn": "2026-10-12",
+ "state": "Public signed-out article in Ego Chromium. Relevant article container and one comment retained; scripts, forms and event attributes removed.",
+ "expected": "Full article through final customer/service sentence, --大圣--, post time 2023-06-16T23:54:12.000Z, three images, explicit SH600438/SH601012/SH688472 stock tags. Exclude hidden attribution, reaction/discussion UI and separate comments. Body syndicated timestamp must not replace post publication time."
+ },
+ {
+ "file": "xueqiu-feed.html",
+ "url": "https://xueqiu.com/",
+ "capturedOn": "2026-10-12",
+ "state": "Two real truncated home-feed cards in Ego Chromium. Header/author/permalink/body only; no account or session state.",
+ "expected": "Pointer binds own header, never a body reference or sibling. Description previews require opening detail; cannot be saved as complete posts. Real /S/09992 stock link preserves its leading zero when present in a readable body."
+ },
+ {
+ "file": "xiaoyuzhou-hosts.html",
+ "url": "https://www.xiaoyuzhoufm.com/episode/612375e57f89405077cbeb3b",
+ "capturedOn": "2026-10-12",
+ "state": "Public episode read in Ego Chromium. Relevant header, complete Show Notes DOM and minimal query/episode payload only; no audio or user state.",
+ "expected": "Episode title, 下课以后, all six time-axis nodes from 1:10 through 16:42, explicit 阿丁、毛毛 host text, cover and final listening guidance. Do not infer hosts from podcast authors."
+ },
+ {
+ "file": "wechat.html",
+ "url": "https://mp.weixin.qq.com/s/TC-ONpL3PGklsD0yhtcuBQ",
+ "capturedOn": "2026-10-14",
+ "state": "Public Official Account article rendered in Ego Chromium; full #js_content, account/author/time and declared cover retained. 2026-10-15 heading acceptance: retain computed font-size/font-weight/text-align for 75 visible text runs from the same real page; other publisher styles remain removed.",
+ "expected": "Keep 华为云DeepSeek-R1&V3满血版体验 title, 大数据架构之道, 陈云亮, source date precision, cover plus 20 meaningful body images (21 total) and final model-conversation guidance. Resolve data-src. Exclude the publisher follow banner and arrow, four explicitly labeled decorative dividers, native CPS ads, trailing standalone native article recommendation, reward/share/comment controls. Preserve tutorial actions, quoted follow wording, meaningful GIFs and inline article references. The fixture retains the original uncleaned DOM as a regression input. Restore three H2 sections (什么是Deepseek V3, 什么是DeepSeek R1, 华为云ModelAart Studio(MaaS)) and four H3 step labels; keep the original article title unchanged."
+ },
+ {
+ "file": "sspai.html",
+ "url": "https://sspai.com/post/92653",
+ "capturedOn": "2026-10-14",
+ "state": "Public rendered article in Ego Chromium; relevant article root with computed hidden author popovers retained as hidden.",
+ "expected": "Keep full sleep-apnea/Apple Watch article, 北鸮, original date 2024-10-10, all nine original images and final references. Append its own update as a blockquote: displayed update time, bold title 中国大陆推出睡眠呼吸暂停迹象提示功能 and full 2026-10-14 explanation in source order, without replacing the publication date. Exclude duplicate update navigation, author popovers, sidebar and interactions."
+ },
+ {
+ "file": "juejin.html",
+ "url": "https://juejin.cn/post/6972051526416072717",
+ "capturedOn": "2026-10-14",
+ "state": "Public rendered article in Ego Chromium; article-scoped schema author/time and code blocks retained. Desktop author header is CSS-hidden.",
+ "expected": "Keep JavaScript异步发展历史, 小和山的菜鸟们 from declared public author metadata, original UTC time, complete code with language and indentation, and two valid body image URLs. Keep the comparison table as a structured table: three headers 发展史/优点/缺点 and four body rows callback/promise/generator/async-await, preserving every cell and the 事件循环 link. An empty-source image placeholder is not an attachment. Remove copy-code controls."
+ },
+ {
+ "file": "jike.html",
+ "url": "https://m.okjike.com/originalPosts/66ac89b0314f5cced41012d3",
+ "capturedOn": "2026-10-14",
+ "state": "Public signed-out mobile share detail in Ego Chromium. Only own public post ID/content/createdAt/picture URLs retained from Next data.",
+ "expected": "Keep 汐笺, complete AI-analysis caption, original timestamp and one public original picture. Exclude avatar, circle, reactions and comments. JSON verifies DOM completeness; it does not supply hidden body text."
+ },
+ {
+ "file": "jike-grid.html",
+ "url": "https://m.okjike.com/originalPosts/6715e824d9dc81724c2ec74d",
+ "capturedOn": "2026-10-14",
+ "state": "Public signed-out mobile share detail in Ego Chromium; nine images and own public post metadata.",
+ "expected": "Keep 彗星咻咻咻, 又凑了九张赤坎游客照 caption, exact source time and all nine public original image URLs in order. Same-count incorrect or reordered images cannot satisfy the declared post."
+ },
+ {
+ "file": "jike-long.html",
+ "url": "https://m.okjike.com/originalPosts/64c9dd9a2edae6abdc610605",
+ "capturedOn": "2026-10-14",
+ "state": "Public signed-out mobile share detail in Ego Chromium; complete long text already loaded, no actual expand control present.",
+ "expected": "Keep 泛函, all career text through 《世界尽头的咖啡馆》和《斯坦福大学人生设计课》, 31 body links and one link-preview cover. Strip own Jike share tracking. Synthetic local-expand variants are not a live click acceptance record."
+ },
+ {
+ "file": "douban-book.html",
+ "url": "https://book.douban.com/review/16093028/",
+ "capturedOn": "2026-10-14",
+ "state": "Public full book review in Ego Chromium; exact review root, author and six body images. Visible date is labeled edited.",
+ "expected": "Keep 行走在文字间,是我与这个世界达成的和解, 完颜打骨折, all seven displayed review paragraphs and six images in source order. Blank lines within the two HTML paragraphs are meaningful under Douban's pre-wrap styling. Image archival needs the declared Douban CDN access and own-extension referrer rule. Exclude spoiler/interactions/attribution UI; edited date is not original publication time."
+ },
+ {
+ "file": "douban-movie.html",
+ "url": "https://movie.douban.com/review/17798662/",
+ "capturedOn": "2026-10-14",
+ "state": "Public full movie review in Ego Chromium; exact review root and two images. Visible date is labeled edited.",
+ "expected": "Keep 假如没有越狱成功,安迪也仍是自由的, 希音, complete review and two images. Omit edited date from original publication metadata; exclude comments."
+ },
+ {
+ "file": "douban-music.html",
+ "url": "https://music.douban.com/review/17855287/",
+ "capturedOn": "2026-10-14",
+ "state": "Public full prose music review in Ego Chromium; exact review root and three images.",
+ "expected": "Keep 回来击穿他的肚脐眼, Ink乐评:崔健《飞狗》 prose, author when readable, all three images and full conclusion. Exclude interactions and comments."
+ },
+ {
+ "file": "douban-note.html",
+ "url": "https://www.douban.com/note/814698224/",
+ "capturedOn": "2026-10-14",
+ "state": "Public diary in Ego Chromium after the site security redirect returned automatically; no CAPTCHA or login was performed.",
+ "expected": "Keep 雨中小镇, 孩子气概, source time 2021-10-14T22:06:17 without guessing its timezone, complete diary and six images. Exclude avatar, footer and comments."
+ },
+ {
+ "file": "douban-comments.html",
+ "url": "https://book.douban.com/subject/36864764/comments/",
+ "capturedOn": "2026-10-14",
+ "state": "Public subject short-comment list in Ego Chromium. The first own data-cid is 4237804504; its site /comment/ permalink returned 404 when navigated directly.",
+ "expected": "Right-click the exact first card to keep 散步 · 就绪雀 and its short comment, never neighbor 4259416906. Optional date/permalink absence does not reject readable card content. Retain the working list URL and actual c-4237804504 fragment as source. Toolbar requires a selected passage on lists."
+ },
+ {
+ "file": "jike-feed.html",
+ "url": "https://m.okjike.com/topics/63579abb6724cc583b9bba9a",
+ "capturedOn": "2026-10-15",
+ "state": "Public signed-out H5 topic feed in Ego Chromium. First two rendered cards and only their public id/content/createdAt/pictures/user username and screenName retained. No account/session payload or array-index binding.",
+ "expected": "Bind own avatar profile plus complete caption and declared media uniquely. First card 陈皮皮屁 includes the 42章经 audio preview; second JimHuiHui retains the full AI/content-industry text through 护城河 and one original picture. Pointer and save must exclude the other card. No audio download."
+ },
+ {
+ "file": "substack-paywall.html",
+ "url": "https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense",
+ "capturedOn": "2026-10-15",
+ "state": "Public signed-out paid preview read in Ego Chromium. Sanitized newsletter article root retains the actual visible .paywall, header and .available-content preview.",
+ "expected": "Show content-restricted badge and guidance; refuse whole-article capture without a fallback note even if body/title is missing. Explicit visible text selections remain allowed. Does not retrieve or archive the paid remainder."
+ },
+ {
+ "file": "linkedin-person.html",
+ "url": "https://www.linkedin.com/posts/maddyahmad_softwareengineering-artificialintelligence-share-7456582751698190336-6NVK/",
+ "capturedOn": "2026-10-15",
+ "state": "Signed-in Ego Chromium SDUI personal post. Sanitized own author header and main commentary; profile photos and interactive controls removed.",
+ "expected": "Keep Mohammad Ahmed separately from Technical Lead - Backend at Dizzaract; retain displayed 5 个月前 and complete body. Bind share:7456582751698190336, excluding connection degree, comments and nested cards."
+ },
+ {
+ "file": "xueqiu-feed-detail.html",
+ "url": "https://www.xueqiu.com/6114376649/411862401",
+ "capturedOn": "2026-10-15",
+ "state": "Public detail HTML fetched in Ego Chromium from the www.xueqiu.com feed origin, with the existing page session. Own article header, title and body retained; scripts and controls removed.",
+ "expected": "Read the complete 2238-character article behind the first truncated feed card; keep author, available source time and explicit stock links, without other feed cards."
+ },
+ {
+ "file": "xueqiu-feed-detail-second.html",
+ "url": "https://www.xueqiu.com/2754211668/411841572",
+ "capturedOn": "2026-10-15",
+ "state": "Same-origin public detail HTML for the second actual Ego feed card, sanitized as above.",
+ "expected": "Keep full text through 把自己的真金白银押在别人的嘴上,早晚是要付出代价的。, one body image and explicitly linked 09992/NTES. Remove the source-app footer; never save the feed preview as complete."
}
],
- "redaction": "Only relevant DOM containers and one comment excerpt remain. Controls, unrelated sections, scripts, event attributes and auth-bearing links were removed. Xiaoyuzhou JSON retains only query.id and episode eid/title/shownotes, used to verify identity and completeness. Tests derive synthetic boundary states from these real DOM fixtures; those variants are not live-site acceptance evidence. Phase 1 fixtures retain the actual target DOM and only post-relevant JSON records. Authentication, session, tracking and unrelated records are excluded. Reader and pointer tests use these structures; boundary mutations are synthetic.",
- "updatedOn": "2026-10-11"
+ "redaction": "Only relevant DOM containers and one comment excerpt remain. Controls, unrelated sections, scripts, event attributes and auth-bearing links were removed. Xiaoyuzhou JSON retains only query.id and episode eid/title/shownotes, used to verify identity and completeness. Tests derive synthetic boundary states from these real DOM fixtures; those variants are not live-site acceptance evidence. Phase 1 fixtures retain the actual target DOM and only post-relevant JSON records. Authentication, session, tracking and unrelated records are excluded. Reader and pointer tests use these structures; boundary mutations are synthetic. 2026-10-14 article/Jike/Douban samples retain only relevant rendered roots and public article metadata; computed hidden nodes are marked before styles are removed. Attribute allowlists exclude handlers, tracking fields and account/session state. Jike Next data retains only the selected public post identity/content/time and picUrl/middlePicUrl/thumbnailUrl. Douban list retains multiple real comments to verify exact pointer targeting and no neighbor capture.",
+ "updatedOn": "2026-10-15",
+ "liveChecks": [
+ {
+ "url": "https://book.douban.com/review/16093028/",
+ "checkedOn": "2026-10-15",
+ "expected": "Real DOM reader retains seven displayed paragraphs. Reloaded extension's own DNR rule enables all six CDN WebP downloads. The shared page-images flow persists 6/6 resources through the same local API worker's internal address; readback via the configured origin retains seven paragraphs, zero external images and six decodable attachments matching the source SHA-256 values. Normal Wrangler proxy upload/save attempts returned 503, recorded separately. Two owned temporary notes are deleted; the existing user's note remains untouched. This is component-chain verification, not native toolbar/menu clicking."
+ },
+ {
+ "url": "https://juejin.cn/post/6972051526416072717",
+ "checkedOn": "2026-10-15",
+ "expected": "Compiled reader and the actual shared note Markdown parser in Ego Chromium retain one table with three columns, one header row and four body rows. Every cell, row label and the 事件循环 link matches the source; two images, original publication time and source DOM remain unchanged. Reader/parser verification, not a new persisted-note UI acceptance."
+ },
+ {
+ "url": "https://sspai.com/post/92653",
+ "checkedOn": "2026-10-15",
+ "expected": "Compiled reader in Ego Chromium retains displayed 以下内容于 昨天 10:00更新, bold title 中国大陆推出睡眠呼吸暂停迹象提示功能 exactly once and complete update body within one parsed blockquote with no heading elements. Original publication remains 2024-10-10; nine images and source DOM remain unchanged. Reader and Markdown parsing verification, not a new persisted-note UI acceptance."
+ },
+ {
+ "url": "https://movie.douban.com/subject/1292052/comments?status=P",
+ "checkedOn": "2026-10-14",
+ "expected": "Movie comment card 32514679: 肖申克的救赎 · 如小果. Current compiled pointer listener marked exactly the own card via a DOM contextmenu event, and the compiled reader kept its own short body and working list source."
+ },
+ {
+ "url": "https://music.douban.com/subject/35398647/comments/",
+ "checkedOn": "2026-10-14",
+ "expected": "Music comment card 2791306478: 飞狗 · 1806. Current compiled pointer listener marked exactly the own card via a DOM contextmenu event, and the compiled reader kept its own short body and working list source. Not native browser context-menu clicking or instance persistence."
+ },
+ {
+ "url": "https://m.okjike.com/topics/63579abb6724cc583b9bba9a",
+ "checkedOn": "2026-10-15",
+ "expected": "Current compiled pointer marks precisely post 6ace942f756bbb66581c3f96 / JimHuiHui in ten real cards; compiled reader retains the complete own caption and one original image. DOM context-menu event, not native browser chrome clicking."
+ },
+ {
+ "url": "https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense",
+ "checkedOn": "2026-10-15",
+ "expected": "Actual visible paid-subscriber gate returns restricted from the compiled page reader. No hidden paid remainder is read."
+ }
+ ]
}
diff --git a/apps/extension/fixtures/platforms/sspai.html b/apps/extension/fixtures/platforms/sspai.html
new file mode 100644
index 00000000..b445ef25
--- /dev/null
+++ b/apps/extension/fixtures/platforms/sspai.html
@@ -0,0 +1,30 @@
+<!doctype html><html><head><meta><title>已经能测夜间体征的 Apple Watch,为什么要再做一个睡眠呼吸暂停提醒 - 少数派</title><meta property="og:type" content="website" hidden="">
+<meta property="og:site_name" content="少数派 - 高品质数字消费指南" hidden="">
+<meta property="og:title" content="已经能测夜间体征的 Apple Watch,为什么要再做一个睡眠呼吸暂停提醒 - 少数派" hidden="">
+<meta property="og:description" content="Apple Watch 打算让更多人意识到睡眠呼吸暂停的威胁,它是怎么做到的?" hidden="">
+<meta property="og:image" content="https://rssfile.sspai.com/2024/9/30/article/adaba0a3-41e5-28cf-e5ac-ac2ea222fc5e.png?imageMogr2/auto-orient/format/webp/ignore-error/1" hidden="">
+<meta property="og:url" content="/post/92653" hidden=""></head><body><article class="normal-article"><div class="article__header article__section__wrapper"><!----><div class="article__header__content"><div class="article__header__meta"><div class="article__header__meta__main"><span class="article__header__date">
+ 2024年10月10日
+ </span><span class="article__header__reading-time" hidden="">10 分钟阅读</span><!----></div></div><h1 id="article-title" class="article__header__title">
+ 已经能测夜间体征的 Apple Watch,为什么要再做一个睡眠呼吸暂停提醒
+ </h1><div class="article__header__footer"><div class="article__header__author"><div class="article-header-author"><span><div role="tooltip" id="el-popover-4595" aria-hidden="true" class="el-popover el-popper author-popover" hidden=""><!----><div><span class="author-type">主作者</span><div class="author-item"><div class="ss__portrait avatar"><a href="/u/thebaldingken/updates" class="ss__portrait__link el-popover__reference"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!72x72r/gravity/center/crop/72x72/format/webp/ignore-error/1" alt="北鸮"> <div class="ss__user__identifier ss__portrait__badge"><i class="ss__user__identifier__icon"></i> <!----></div></a> <span><div role="tooltip" id="el-popover-6286" aria-hidden="true" class="el-popover el-popper comp__SsUserCard__popover" hidden=""><!----><div class="ss__user__card__wrapper"><div class="ss__user__card"><div class="ss__user__card__header"><a href="/u/thebaldingken"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/center/crop/100x100/format/webp/ignore-error/1" class="ss__user__avatar"></a> <button class="ss__user__card__btn"><i class="iconfont-add--stroke"></i> <span>关注</span></button></div> <div class="ss__user__card__center"><div class="ss__user__card__nickname__wrapper"><div class="ss__user__card__nickname">北鸮</div> <!----> <!----></div> <div class="ss__user__card__role__wrapper"><div class="ss__user__card__role__item"><div class="ss__user__identifier role__icon"><i class="ss__user__identifier__icon"></i> <!----></div> <span class="role__name">少数派成员</span></div> <!----></div></div> <div class="ss__user__card__intro text_ellipsis2">
+ 秃头猫头鹰
+ </div> <!----></div></div></div><span class="el-popover__reference-wrapper"></span></span></div><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"><div class="ss__user__nickname el-popover__reference"><span>北鸮</span> <!----> <!----></div> <span></span></a><div role="tooltip" id="el-popover-8707" aria-hidden="true" class="el-popover el-popper comp__SsUserCard__popover" hidden=""><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"><!----></a><div class="ss__user__card__wrapper"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><div class="ss__user__card"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><div class="ss__user__card__header"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><a href="/u/thebaldingken"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/center/crop/100x100/format/webp/ignore-error/1" class="ss__user__avatar"></a> <button class="ss__user__card__btn"><i class="iconfont-add--stroke"></i> <span>关注</span></button></div> <div class="ss__user__card__center"><div class="ss__user__card__nickname__wrapper"><div class="ss__user__card__nickname">北鸮</div> <!----> <!----></div> <div class="ss__user__card__role__wrapper"><div class="ss__user__card__role__item"><div class="ss__user__identifier role__icon"><i class="ss__user__identifier__icon"></i> <!----></div> <span class="role__name">少数派成员</span></div> <!----></div></div> <div class="ss__user__card__intro text_ellipsis2">
+ 秃头猫头鹰
+ </div> <!----></div></div></div><span class="el-popover__reference-wrapper"></span></div><span class="author-type">联合作者</span></div></div><span class="el-popover__reference-wrapper"><div class="article__authors__popover__reference el-popover__reference"><div class="ss__portrait avatar"><a href="/u/thebaldingken/updates" class="ss__portrait__link el-popover__reference"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!72x72r/gravity/center/crop/72x72/format/webp/ignore-error/1" alt="北鸮"> <div class="ss__user__identifier ss__portrait__badge"><i class="ss__user__identifier__icon"></i> <!----></div></a> <span><div role="tooltip" id="el-popover-3398" aria-hidden="true" class="el-popover el-popper comp__SsUserCard__popover" hidden=""><!----><div class="ss__user__card__wrapper"><div class="ss__user__card"><div class="ss__user__card__header"><a href="/u/thebaldingken"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/center/crop/100x100/format/webp/ignore-error/1" class="ss__user__avatar"></a> <button class="ss__user__card__btn"><i class="iconfont-add--stroke"></i> <span>关注</span></button></div> <div class="ss__user__card__center"><div class="ss__user__card__nickname__wrapper"><div class="ss__user__card__nickname">北鸮</div> <!----> <!----></div> <div class="ss__user__card__role__wrapper"><div class="ss__user__card__role__item"><div class="ss__user__identifier role__icon"><i class="ss__user__identifier__icon"></i> <!----></div> <span class="role__name">少数派成员</span></div> <!----></div></div> <div class="ss__user__card__intro text_ellipsis2">
+ 秃头猫头鹰
+ </div> <!----></div></div></div><span class="el-popover__reference-wrapper"></span></span></div><div class="author__info"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"><div class="ss__user__nickname el-popover__reference"><span>北鸮</span> <div class="ss__user__identifier"><i class="ss__user__identifier__icon"></i> <!----></div> <!----></div> <span></span></a><div role="tooltip" id="el-popover-882" aria-hidden="true" class="el-popover el-popper comp__SsUserCard__popover" hidden=""><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"><!----></a><div class="ss__user__card__wrapper"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><div class="ss__user__card"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><div class="ss__user__card__header"><a href="/u/thebaldingken/updates" class="ss__user__nickname__wrapper nickname"></a><a href="/u/thebaldingken"><img src="https://cdnfile.sspai.com/2022/04/01/avatar/45095b5db98c397cc569446d70c0c9a6.png?imageMogr2/auto-orient/thumbnail/!100x100r/gravity/center/crop/100x100/format/webp/ignore-error/1" class="ss__user__avatar"></a> <button class="ss__user__card__btn"><i class="iconfont-add--stroke"></i> <span>关注</span></button></div> <div class="ss__user__card__center"><div class="ss__user__card__nickname__wrapper"><div class="ss__user__card__nickname">北鸮</div> <!----> <!----></div> <div class="ss__user__card__role__wrapper"><div class="ss__user__card__role__item"><div class="ss__user__identifier role__icon"><i class="ss__user__identifier__icon"></i> <!----></div> <span class="role__name">少数派成员</span></div> <!----></div></div> <div class="ss__user__card__intro text_ellipsis2">
+ 秃头猫头鹰
+ </div> <!----></div></div></div><span class="el-popover__reference-wrapper"></span><span class="author__bio text_ellipsis">
+ 秃头猫头鹰
+ </span></div></div></span></span></div></div><div class="article__header__actions"><span class="article__header__reading-time">10 分钟阅读</span><span class="article__header__actions__popover"><div role="tooltip" id="el-popover-8431" aria-hidden="true" class="el-popover el-popper article__header__menu__popover" hidden=""><!----><div class="article__header__menu"><span class="article__share__popover__wrapper"><span><div role="tooltip" id="el-popover-9785" aria-hidden="true" class="el-popover el-popper article__share__panel__popover" hidden=""><!----><div class="article__share__panel"><div class="article__share__panel__header">
+ 微信扫码分享
+ </div><div class="article__share__panel__qrcode"></div><div class="article__share__panel__divider"></div><button class="ss__button article__share__panel__item" type="button"><i class="ssCommunityIcon__picture"></i><span>以图片分享</span></button><a href="https://service.weibo.com/share/share.php?url=https%3A%2F%2Fsspai.com%2Fpost%2F92653?ref=weibo&amp;title=%E3%80%90%E5%B7%B2%E7%BB%8F%E8%83%BD%E6%B5%8B%E5%A4%9C%E9%97%B4%E4%BD%93%E5%BE%81%E7%9A%84%20Apple%20Watch%EF%BC%8C%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E5%86%8D%E5%81%9A%E4%B8%80%E4%B8%AA%E7%9D%A1%E7%9C%A0%E5%91%BC%E5%90%B8%E6%9A%82%E5%81%9C%E6%8F%90%E9%86%92%E3%80%91Apple%20Watch%20%E6%89%93%E7%AE%97%E8%AE%A9%E6%9B%B4%E5%A4%9A%E4%BA%BA%E6%84%8F%E8%AF%86%E5%88%B0%E7%9D%A1%E7%9C%A0%E5%91%BC%E5%90%B8%E6%9A%82%E5%81%9C%E7%9A%84%E5%A8%81%E8%83%81%EF%BC%8C%E5%AE%83%E6%98%AF%E6%80%8E%E4%B9%88%E5%81%9A%E5%88%B0%E7%9A%84%EF%BC%9F%EF%BC%88%E6%9D%A5%E8%87%AA%20%40%E5%B0%91%E6%95%B0%E6%B4%BEsspai%EF%BC%89%E5%85%A8%E6%96%87%EF%BC%9A&amp;pic=https%3A%2F%2Frssfile.sspai.com%2F2024%2F9%2F30%2Farticle%2Fadaba0a3-41e5-28cf-e5ac-ac2ea222fc5e.png%3FimageMogr2%2Fauto-orient%2Fignore-error%2F1&amp;appkey=3196502474#" rel="noopener noreferrer"><button class="ss__button article__share__panel__item" type="button"><i class="ssCommunityIcon__weibo"></i><span>分享到微博</span></button></a><div class="article__share__panel__divider"></div><div class="article__share__panel__footer">
+ 点击下方按钮可复制链接
+ </div></div></div><span class="el-popover__reference-wrapper"><button class="ss__button article__header__menu__item el-popover__reference" type="button"><i class="ssCommunityIcon__share"></i><span>分享</span></button></span></span><!----></span><button class="ss__button article__header__menu__item" type="button"><i class="ssCommunityIcon__favorite"></i><span>收藏</span></button><button class="ss__button article__header__menu__item article__header__menu__item--danger" type="button"><i class="ssCommunityIcon__report"></i><span>举报</span></button></div></div><span class="el-popover__reference-wrapper"><button class="ss__button article__header__menu__trigger el-popover__reference" type="text"><i class="ssCommunityIcon__more"></i></button></span></span></div></div></div><div class="article__header__banner"><img src="https://cdnfile.sspai.com/2024/9/30/article/adaba0a3-41e5-28cf-e5ac-ac2ea222fc5e.png?imageMogr2/auto-orient/thumbnail/!1374x/gravity/center/crop/1374x/format/webp/ignore-error/1" alt="已经能测夜间体征的 Apple Watch,为什么要再做一个睡眠呼吸暂停提醒" class="article__header__banner__image"></div></div><div class="article-body"><div><!----><div class="article__update__wrapper"><a href="/#update-0" class="article__update__item"><i class="ssCommunityIcon__postUpdate"></i><span class="article__update__item__text">10:00更新:中国大陆推出睡眠呼吸暂停迹象提示功能</span><i class="ssCommunityIcon__arrowMore"></i></a></div><div class="article__main__wrapper"><div class="article__main__content wangEditor-txt"><p>2024 年 9 月,Apple Watch Series 10 发布时,苹果带来了它在健康监测领域的又一尝试。Apple Watch Series 9、Ultra 2 与 SE 3 及更新型号可以在睡眠监测中发现用户呼吸节律的异常,并提醒用户疑似出现夜间呼吸暂停,当然也包括了最新发布的 Apple Watch Series 12 和 Apple Watch Ultra 4。</p><p>2026 年 9 月 4 日,「移动睡眠呼吸暂停迹象提示软件」获得国家药监局批准,功能于 10 月 14 日在中国大陆正式上线。</p><figure class="ss-imgRows ss-img-wrapper"><div class="ss-img-row-item"><img src="https://cdnfile.sspai.com/2024/09/30/fc33a7ce5eea69d99afdf6ebc5b7259e.jpg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="" data-original="https://cdnfile.sspai.com/2024/09/30/fc33a7ce5eea69d99afdf6ebc5b7259e.jpg?imageView2/2/format/webp"></div><div class="ss-img-row-item"><img src="https://cdnfile.sspai.com/2024/09/30/cc1e9c5ed4903f6c0dc91bb5e3a5b5a5.jpg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="" data-original="https://cdnfile.sspai.com/2024/09/30/cc1e9c5ed4903f6c0dc91bb5e3a5b5a5.jpg?imageView2/2/format/webp"></div></figure><p>Apple Watch 为什么要发展这个功能?它和之前的睡眠监测有什么区别?</p><h2 id="ss-hId-1">为什么是睡眠呼吸暂停?</h2><p>谁不认识几个睡觉打鼾的人呢?</p><p>你的家人、室友,澡堂里养神的大爷、上课趴着倒下的同桌,在睡梦中都有可能发出巨大声响——这件事我们曾在《<a href="https://sspai.com/post/67629">打鼾:你熟悉的夜间惊雷,究竟是什么?</a>》一文中详细聊过:打鼾表明人在睡眠时出现了上呼吸道受阻,鼾声就是上呼吸道狭窄时气流高速通过引发的振动所致。</p><figure class="image ss-img-wrapper"><img src="https://cdnfile.sspai.com/2024/09/30/article/8c88070ba77ec3753a0bd9c1f2eae838.jpeg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="Illustration showing how narrowed airway contributes to snoring" data-original="https://cdnfile.sspai.com/2024/09/30/article/8c88070ba77ec3753a0bd9c1f2eae838.jpeg?imageView2/2/format/webp"><figcaption>图源:<a href="https://www.mayoclinic.org/diseases-conditions/snoring/symptoms-causes/syc-20377694">Snoring - Mayo Clinic</a></figcaption></figure><p>我们关注打鼾,是因为打鼾作为一种现象,其背后有可能提示了一种睡眠相关呼吸障碍——阻塞性睡眠呼吸暂停(OSA, obstructive sleep apnea)。它是睡眠呼吸暂停(sleep apnea)的最常见类型。睡眠呼吸暂停的患者会在睡眠过程中反复停止和开始呼吸。如果这个暂停是因为气道被堵住了,比如太胖、生理结构长得不好、饮酒导致肌肉过度松弛等,那就是阻塞性的;如果这个暂停是因为大脑突然不再告诉呼吸肌需要运动了,那就是中枢性睡眠呼吸暂停(CSA)。</p><p>不管哪种类型什么原因,睡眠呼吸暂停都会导致患者血氧水平突降,为了活命,大脑只能短暂叫醒一下患者,睡眠质量必然因此大幅度下降。随之而来的就是白天困倦、起床头痛,甚至继发的心脑血管疾病等一系列问题。可以说,OSA,或者说睡眠相关呼吸障碍,已经给人们的生活带来了巨大的健康威胁。</p><p>那这病能治吗?能治。单就常见的 OSA 来说,治疗方案早就成熟了。</p><p>那问题出在哪儿呢?——确诊。</p><p>合理治病的前提是确诊有病。OSA 有一套相当完善的确诊方法,一个金标准,一个银标准,在上面提到的文章里我们也有详细介绍。金标准是多导睡眠监测(PSG),参数多,测得准,缺点是要在医院过夜,患者可能睡不着,而且检查价格高昂,不少潜在患者望价却步;银标准居家睡眠监测让患者可以不在医院就完成确诊,但还是要捆上包括体动仪在内的一堆设备,敏感的患者还是可能睡不着,数据也得拿回医院做二次分析。</p><figure class="image ss-img-wrapper"><img src="https://cdnfile.sspai.com/2024/09/30/article/b2ce4a07da725bb75e4506530211b3e0.jpeg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="undefined" data-original="https://cdnfile.sspai.com/2024/09/30/article/b2ce4a07da725bb75e4506530211b3e0.jpeg?imageView2/2/format/webp"><figcaption>PSG 检查 By <a href="https://en.wikipedia.org/wiki/Polysomnography#/media/File:Polysomnography_tester.jpg">邱鈺鋒</a> - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=58305846</figcaption></figure><p>这就导致了睡眠相关呼吸障碍患者常出现的两种状态:从未确诊,但靠他人的提醒得出了患病的结论,很有自我管理意识地用上了正压无创呼吸机;自己生活已经受到了严重影响,甚至出现了明显的并发症,却完全不知道这些毛病都是睡眠呼吸暂停所致。既难发现,又难确诊,这让睡眠呼吸暂停的确诊率和发病率长期不成比例。</p><p>也是因此,目前我们对睡眠监测的研究集中在零/低负荷睡眠监测设备上,争取用尽可能小的设备、尽可能少的睡眠影响完成 OSA 的确诊。但很可惜,这类设备都是<strong>没有诊断资质</strong>的,想要确诊,最终还是要跑一趟医院。</p><h2 id="ss-hId-2">Apple Watch 做了什么?</h2><p>由于智能手机和消费级智能穿戴设备已经是各式各样传感器的集合体,只要有一套合理的算法,即使达不到临床级的精确度,想借它们对用户的睡眠窥知一二,并非没有可能。</p><p>举个例子,在 Apple Watch 时代之前的睡眠监测 app 基本都走了一样的路子:它们会要求你把手机放在枕头边,并把 app 留在前台。这时,应用会收集来自陀螺仪、加速度计等传感器的数据,收集用户在床上运动带来的震动,根据开发的算法判断被测人处于怎样的睡眠时相。有的应用还会在某一时间段内抽取样本记录鼾声。</p><p>智能穿戴设备的加入让这些监测更精准,比如可以减少同床者的影响,还可以更有效地监测呼吸节律、心率等数据。一些更贴合生活的应用也随之诞生,比如根据算法推断的睡眠时相调整响铃或震动时间的智能闹钟,可以让用户更易被叫醒、更少起床气。</p><p>传感器和算法缺一不可。比如 Apple Watch 判断当前佩戴者睡眠时相的方法,就是靠内置的三轴加速度计捕获人眼难以察觉的细微运动,再把这些运动数据以每 30 秒一个周期的频率根据算法判断。这套算法的开发来自一场包括 858 名参与者、1171 夜多导睡眠监测(PSG)数据的开发试验,和额外 166 名参与者、299 夜的验证试验,最终得以让 Apple Watch 的使用者无需脑电也能获得大致的睡眠时相分布。</p><p>类似地,你可能也注意到 watchOS 11 引入了<a href="https://support.apple.com/zh-cn/guide/watch/apd15aa7ed96/watchos">夜间生命体征</a>功能。它包括呼吸频率(次/分)、血氧(%)、心率(次/分)、手腕温度(℃)、睡眠时长(min)等数据,有些更依赖新的传感器,比如 Apple Watch Series 8 才引入的温度传感器;有些靠的就是自家开发的新算法,把传感器探得的数据转换成某项指标的数值。</p><p>这次的呼吸紊乱(breathing disturbances)数据与睡眠呼吸暂停通知功能就属于后者。Apple Watch 的方案仍然基于内置的三轴加速度计。为了寻找呼吸紊乱指标(加速度计变化)与实际的睡眠呼吸暂停之间的关系,Apple 开展了一场比之前范围更广的试验。算法开发阶段包括 2160 名参与者,共 3936 夜居家/实验室 PSG 数据;算法验证阶段包括了额外 2542 名参与者,共 7220 夜数据。受试者涵盖不同程度睡眠呼吸暂停患者与正常人。最终得出的相关性可以由这张图代表:</p><figure class="image ss-img-wrapper"><img src="https://cdnfile.sspai.com/editor/u_/crt4c6lb34tbcb3ek710.png?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="Ohx2brvLIodMp5xc54GcuDhkn2d" data-original="https://cdnfile.sspai.com/editor/u_/crt4c6lb34tbcb3ek710.png?imageView2/2/format/webp"><figcaption>图源:<a href="https://www.apple.com/health/pdf/sleep-apnea/Sleep_Apnea_Notifications_on_Apple_Watch_September_2024.pdf">Apple</a></figcaption></figure><p>可以看出,加速度计的读数变化(ABC)与常规 PSG 中呼吸暂停事件发生时腹部束带动作(D)、口鼻气流量(E)两项的变化之间有规律可循。Apple Watch 最终采用的算法,就是检测符合这些规律的加速度变化并给出呼吸紊乱数据,在开始首次测量后每 30 天做一次评估,如果期间至少有 10 天有效数据,且有 50% 的数据高于正常值,就向佩戴者发送提醒,提示可能存在睡眠呼吸暂停。</p><h2 id="ss-hId-3">这个功能有什么意义?</h2><p>和发布会后的普遍猜测不大相同,Apple 对这项功能的设计是相对保守的。Apple Watch 设备本身不是医疗器械,一方面,传感器的监测精度和监测范围可能与临床医疗级的设备有一定差距,另一方面,它所收集的数据维度也比较有限,从不全面的数据直接得出诊断是不严谨、不科学的。所以 Apple 自己对这项功能的设计,限制在了「对尚未确诊睡眠呼吸暂停者的危险提示」,而非「帮有潜在风险的人自行诊断睡眠呼吸暂停」。它在 FDA 通过的批准也是「<a href="https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=K240929">评估睡眠呼吸暂停风险的非处方设备</a>」(Over-The-Counter Device To Assess Risk Of Sleep Apnea)。</p><figure class="image ss-img-wrapper"><img src="https://cdnfile.sspai.com/2024/09/30/0836e22c2d7dc0bc8954ab07dfdacea6.png?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" data-original="https://cdnfile.sspai.com/2024/09/30/0836e22c2d7dc0bc8954ab07dfdacea6.png?imageView2/2/format/webp"></figure><p>App 中采用了「呼吸紊乱」作为测量值。这并不是睡眠呼吸暂停的直接指标。在研究这一疾病时,通常有一个名为呼吸暂停低通气指数(AHI, apnea-hypopnea index)的指标,它表示每小时记录到呼吸暂停或低通气次数的平均值,通常认为 5~15 次为轻度睡眠呼吸暂停,15~30 次为中度,30 次以上为重度。这个概念中的「低通气状态」是有明确定义的,它要求单次气流降低事件超过 10 秒,且血氧出现 4% 或以上的下降。单纯由加速度变化算出的(疑似)呼吸紊乱显然达不到这一要求。在 Apple 给出的试验数据中,获得的呼吸紊乱数据对真实的 AHI 值有 91.4% 在可接受误差范围内,这个值不低,但毕竟不是 100%。</p><figure class="ss-imgRows ss-img-wrapper"><div class="ss-img-row-item"><img src="https://cdnfile.sspai.com/2024/09/30/503a3062c21d8f39f06f48cacbf5f779.jpg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="" data-original="https://cdnfile.sspai.com/2024/09/30/503a3062c21d8f39f06f48cacbf5f779.jpg?imageView2/2/format/webp"></div><div class="ss-img-row-item"><img src="https://cdnfile.sspai.com/2024/09/30/30fc5525d4358f499da78f8107747e7c.jpg?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="" data-original="https://cdnfile.sspai.com/2024/09/30/30fc5525d4358f499da78f8107747e7c.jpg?imageView2/2/format/webp"></div></figure><p>那为什么要单独开发一套算法呢?Apple Watch 不是早就有呼吸检测和血氧检测了吗?</p><p>确实有。但很明显,Apple Watch 是没有附赠呼吸面罩的,所以 Apple Watch 的呼吸数据本就是一个间接值,它是由心率检测功能使用的 PPG 传感器计算得来的。</p><p>这是个相当常见的传感器,有大量算法基于它的读数开发。在《<a href="https://sspai.com/post/74805">手腕上的「心率检测」靠谱吗?智能手表能帮你了解哪些数据?</a>》一文中,我们简单介绍过 PPG 传感器的原理和用处。三星 Galaxy Watch 的无绑带血压测量功能的就是依赖 PPG 传感器。同样地,血氧探测靠的也是 PPG 传感器,只不过用的是红光 LED。早在<a href="https://news.samsung.com/global/samsung-brings-sleep-apnea-feature-to-galaxy-watch-upon-approval-by-koreas-ministry-of-food-and-drug-safety">去年十月</a>,韩国食品药品安全部批准了 Galaxy Watch 5 代及以上表款使用三星健康监测器 app 发现睡眠呼吸暂停症状的应用,它采用的标准就是血氧值变化,用户只需十天内两次超过四小时的睡眠监测即可获得结果。</p><p>其实医院常用的血氧检测也是基于 PPG 的「间接」检测,毕竟不能隔几秒抽一回血跑个血气分析。具体的原理我们在《<a href="https://sspai.com/post/62778">科普 | Apple Watch Series 6 的血氧监测有什么用?</a>》中有过介绍。而与专业的指尖血氧计相比,智能手表表背与手腕的贴合程度、贴合位置、固定方法,比起皮肤更薄、固定更稳的夹子夹指尖,都要更差一些。这暂时还是所有类似穿戴设备共同面临的问题。未来随着算法和手表固定方式的进化,血氧或许也可能整合进对睡眠呼吸暂停的判定。</p><p>Apple Watch 选择的方案当然也会受到体位、夜间活动与佩戴的影响。Apple 的调整方案是尽可能降低假阳性率。在算法的临床验证研究中,算法发出的提醒对已有明确证据的中重度患者加权灵敏度(有病且收到提醒)达 66.3%,超过了预先设计的 50%;对轻度患者/正常人的加权特异性(正常且收不到提醒/轻度患病且收到提醒)达到 98.5%,也超过了预先设计的 85%。</p><figure class="image ss-img-wrapper"><img src="https://cdnfile.sspai.com/editor/u_/crt4c6tb34tbcb3ek71g.png?imageView2/2/w/1120/q/90/interlace/1/ignore-error/1/format/webp" alt="OZRYbnVSloXR7VxegeQc3fhJnlf" data-original="https://cdnfile.sspai.com/editor/u_/crt4c6tb34tbcb3ek71g.png?imageView2/2/format/webp"></figure><p>在报告中,Apple 强调了正常受试者的特异性达到了 100%,也就是说在共 1499 名参与者中,收到通知的受试者至少有轻度睡眠呼吸暂停。这意味着 Apple Watch 的这一功能,优先保证的是收到提醒的都该去看看,但不保证没收到提醒的就没问题。</p><p>那么,Apple Watch 开发这一功能的意义就很明显了。不像之前的房颤检测,这一功能最大的意义不在「病情监测」,而在于「发现问题」。PSG 测试麻烦、价贵的前提一时半会不会改变,也就是说,大部分潜在患者对自己的病情有觉察,还是要靠他人的提醒,以及对自己白天状态的感知。Apple Watch 的提醒,一方面可以帮独居者发现自己未经提醒的睡眠状态,另一方面,可以给明知有风险症状,却碍于各种原因没做检查、没咨询医生的潜在患者敲响警钟,在事情发展到影响其他方面健康之前亡羊补牢。</p><p><strong>关联阅读</strong></p><ul><li>Epstein LJ, Kristo D, Strollo PJ Jr, Friedman N, Malhotra A, Patil SP, Ramar K, Rogers R, Schwab RJ, Weaver EM, Weinstein MD; Adult Obstructive Sleep Apnea Task Force of the American Academy of Sleep Medicine. Clinical guideline for the evaluation, management and long-term care of obstructive sleep apnea in adults. <i>J Clin Sleep Med.</i> 2009 Jun 15;5(3):263-76. PMID: 19960649; PMCID: PMC2699173.</li><li>Gottlieb DJ, Punjabi NM. Diagnosis and Management of Obstructive Sleep Apnea: A Review. <i>JAMA.</i> 2020;323(14):1389–1400. doi:10.1001/jama.2020.3514</li><li>Abbasi A, Gupta SS, Sabharwal N, Meghrajani V, Sharma S, Kamholz S, Kupfer Y. A comprehensive review of obstructive sleep apnea. <i>Sleep Sci.</i> 2021 Apr-Jun;14(2):142-154. doi: 10.5935/1984-0063.20200056. PMID: 34381578; PMCID: PMC8340897.</li><li><a href="https://www.apple.com/healthcare/docs/site/Estimating_Sleep_Stages_from_Apple_Watch_Sept_2023.pdf">Estimating Sleep Stages from Apple Watch</a> - Apple</li><li><a href="https://www.apple.com/health/pdf/sleep-apnea/Sleep_Apnea_Notifications_on_Apple_Watch_September_2024.pdf">Estimating Breathing Disturbances and Sleep Apnea Risk from Apple Watch</a> - Apple</li><li><a href="https://www.hopkinsmedicine.org/health/conditions-and-diseases/obstructive-sleep-apnea">Obstructive Sleep Apnea</a> - John Hopkins Medicine</li><li><a href="https://sspai.com/post/62778">科普 | Apple Watch Series 6 的血氧监测有什么用?</a></li><li><a href="https://sspai.com/post/67629">打鼾:你熟悉的夜间惊雷,究竟是什么?</a></li><li><a href="https://sspai.com/post/74805">手腕上的「心率检测」靠谱吗?智能手表能帮你了解哪些数据?</a></li></ul><p>&gt; 关注&nbsp;<a href="https://www.xiaohongshu.com/user/profile/63f5d65d000000001001d8d4">少数派小红书</a>,感受精彩数字生活 🍃</p><p>&gt; 实用、好用的 <a href="https://sspai.com/mall">正版软件</a>,少数派为你呈现 🚀</p></div><div class="update__details__wrapper"><div id="update-0" class="update-details-item"><div><span class="update-date">以下内容于 10:00更新</span><div class="update-title">中国大陆推出睡眠呼吸暂停迹象提示功能</div></div><div class="update-body wangEditor-txt"><p>2026 年 10 月 14 日,Apple 在中国大陆正式推出 Apple Watch 睡眠呼吸暂停迹象提示功能,文章根据相关信息更新并重推。</p></div></div></div><!----></div></div></div><div class="article__footer article__section__wrapper"><div class="article__footer__tags"><a href="/tag/Apple%20Watch" class="article__footer__tag"><i class="ssCommunityIcon__topic"></i><span>Apple Watch</span></a><a href="/tag/%E5%81%A5%E5%BA%B7" class="article__footer__tag"><i class="ssCommunityIcon__topic"></i><span>健康</span></a></div><div class="article__footer__editor">
+ 本文责编:
+ <a href="/u/thebaldingken">
+ @北鸮
+ </a></div><div class="article__footer__copyright">
+ © 本文著作权归作者所有,并授权少数派独家使用,未经少数派许可,不得转载使用。
+ </div></div><div class="article__charge__card"><hr class="line article__section__wrapper"><div class="article__charge__card__inner article__section__wrapper"><button type="button" class="article__charge__card__icon"><span class="article__charge__card__icon__core"><i class="ssCommunityIcon__lightning--fill"></i></span></button><div class="article__charge__card__users"><div class="ss__portrait article__charge__card__avatar"><a href="/u/jog9j3g0/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2023/01/06/avatar/d8acc95377197e47c5711d1cb3144974.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="cbingwu"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/0a0gibbp/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/04/01/1bb76a69717652b9713058b3cebc232f.jpeg?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="HolaCola"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/huadan/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2024/11/29/01e419b537ec83d1248b3ea3f9d17aa8.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="ActorDan"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/4bpyihnj/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2023/04/27/avatar/900302f3c87c2d6c2fae39a842443017.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="Ian_w"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/a8ggrc4i/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png" alt="少数派14108655"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/rv2br3qs/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/04/13/avatar/f9f60d6c0979779af04706003176c9d1.jpeg?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="fuXee"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/3yz2j94o/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="少数派_1015083"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/QinRoc/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="QinRoc"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/atnug2ye/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="方游"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/lxl6h0z2/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="lghn"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/lht73vl0/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/08/01/avatar/0bad1cd9b1dd8d7b50b81dad8a8e1ab2.jpeg?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="冰冻大西瓜"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/b5c5p6hh/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/12/03/avatar/572470ac263b1a66454bcf10edf0936c.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="tbor1984"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/guidozeng/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/ui/otter_avatar_placeholder.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="guidozeng"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/skewcy/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2025/11/25/avatar/33264b25f68355d79f56e968799910b5.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="小雨姑娘"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/ye9vz81u/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png" alt="少数派72258233"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/q8wgfyo6/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/06/22/avatar/447e9c76fcf40dfecc0e0828cdd1006c.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="抹茶苹果"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/y1v7mt2f/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2024/10/07/avatar/c726b0732648546abecfefce4c95727b.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="felix3412"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/uh07fmmf/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2023/08/24/avatar/f312a1c03f166a1c24d36c51a4eb0687.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="meteorLiu"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/1ivk3fgh/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2021/04/28/avatar/a8df2ed4ec2d383fc99d7376becc79f0.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="银行搬砖的大羊驼"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/xdjhwhfq/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2025/07/14/avatar/d9b989890ff4000b4fdc6d3fbb256a6a.jpeg?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="SteveMeng"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/k8u4o9d4/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2023/04/08/avatar/80844f3780dc71979fc2c7b9662d4e57?imageMogr2/auto-orient/quality/90/ignore-error/1" alt="锡灵韵"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/a4tkq33m/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="猫痴渔"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/ywz1kdy4/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2024/10/11/avatar/92cd02e3953ce671fbe0205cee3b9a93.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="OffenheimerAS"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/bws0ao89/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="看着挺好玩"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/1qnnxdp6/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2024/05/24/avatar/4a20bdec9255b2762abcd0b0bf5f016b.?imageMogr2/auto-orient/quality/90/ignore-error/1" alt="walk"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/imgradeone/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2026/06/17/65bc4e0901a3743ab1f43c2cf9e6b023.jpg?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="自言者一么imgradeone"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/suh0dyga/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="骑东墙"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/michael/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/03/31/avatar/7a45ecd82b3b27a189e16a08e91565ba.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="老麦"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/hgta81l4/updates" class="ss__portrait__link"><img src="https://cdnfile.sspai.com/2022/06/17/avatar/4b3f92e3e157a0c313c80f8b68923772.png?imageMogr2/auto-orient/thumbnail/!64x64r/gravity/center/crop/64x64/format/webp/ignore-error/1" alt="mybluesky"> <!----></a> <!----></div><div class="ss__portrait article__charge__card__avatar"><a href="/u/rjsfnlxh/updates" class="ss__portrait__link"><img src="https://cdn-static.sspai.com/ui/otter_avatar_placeholder_240511.png" alt="少数派52456405"> <!----></a> <!----></div></div><p class="article__charge__card__count">42位派友已充电</p></div></div><!----></article></body></html>
diff --git a/apps/extension/fixtures/platforms/substack-article.html b/apps/extension/fixtures/platforms/substack-article.html
index 6a65b4e6..29b9039c 100644
--- a/apps/extension/fixtures/platforms/substack-article.html
+++ b/apps/extension/fixtures/platforms/substack-article.html
@@ -1 +1 @@
-<!doctype html><html><head><title>The Dot and the Swarm - by Ethan Mollick - One Useful Thing</title><link rel="stylesheet" href="https://substackcdn.com/bundle/theme/main.css"></head><body><h1>One Useful Thing</h1><article class="newsletter-post"><h1 dir="auto" class="post-title published title-X77sOw">The Dot and the Swarm</h1><h3 dir="auto" class="subtitle subtitle-HEEcLo">Benefitting from the Bitter Lesson</h3><div class="body markup"><p>I generally think I have done a good job anticipating the direction and pace of AI over the few years I have been writing this Substack, but I think I recently got something fairly large wrong. In the last year I have been posting about how I suspected that humans would have to approach working with agents as a manager, deciding how to delegate work to agents and specifying how those agents should be organized. I thought that getting agents to work effectively as a group would take careful construction, akin to building a company, and that this would take time to figure out.</p><p>Nope.</p><h1 class="header-anchor-post">Dots and Muse<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§dots-and-muse" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/dots-and-muse" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!u0Eq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 424w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 848w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1272w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png" width="232" height="406.7030303030303" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2314,&quot;width&quot;:1320,&quot;resizeWidth&quot;:232,&quot;bytes&quot;:1039551,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 424w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 848w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1272w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a></figure></div><p data-attrs="{&quot;url&quot;:&quot;https://co-existence.ai/&quot;,&quot;text&quot;:&quot;Pre-order my new book!&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton" class="button-wrapper"><a href="https://co-existence.ai/" class="button primary"><span>Pre-order my new book!</span></a></p><h1 class="header-anchor-post">Swarms<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§swarms" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/swarms" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!antz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!antz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 424w, https://substackcdn.com/image/fetch/$s_!antz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 848w, https://substackcdn.com/image/fetch/$s_!antz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1272w, https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png" width="1456" height="565" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:282060,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!antz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 424w, https://substackcdn.com/image/fetch/$s_!antz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 848w, https://substackcdn.com/image/fetch/$s_!antz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1272w, https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a><figcaption class="image-caption">Agents at work (but don’t worry, this is just an example, I come up with all my post ideas on my own, just like I write all the initial drafts myself, only asking for AI feedback when I am done)</figcaption></figure></div><h1 class="header-anchor-post">A Not-Entirely-Bitter Lesson<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§a-not-entirely-bitter-lesson" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/a-not-entirely-bitter-lesson" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><p><em><span>Also, a reminder that I have</span><a href="https://co-existence.ai/"> a new book, Co-Existence, coming out October 20</a><span>, and, if you are interested in reading or listening to it (I read the audiobook, a little too fast), you may want to pre-order, which both helps me as an author and gives you access to a very cool pre-order bonus.</span></em></p><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!Narw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Narw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 424w, https://substackcdn.com/image/fetch/$s_!Narw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 848w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1272w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png" width="624" height="349.7142857142857" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:816,&quot;width&quot;:1456,&quot;resizeWidth&quot;:624,&quot;bytes&quot;:1863988,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Narw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 424w, https://substackcdn.com/image/fetch/$s_!Narw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 848w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1272w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a></figure></div><div data-component-name="SubscribeWidget" class="subscribe-widget"><div class="pencraft pc-display-flex pc-justifyContent-center pc-reset"><div class="container-IpPqBD"><form action="/api/v1/free?nojs=true" method="post" novalidate="" class="form form-M5sC90"><div class="sideBySideWrap-vGXrwP"><div class="emailInputWrapper-QlA86j"><div class="pencraft pc-display-flex pc-minWidth-0 pc-position-relative pc-reset flex-auto-UL7Y7f"></div></div><button tabindex="0" type="submit" disabled="" class="pencraft pc-reset pencraft rightButton primary subscribe-btn button-VFSdkv buttonBase-GK1x3M"><span class="button-text ">Subscribe</span></button></div><div id="error-container"></div></form><div class="animationWrapper-QRL6aQ"></div></div></div></div><p data-attrs="{&quot;url&quot;:&quot;https://www.oneusefulthing.org/p/the-dot-and-the-swarm?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton" class="button-wrapper"><a href="https://www.oneusefulthing.org/p/the-dot-and-the-swarm?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share" class="button primary"><span>Share</span></a></p></div><div class="post-footer">Comments and recommendations</div></article></body></html>
\ No newline at end of file
+<!doctype html><html><head><title>The Dot and the Swarm - by Ethan Mollick - One Useful Thing</title><link rel="stylesheet" href="https://substackcdn.com/bundle/theme/main.css"></head><body><h1>One Useful Thing</h1><article class="newsletter-post"><h1 dir="auto" class="post-title published title-X77sOw">The Dot and the Swarm</h1><h3 dir="auto" class="subtitle subtitle-HEEcLo">Benefitting from the Bitter Lesson</h3><div class="body markup"><p>I generally think I have done a good job anticipating the direction and pace of AI over the few years I have been writing this Substack, but I think I recently got something fairly large wrong. In the last year I have been posting about how I suspected that humans would have to approach working with agents as a manager, deciding how to delegate work to agents and specifying how those agents should be organized. I thought that getting agents to work effectively as a group would take careful construction, akin to building a company, and that this would take time to figure out.</p><p>Nope.</p><h1 class="header-anchor-post">Dots and Muse<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§dots-and-muse" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/dots-and-muse" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!u0Eq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 424w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 848w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1272w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png" width="232" height="406.7030303030303" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2314,&quot;width&quot;:1320,&quot;resizeWidth&quot;:232,&quot;bytes&quot;:1039551,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!u0Eq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 424w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 848w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1272w, https://substackcdn.com/image/fetch/$s_!u0Eq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b1b1cec-f9a0-4945-80f4-19c32ec86f75_1320x2314.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a></figure></div><p data-attrs="{&quot;url&quot;:&quot;https://co-existence.ai/&quot;,&quot;text&quot;:&quot;Pre-order my new book!&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton" class="button-wrapper"><a href="https://co-existence.ai/" class="button primary"><span>Pre-order my new book!</span></a></p><h1 class="header-anchor-post">Swarms<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§swarms" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/swarms" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!antz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!antz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 424w, https://substackcdn.com/image/fetch/$s_!antz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 848w, https://substackcdn.com/image/fetch/$s_!antz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1272w, https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png" width="1456" height="565" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:282060,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!antz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 424w, https://substackcdn.com/image/fetch/$s_!antz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 848w, https://substackcdn.com/image/fetch/$s_!antz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1272w, https://substackcdn.com/image/fetch/$s_!antz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F092604f1-d651-47eb-82f4-261cc2b4e50e_2316x899.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a><figcaption class="image-caption">Agents at work (but don’t worry, this is just an example, I come up with all my post ideas on my own, just like I write all the initial drafts myself, only asking for AI feedback when I am done)</figcaption></figure></div><h1 class="header-anchor-post">A Not-Entirely-Bitter Lesson<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div id="§a-not-entirely-bitter-lesson" class="pencraft pc-reset header-anchor offset-top"></div><button tabindex="0" type="button" aria-label="Link" data-href="https://www.oneusefulthing.org/i/218255099/a-not-entirely-bitter-lesson" class="pencraft pc-reset pencraft iconButton-mq_Et5 iconButtonBase-dJGHgN buttonBase-GK1x3M buttonStyle-r7yGCK size_sm-G3LciD priority_secondary-S63h9o"></button></div></div></h1><p><em><span>Also, a reminder that I have</span><a href="https://co-existence.ai/"> a new book, Co-Existence, coming out October 20</a><span>, and, if you are interested in reading or listening to it (I read the audiobook, a little too fast), you may want to pre-order, which both helps me as an author and gives you access to a very cool pre-order bonus.</span></em></p><div class="captioned-image-container"><figure><a target="_blank" href="https://substackcdn.com/image/fetch/$s_!Narw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png" data-component-name="Image2ToDOM" class="image-link image2 is-viewable-img can-restack"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Narw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 424w, https://substackcdn.com/image/fetch/$s_!Narw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 848w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1272w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png" width="624" height="349.7142857142857" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:816,&quot;width&quot;:1456,&quot;resizeWidth&quot;:624,&quot;bytes&quot;:1863988,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.oneusefulthing.org/i/218255099?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Narw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 424w, https://substackcdn.com/image/fetch/$s_!Narw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 848w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1272w, https://substackcdn.com/image/fetch/$s_!Narw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3014425-47c2-47aa-848b-3528f4dc9517_2912x1632.png 1456w" sizes="100vw" loading="lazy" class="sizing-normal"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"></button></div></div></div></a></figure></div><div data-component-name="SubscribeWidget" class="subscribe-widget"><div class="pencraft pc-display-flex pc-justifyContent-center pc-reset"><div class="container-IpPqBD"><form action="/api/v1/free?nojs=true" method="post" novalidate="" class="form form-M5sC90"><div class="sideBySideWrap-vGXrwP"><div class="emailInputWrapper-QlA86j"><div class="pencraft pc-display-flex pc-minWidth-0 pc-position-relative pc-reset flex-auto-UL7Y7f"></div></div><button tabindex="0" type="submit" disabled="" class="pencraft pc-reset pencraft rightButton primary subscribe-btn button-VFSdkv buttonBase-GK1x3M"><span class="button-text ">Subscribe</span></button></div><div id="error-container"></div></form><div class="animationWrapper-QRL6aQ"></div></div></div></div><p data-attrs="{&quot;url&quot;:&quot;https://www.oneusefulthing.org/p/the-dot-and-the-swarm?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton" class="button-wrapper"><a href="https://www.oneusefulthing.org/p/the-dot-and-the-swarm?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share" class="button primary"><span>Share</span></a></p></div><div class="post-footer">Comments and recommendations</div></article><script type="application/ld+json">{"@type":"NewsArticle","url":"https://www.oneusefulthing.org/p/the-dot-and-the-swarm","headline":"The Dot and the Swarm","author":[{"name":"Ethan Mollick"}],"datePublished":"2026-10-01T18:54:12+08:00"}</script></body></html>
\ No newline at end of file
diff --git a/apps/extension/fixtures/platforms/substack-paywall.html b/apps/extension/fixtures/platforms/substack-paywall.html
new file mode 100644
index 00000000..9ded9637
--- /dev/null
+++ b/apps/extension/fixtures/platforms/substack-paywall.html
@@ -0,0 +1 @@
+<!doctype html><html><head><title>How to build AI product sense - by Tal Raviv and Aman Khan</title><link rel="stylesheet" href="https://substackcdn.com/bundle/main.css"></head><body><article class="typography newsletter-post post"><div class="post-header"><div class="pencraft pc-paddingBottom-8 pc-reset"></div><h1 class="post-title published title-X77sOw">How to build AI product sense</h1><h3 class="subtitle subtitle-HEEcLo">The secret is using Cursor for non-technical work (inside: 75 free days of Cursor Pro to try this out!)</h3><div class="pencraft pc-display-flex pc-flexDirection-column pc-paddingBottom-16 pc-reset"><div class="pencraft pc-display-flex pc-paddingTop-16 pc-paddingBottom-16 pc-justifyContent-space-between pc-alignItems-center pc-reset"><div class="pencraft pc-display-flex pc-gap-12 pc-alignItems-center pc-reset byline-wrapper"><div class="pencraft pc-display-flex pc-reset"><div class="pencraft pc-display-flex pc-flexDirection-row pc-gap-8 pc-alignItems-center pc-justifyContent-flex-start pc-reset"><div class="pencraft pc-display-flex pc-flexDirection-row pc-alignItems-center pc-justifyContent-flex-start pc-reset ltr-qDBmby"><span><a href="https://substack.com/@talsraviv" class="pencraft pc-display-contents pc-reset"><div class="pencraft pc-display-flex pc-width-36 pc-height-36 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f animate-vY_IWG outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM pressable-sm-elJLHF showFocus-xAetgz container-TAtrWj interactive-UkK0V6 avatar-u8q6xB"><div class="pencraft pc-display-flex pc-width-36 pc-height-36 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM container-TAtrWj"><picture><img class="img-OACg1c object-fit-cover-u4ReeV pencraft pc-reset" src="https://substackcdn.com/image/fetch/$s_!Sp2z!,w_36,h_36,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7ebe7e6-cd97-479f-95a8-c19fc3ae402c_664x664.jpeg" alt="Tal Raviv's avatar"></picture></div></div></a></span><span><a href="https://substack.com/@amankhan1" class="pencraft pc-display-contents pc-reset"><div class="pencraft pc-display-flex pc-width-36 pc-height-36 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f animate-vY_IWG outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM pressable-sm-elJLHF showFocus-xAetgz container-TAtrWj interactive-UkK0V6 avatar-u8q6xB overlap-q75iOo last-JfNEJ_"><div class="pencraft pc-display-flex pc-width-36 pc-height-36 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM container-TAtrWj"><picture><img class="img-OACg1c object-fit-cover-u4ReeV pencraft pc-reset" src="https://substackcdn.com/image/fetch/$s_!XLkV!,w_36,h_36,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2babe551-c5b2-4c0f-8c1a-d493518832d5_1203x1203.jpeg" alt="Aman Khan's avatar"></picture></div></div></a></span></div></div></div><div class="pencraft pc-display-flex pc-flexDirection-column pc-reset"><div class="pencraft pc-reset color-primary-ECDxTd line-height-20-_MEacI font-meta-Wq5ZQP size-11-gJkq5q weight-medium-Hv9lSX transform-uppercase-LYgH6s reset-PDs18X meta-SjvJkP"><span><a class="pencraft pc-reset decoration-hover-underline-zSXGjA reset-PDs18X" href="https://substack.com/@talsraviv">Tal Raviv</a></span> and <span><a class="pencraft pc-reset decoration-hover-underline-zSXGjA reset-PDs18X" href="https://substack.com/@amankhan1">Aman Khan</a></span></div><div class="pencraft pc-display-flex pc-gap-4 pc-reset"><div class="pencraft pc-reset color-secondary-B3TpYa line-height-20-_MEacI font-meta-Wq5ZQP size-11-gJkq5q weight-medium-Hv9lSX transform-uppercase-LYgH6s reset-PDs18X meta-SjvJkP"><time datetime="2026-02-03T13:45:58.303Z">Feb 03, 2026</time></div><div class="pencraft pc-reset color-secondary-B3TpYa line-height-20-_MEacI font-meta-Wq5ZQP size-11-gJkq5q weight-medium-Hv9lSX transform-uppercase-LYgH6s reset-PDs18X meta-SjvJkP">∙ Paid</div></div></div></div></div><div class="pencraft pc-display-flex pc-gap-16 pc-justifyContent-space-between pc-alignItems-center pc-reset flex-grow-hUPOlM post-ufi"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><div class="like-button-container post-ufi-button style-button"></div></div><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></div><div class="visibility-check"></div><div><div class="dt-post-body"><div class="available-content"><div class="body markup"><p><em><span>👋 Hey there, I’m Lenny. Each week, I answer reader questions about building product, driving growth, and accelerating your career. For more: </span><a href="https://www.lennysnewsletter.com/podcast">Lenny’s Podcast</a><span> | </span><a href="https://www.youtube.com/@howiaipodcast">How I AI</a><span> | </span><a href="https://www.lennybot.com/">Lennybot</a><span> | </span><a href="https://maven.com/lenny">Favorite AI and PM courses</a><span> | </span><a href="https://ultraspeaking.com/lennyslist?via=lenny">Favorite public speaking course</a></em></p><div class="subscribe-widget"><div class="pencraft pc-display-flex pc-justifyContent-center pc-reset"><div class="container-IpPqBD"><div class="animationWrapper-QRL6aQ"></div></div></div></div><p><em><span>P.S. </span><strong><a href="https://www.lennysnewsletter.com/subscribe?plan=founding">Insider subscribers</a><span> get a free year</span></strong><span> of </span><a href="https://www.lennysnewsletter.com/p/productpass">Lovable, Manus, Replit, Gamma, n8n, Canva, ElevenLabs, Amp, Factory, Devin, Bolt, Wispr Flow, Linear, PostHog, Framer, Railway, Granola, Warp, Perplexity, Magic Patterns, Mobbin, ChatPRD, and Stripe Atlas</a><span>. Yes, this is for real. </span><strong><a href="https://lennysproductpass.com/">Learn more</a><span>.</span></strong></em></p><div><hr></div><p>The post you’re about to read took over 100 hours to create. That’s because it’s not a post. It’s an open-source interactive AI experience that will help you build AI product sense. Tal and Aman ran dozens of usability sessions, wrote evals, optimized each prompt you’ll find below, and even partnered with Cursor to get you free credits (see below!) so that you can try this at home. I’ve never seen anything like what they’ve put together, and I’m excited to bring it to you.</p><p>Next week, in part two of this series, you’ll learn how to take this newfound AI intuition and apply it to your own product.</p><p><em><span>For more from Tal and Aman, check out their in-depth workshop </span><a href="https://bit.ly/4k8CLBp">Build AI Product Sense</a><span> (starting next week, get 15% off using this link) and their upcoming free Lightning Lesson </span><a href="https://maven.com/p/593d71/how-to-know-what-ai-products-to-build">How to Know What AI Products to Build</a><span>, in partnership with my one of my other favorite collaborators, </span><a href="https://www.linkedin.com/in/hilarygridley">Hilary Gridley</a><span>. You can also book Tal and Aman for a </span><a href="https://buildaiproductsense.com/">build sprint with your team</a><span>.</span></em></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!TIEN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffce07243-d494-4f0a-b65b-3f70f90c987e_1456x970.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!TIEN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffce07243-d494-4f0a-b65b-3f70f90c987e_1456x970.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>You’re in a product meeting and someone mentions “subagents” or “context engineering” or “agent memory.” You nod along. You know what these terms mean . . . you’re just hoping no one expects you to use them in a sentence.</p><p>You’ve watched the video explainers, bookmarked the infographics, vibe coded a few apps, and even shipped an AI feature. So why does it still feel like you’re miles from truly understanding all this stuff?</p><p>We (Tal and Aman) have both been there, over and over again while building AI products for tens of thousands of customers. The problem isn’t you. The problem is the “AI hype industrial complex.” Most AI content is designed to induce FOMO, not to teach: “This model is INSANE” posts, demos that hide the messy reality, and diagrams that complicate more than they explain.</p><p><strong>We found that the single most transformative habit to internalize important AI concepts was to move away from consumer-grade UIs (ChatGPT, Granola, Lovable) and into more powerful AI coding agents like Cursor and Claude Code. </strong><span>Getting our hands dirty with coding agents has helped us build our “AI product sense”—the ability to correctly anticipate what will be truly impactful for users and also feasible with AI.</span></p><p>AI product sense is encountering support tickets about AI “forgetting” facts and recognizing it as context rot. Or watching a user struggle through a workflow and confidently saying that agent memory solves this—and knowing how to restructure the experience.</p><p>We’ve learned more about how AI products actually work in the past three months by using Cursor for daily, non-technical tasks than in three years of using ChatGPT. This is because coding agents transparently show their work. You can read AI’s reasoning, inspect the tool calls, and watch the context window fill up. You hit the same walls as engineers building AI applications, naturally intuit your own solutions, and start anticipating trends and industry announcements.</p><p>We now spend our days using Cursor and Claude Code for daily work: strategy, prioritization, decision-making, data analysis, and productivity. They serve as our thinking partner and personal operating system.</p><p>In this post, we’ll guide you through using AI coding agents for your non-technical product work:</p><ul><li><p><span>In steps 1-4 we’ll </span><strong>get set up and familiar with Cursor</strong><span> with a fun Disney-themed exercise</span></p></li><li><p><span>In steps 5-6 we’ll </span><strong>use Cursor to get hands-on with choosing AI models and calling tools</strong></p></li><li><p><span>In steps 7-10, </span><strong>we’ll build a lightweight personal OS</strong><span> (i.e. your own AI product you can use daily) and then improve it with RAG, memory, and context engineering</span></p></li></ul><p><span>You’ll walk away with the confidence to anticipate the technology instead of chasing it and, as a bonus, a personal AI operating system. </span><strong>Together we’ll build our AI product sense.</strong></p><h3 class="header-anchor-post"><strong>Step 1: Download Cursor</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-1-download-cursor"></div></div></div></h3><p>Cursor is hands-down the best coding agent to most quickly ramp up your AI product sense.</p><p><span>You’re probably hearing about Claude Code all over, and we love it for delegating long-running independent tasks like vibe coding. Cursor is still our favorite for </span><em>pairing</em><span> with AI and being able to directly watch an AI agent at work.</span></p><p>Cursor is a visual, clickable user experience and can be used with a variety of AI model providers, including OpenAI and Anthropic. That means you can very likely use it at work.</p><p><span>Downloading Cursor will take you two minutes. </span><strong>Do it right now!</strong></p><p><span>1. </span><a href="https://cursor.com/download">Download and install Cursor</a><span>. </span><strong>For this post, make sure to download and install the desktop app, not the web version of Cursor.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!ZcpK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9709a39-2656-47b6-91fa-dd92836122cf_1274x402.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!ZcpK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9709a39-2656-47b6-91fa-dd92836122cf_1274x402.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><h3 class="header-anchor-post"><strong>Step 2: Create a new project</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-2-create-a-new-project"></div></div></div></h3><p>Open Cursor, sign up, power through the onboarding flow, and click “Open project.”</p><p><em><span>If you’ve already used Cursor before, click </span><strong>File &gt; New Window</strong><span> to get to this screen and open a new project.</span></em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!NJ7-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26ccbf7c-c12c-4951-ae14-d12cee57b77e_1552x548.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!NJ7-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26ccbf7c-c12c-4951-ae14-d12cee57b77e_1552x548.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>Click “New Folder”:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!i3m5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f722678-7601-4402-806a-5d63c07e30f7_1600x808.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!i3m5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f722678-7601-4402-806a-5d63c07e30f7_1600x808.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>Name it “Build AI Product Sense” and click “Create”:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!e9lF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0db2d0-a708-4e1d-b15f-4022a0d35cf4_1600x811.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!e9lF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d0db2d0-a708-4e1d-b15f-4022a0d35cf4_1600x811.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>And finally, click “Open” (yes, it’s unusual to click Open on an empty folder, but just do it, it’ll work):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!zJuR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F316886e1-b566-425b-920b-963fc9bcad78_1600x811.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!zJuR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F316886e1-b566-425b-920b-963fc9bcad78_1600x811.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><h3 class="header-anchor-post"><strong>Step 3: Continue this post inside Cursor</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-3-continue-this-post-inside-cursor"></div></div></div></h3><p><span>Strap in, because you’re going to continue the experience inside Cursor itself, inspired by the children’s science show </span><em><a href="https://www.youtube.com/watch?v=-azpNkFZs1Q">The Magic School Bus</a></em><span>.</span></p><p><em>If you don’t have time to ride the Magic School Bus right now, you can keep reading below. However, to build your AI product sense, we recommend you come back and try continuing this post inside Cursor using the prompt below.</em></p><p>Make sure you’re in “Agent” mode. This allows Cursor to take actions (such as fetching this post from the internet).</p><div class="captioned-image-container"><figure><div class="image-link image2 can-restack"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!ft_3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe773ec37-e48a-4e31-8464-691392392c94_474x320.png" class="sizing-normal" alt=""></picture><div></div></div></div></figure></div><p><span>In the “model” dropdown, turn off “auto” and select </span><em>Opus 4.5 </em><span>🧠:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!cNRI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd2ce8e-ccaf-4f7b-a93f-b77dbb73b6c2_916x816.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!cNRI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd2ce8e-ccaf-4f7b-a93f-b77dbb73b6c2_916x816.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><h1 class="header-anchor-post"><strong>🎁 Side note: We’re hooking you up with free Cursor credits 🎁 </strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§side-note-were-hooking-you-up-with-free-cursor-credits"></div></div></div></h1><p><span>To help you experience the full power of this tutorial, we’re hooking up Lenny’s Newsletter subscribers with $50 in free Cursor credit. This is enough to get you 2.5 months of standard usage. A huge thank-you to </span><a href="https://x.com/benln?lang=en">Ben Lang</a><span> and team Cursor for making this happen. Note: Supplies are limited, so we may run out of free codes. Act fast.</span></p><p><strong>How to grab your free Cursor credits:</strong></p><p><span>1. Visit </span><a href="http://cursor.com/dashboard">Cursor.com/dashboard</a><span> and sign up for an account.</span></p><p><span>2. </span><a href="https://www.lennysnewsletter.com/subscribe">Become an annual (or Insider) Lenny’s Newsletter subscriber</a><span>.</span></p><p><span>3. </span><a href="http://lennysproductpass.com">Claim your free Cursor code</a><span> (scroll to the bottom to find Cursor), click the button to redeem your code, and you’ll see the screen below:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!2FaO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6126c0c9-7a9a-4e5a-825f-834b7b2469ff_836x872.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!2FaO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6126c0c9-7a9a-4e5a-825f-834b7b2469ff_836x872.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>4. Click “Get Started” to apply the credits to your account. [</span><em>Credits can be redeemed with both free and paid accounts.</em><span>]</span></p><p><span>5. Once you’ve redeemed the credits, you should see this box appear in your Cursor dashboard. [</span><em><span>If you don’t see the credits, try to hard-refresh, or log out and log back in. If that doesn’t work, shoot a message to </span><a href="mailto:[email protected]">[email protected]</a><span> and mention this post.</span></em><span>]</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!UUaY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b95c734-db6f-4cfa-862c-ac09f3ffa5e1_1144x288.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!UUaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b95c734-db6f-4cfa-862c-ac09f3ffa5e1_1144x288.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>6. Finally, you’ll need to upgrade to the Pro (or higher) plan to use the latest AI models, like Opus 4.5. If you’re already on the Pro or higher plan, you’re all set.</p><div class="captioned-image-container"><figure><div class="image-link image2 can-restack"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!S0Qw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2be55fdc-a167-46b4-beae-a365b3962a11_1600x290.png" class="sizing-normal" alt=""></picture><div></div></div></div></figure></div><p><span>Once you see the credits in your Dashboard, go ahead and upgrade. You won’t be charged anything (you have 2.5 months’ worth of credits). The credits will be automatically applied to the next invoice (and can also be applied to “</span><a href="https://cursor.com/docs/account/pricing#what-happens-when-i-reach-my-limit">on-demand usage</a><span>” if you enable it).</span></p><p>It should look like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!IdYT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F698102ba-dc7d-4740-baf0-6cca619d2c9e_936x1192.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!IdYT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F698102ba-dc7d-4740-baf0-6cca619d2c9e_936x1192.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><h3 class="header-anchor-post"><span>Now, paste the prompt below into the Cursor chat box (or </span><a href="https://cursor-product-sense-41dzkzjwo-lenny-lennyrachits-projects.vercel.app/">just click this link</a><span>):</span><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§now-paste-the-prompt-below-into-the-cursor-chat-box-or-just-click-this-link"></div></div></div></h3><blockquote><p><code>Help me build my AI product sense using this post (that I have not yet read): https://buildaiproductsense.com/magicschoolbus. (Do not open it in a browser — that will be distracting — use cURL or any other tool.)</code></p><p><code>Start by giving me an overview of why we’re here and where we’re going with this, so I feel super-motivated to stick with it. Then pause and confirm I’m ready to start. Use the pause to learn more about my professional context (less about Cursor or AI) that could inform our journey together.</code></p><p><code>Next, walk me through each bite-size concept, in order, one step/question at a time, starting with “Step 3.”</code></p><p><code>You are both a really good 1-1 tutor for hands-on learning AND the Cursor agent. Have me take action so I’m engaged and learning. Ask me one question at a time. Before starting new steps/stages/ideas/concepts, stop and check in with me and encourage me to explain it back to you — and hold me to a high bar — like an effective, empathetic tutor.</code></p><p><code>It’s important that you cover every single concept contained in this post, in sequential order. Keep me motivated by signposting and giving clarity on how much we’ve done and how much is left. (That said, leave room to follow my curiosity and go off script, as long as overall we are progressing through the post.)</code></p><p><code>Use the original words of the post when relevant (you have permission to use them as your words in first person, rather than explicitly quoting someone else). Sentence-case your headings (not title case).</code></p><p><code>Anytime you come across an image inline in the post, read the image (one at a time, just in time, not in advance, storing temporarily if needed). This is important to understand the contents of the post.</code></p><p><code>We are already talking inside a Cursor chat thread, so let’s use this same thread for as much as we can. Important: You are also the Cursor agent! So when I say a prompt that you suggested, or give a task like “change this file,” act on it yourself (don’t direct me to do it separately or ask if I did it separately). Don’t refer to a separate Cursor agent. It’s YOU.</code></p><p><code>Remember that Cursor might be configured in a lot of different ways visually and is constantly evolving, so avoid assumptions about where a UI element might be. The file explorer may be on the left or the right.</code></p><p><code>Anytime you try to use a tool of any kind, it’s going to ask for my approval, and that’s going to feel scary. So I need you to explain why you’re asking and why it’s safe to approve. It might even be a teachable moment — you can tie to the goal of the post (and where we are in the journey) that, well, you’re an agent and this is you in action!</code></p><p><code>Consistently encourage me to use the voice recording feature (a 🎙️ icon under the chat box) to build the habit of speech-to-text.</code></p></blockquote><p>And click “submit”:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!4dD9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7527b4af-ab39-48fb-89c3-efe1b320f419_458x275.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!4dD9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7527b4af-ab39-48fb-89c3-efe1b320f419_458x275.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>If you choose to accept this challenge, you’ll consume the rest of this post from inside Cursor.</span><strong> Stay in one chat thread (“agent”) the entire time (no need to open a new thread or agent).</strong></p><p>AI will walk you through the rest of this post. Seatbelts, everyone! We’ll see you in Cursor.</p><h3 class="header-anchor-post"><strong>Step 3: Cursor may look intimidating, but you’re more familiar with it than you realize</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-3-cursor-may-look-intimidating-but-youre-more-familiar-with-it-than-you-realize"></div></div></div></h3><p><span>Cursor looks </span><em>Matrix</em><span>-style geeky, but it’s just ChatGPT, a text editor, and a file explorer smooshed into one window.</span></p><p><strong>We repeat, Cursor is just three tools you’ve used plenty of times before, combined:</strong></p><ol><li><p>ChatGPT</p></li><li><p>A text editor</p></li><li><p>File explorer</p></li></ol><p>One of Tal’s students, a salesperson, said it best: Cursor is “AI that can touch any file on my computer.”</p><p>Here’s a quick tour:</p><p><strong>1. Agents</strong></p><p>Agents are a fancy term for “chats.” This is where you’ll interact with AI.</p><p>On the left, you’ll see an empty panel that will contain your agent history. Click “new agent” to start your first chat (“agent” is synonymous with “chat thread”):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!rEYv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc4af069-801b-4a38-988e-01b18cbbae42_1600x1041.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!rEYv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc4af069-801b-4a38-988e-01b18cbbae42_1600x1041.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>You’ll see a familiar chat box. Click on the dropdown in the bottom left corner. You can select between “Ask” mode and “Agent” mode (ignore the other options, like Plan and Debug, for now).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!ntD7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f974e29-d1e4-4145-b9e3-d3a195c1cbf9_834x710.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!ntD7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f974e29-d1e4-4145-b9e3-d3a195c1cbf9_834x710.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>“Ask” mode is using Cursor just like classic ChatGPT: for chatting, and not making any changes. This is great for brainstorming or asking questions, before taking any action. You can immediately start using this instead of standard ChatGPT/Claude.</p><p>“Agent” mode is for when we want Cursor to modify files in our project. We’ll use this together in a moment.</p><p><strong>2. Editor</strong></p><p>We’ll use this panel to view and manually edit text files. This is the same as using Text Edit on a Mac or Notepad on Windows. To see the text editor, you might have to create a new file or double-click on an existing file.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!7prF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d94cdc-1542-44e3-8f3d-d31b58b463f8_1600x1097.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!7prF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29d94cdc-1542-44e3-8f3d-d31b58b463f8_1600x1097.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><strong>3. File explorer</strong></p><p>The file explorer shows all the files and folders in your project. This is the same as Finder on a Mac or File Explorer on Windows, and it may be on the right or left of Cursor depending on the latest version. To expand it, you might have to click the small icon at the top of the window to make it visible. (You can always use Ctrl + B on Windows or Cmd + B on a Mac.)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!Ks6t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fed0b80-5426-4f9d-bfa8-519aa4b28aeb_1600x1108.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!Ks6t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5fed0b80-5426-4f9d-bfa8-519aa4b28aeb_1600x1108.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>Even if Cursor feels intimidating at first, the </span><a href="https://www.lennysnewsletter.com/p/build-your-personal-ai-copilot">core concepts</a><span> are the same as with any LLM you’ve already used. Cursor just has a bit more configurability, options, and things you can play with. This is your playground to build intuition.</span></p><h4 class="header-anchor-post">Cursor is our choice for getting real work done, not just learning AI concepts<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§cursor-is-our-choice-for-getting-real-work-done-not-just-learning-ai-concepts"></div></div></div></h4><p><span>If you’ve already </span><a href="https://www.lennysnewsletter.com/p/build-your-personal-ai-copilot">created your AI thinking partner</a><span> inside ChatGPT or Claude projects, you’re probably wondering if it’s worth the hassle of switching to Cursor. It’s important for us to say that regardless of understanding technical concepts, we now spend most of our days in coding agents for non-technical tasks.</span></p><p>So what’s the practical difference, and why did we make the switch? First, Cursor is fundamentally the same idea as ChatGPT projects: files as knowledge, chat as interface, and instructions that always apply.</p><p>Two small form-factor differences change everything:</p><ul><li><p>You drag and drop specific files/folders into each chat (selective context)</p></li><li><p>The AI edits your files directly (malleable knowledge)</p></li></ul><p>These create a tight loop where every chat automatically improves your project knowledge (but only when you tell the agent to do so). In ChatGPT projects, history and outputs live in long chats. You manually copy things back to project knowledge. In Cursor, outputs live in documents and chats become disposable one-offs because the value lives in documents, not in conversation history.</p><p>The main takeaway here is that your knowledge base will cover more ground, and update more frequently, because you’re using the personal OS to build and edit context every single day.</p><h3 class="header-anchor-post"><strong>Step 4: Create a Disney song parody to learn the basics of Cursor</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-4-create-a-disney-song-parody-to-learn-the-basics-of-cursor"></div></div></div></h3><p>We’ll start by creating a new blank file in Cursor. Hover your mouse in the file explorer, and click the “New File” button:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!SR1F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faedcd2e3-5209-4e61-aa75-47f54f30ec88_733x552.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!SR1F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faedcd2e3-5209-4e61-aa75-47f54f30ec88_733x552.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>Name your file </span><strong>lyrics.txt</strong><span>:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!RMUG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff46c0097-f4ee-4677-aa83-89df1bb6a5ca_758x663.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!RMUG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff46c0097-f4ee-4677-aa83-89df1bb6a5ca_758x663.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>Next, search the web for your </span><a href="https://www.google.com/search?q=youre+welcome+lyrics">favorite Disney song</a><span> (googling the title usually prints the lyrics). Copy the words to your clipboard:</span></p><div class="captioned-image-container"><figure><div class="image-link image2 can-restack"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!dXDE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3843502-e6a4-4bb8-ab3b-2761ea0e9cdf_964x176.png" class="sizing-normal" alt=""></picture><div></div></div></div></figure></div><p>Back in Cursor, paste them into the file you just created, and save the file:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!IeDW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eba6716-a690-42f4-a771-dd774bf8701f_1600x1041.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!IeDW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0eba6716-a690-42f4-a771-dd774bf8701f_1600x1041.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>Next, switch to “Agent” mode in the chat box:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!BQBt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8401b0e-1413-4a8b-8684-b1a714e9671e_1600x1041.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!BQBt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff8401b0e-1413-4a8b-8684-b1a714e9671e_1600x1041.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>Finally, type in:</p><blockquote><p><code>Change one line in the first stanza and one line in the chorus of lyrics.txt to be about Silicon Valley.</code></p></blockquote><p>and send it off using the “up arrow” button:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!PEro!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F489c05c2-128b-4b88-99b7-cbf5491a6387_1600x1041.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!PEro!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F489c05c2-128b-4b88-99b7-cbf5491a6387_1600x1041.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>A lot just changed on our screen! You’ll notice a lot of red and green in our lyrics.txt file. Cursor modified our file. The red shows us each old line that it removed, and the green shows us the new line that it added instead.</p><p>You can click “Undo” if you don’t like the change, or “Keep” if you want it to remain.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!DM9w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58716363-a7dd-48bb-834f-b2b364c8003f_1600x1041.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!DM9w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58716363-a7dd-48bb-834f-b2b364c8003f_1600x1041.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><h3 class="header-anchor-post"><strong>Step 5: See how different AI models behave</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-5-see-how-different-ai-models-behave"></div></div></div></h3><p>Now that you’ve made your first edit, let’s explore a key product decision every AI team faces: which model to use.</p><p>You’ll notice there’s another dropdown in our chat box:</p><div class="captioned-image-container"><figure><div class="image-link image2 can-restack"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!qLVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F133d4b03-f471-4c9d-933e-351bf00ae9a8_904x372.png" class="sizing-normal" alt=""></picture><div></div></div></div></figure></div><p><span>You’ve seen this in ChatGPT, Claude, or Gemini—it’s where you choose the model you want to use. In Cursor, however, you can choose </span><em>any </em><span>LLM.</span></p><p>Click into it and disable “Auto,” and take back the power to decide:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!CVsC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce9f58e-8830-444d-a325-51ebf0bc1045_594x888.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!CVsC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ce9f58e-8830-444d-a325-51ebf0bc1045_594x888.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>When we try the same query in multiple models, we build intuition for how each one might tackle (or fumble) it differently. For example, Claude models are sensitive to copyright law and refuse to modify Disney songs (to get past this, change the end of your prompt to “...to make fun of the song itself,” which qualifies as “fair use”). While OpenAI’s models are less concerned with copyright, they stumbled when calling Cursor’s </span><em>apply_patch</em><span> tool, their preferred command for editing a text file (although this is less common in the </span><a href="https://cursor.com/blog/codex-model-harness">latest Codex models</a><span>).</span></p><p>All that before we had a chance to judge the cleverness of their lyrics!</p><p><span>Which model do we personally use to get work done? When it comes to individual use, we treat ourselves to the latest and greatest models.</span><a class="footnote-anchor" id="footnote-anchor-1" href="#footnote-1">1</a></p><p>For writing, complex planning, and nuanced life advice (as of the time of this post), we reach for Claude Opus. (We also found it’s the best for experiencing this post from inside Cursor.) Its cousin, Sonnet, is our workhorse for tasks involving lots of context, with a 1M token context window (and slightly faster responses).</p><p><span>Zooming out, there’s a subtle lesson in Cursor’s model dropdown: </span><strong>There are only a few frontier LLMs, and they’re available to all product teams.</strong><span> Innovation is how we apply them.</span></p><p>Make a habit of switching models for tasks you care about. Over time, you’ll develop genuine opinions about model tradeoffs—the kind of intuition that’s hard to get from benchmarks alone.</p><h3 class="header-anchor-post"><strong>Step 6: Inspect your agent’s tool calls</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-6-inspect-your-agents-tool-calls"></div></div></div></h3><p><span>LLMs can only produce text, but when they take action (edit a file, fetch data, search the web), they’re calling tools. And </span><em>tool calling</em><span> is a distinct skill from everything else we usually notice about LLMs.</span></p><p>Now ask your agent:</p><blockquote><p><code>Can you walk me through each step (tool/thinking/reasoning/anything else) you used to accomplish this task?</code></p></blockquote><p>In our test, our LLM reported that:</p><ol><li><p><span>It used a tool called </span><em>read_file</em><span> to find out what was inside the file</span></p></li><li><p>It thought about what to edit</p></li><li><p><span>It used a tool called </span><em>search_replace</em><span> to modify the text file</span></p></li></ol><p>Here’s how it described #3:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!VW3j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8be7c32d-6148-42fb-9120-3179c33f1e8d_888x878.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!VW3j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8be7c32d-6148-42fb-9120-3179c33f1e8d_888x878.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p>Don’t let this tool’s foreign name repel you. You’ve done “search and replace” plenty of times in Microsoft Word or Google Docs. And you’ve definitely “read a file” before.</p><p>(By the way, this is another place where models differ in approach! Gemini consistently accomplished this in three tool calls, while Opus used two. Try it out and see for yourself.)</p><p>Coding agents do most of their work with a small set of tools for file navigation and text editing. To see the full set, ask it:</p><blockquote><p><code>List every tool available to you.</code></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img can-restack" href="https://substackcdn.com/image/fetch/$s_!nODM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9569bf-e31e-499c-baef-dc1a6cc960fa_1236x1456.png"><div class="image2-inset"><picture><img src="https://substackcdn.com/image/fetch/$s_!nODM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9569bf-e31e-499c-baef-dc1a6cc960fa_1236x1456.png" class="sizing-normal" alt=""></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"></div></div></div></a></figure></div><p><span>Most of these tools have familiar names; you’ve definitely read the contents of a directory and deleted files before. Others, like </span><em>read_lints</em><span> and </span><em>run_terminal_cmd</em><span>, are more common in software development (although coding agents can employ them for </span><a href="https://www.lennysnewsletter.com/p/everyone-should-be-using-claude-code">non-technical requests</a><span> too).</span></p><p><span>How does the LLM actually call the tool? An LLM can’t run commands on your computer, so it relies on </span><em>Cursor</em><span> to do so. Think of it like hiring a handyman. The LLM describes what it wants done, but it can’t hold the hammer. Cursor is the handyman: it hears the LLM’s request, uses the tool, and brings back the result so it can decide what to do next.</span></p><p>Cursor recognizes when the LLM prints a tool name (such as above), and executes that tool on your computer. After the tool finishes running, Cursor returns the result to the LLM (i.e. a successful result or an error message) so the LLM can decide what to do next. (If you’ve heard the terms “MCP client” or “agent harness,” those both describe Cursor’s role here.)</p><p><span>The way an LLM interacts with </span><em>tools</em><span> is eerily similar to how it interacts with </span><em>humans</em><span>. If we view “classic ChatGPT” as a DM thread between an LLM and a human, then AI agents are a </span><a href="https://www.talraviv.co/p/ai-agents-whatsapp-group?utm_source=publication-search">three-way group chat between an LLM, a human, and tools</a><span>.</span></p><p><span>Now when someone asks, “Can our agent do X?” you’ll instinctively think, “What tools would it need, and how good is our model at calling them?” This also connects back to model selection: it’s not just “smartest model wins.” Tool calling </span><a href="https://surgehq.ai/blog/rl-envs-real-world">is its own behavior</a><span>, separate from reasoning or writing quality.</span></p><h4 class="header-anchor-post">Wait, then what’s the “MCP” I keep hearing about?<div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§wait-then-whats-the-mcp-i-keep-hearing-about"></div></div></div></h4><p><span>For most organizations, the most valuable data doesn’t live in local text files but rather in external SaaS services. For an LLM to interact with Linear, Figma, Notion, Snowflake, BigQuery, Amplitude, or Mixpanel, those services need to provide the LLM with </span><em>custom tools</em><span>.</span></p><p>Normally, each SaaS company would have to integrate a separate tool for each LLM out there. To avoid this mess, the industry adopted a standard called Model Context Protocol (MCP). That way, each SaaS company now only needs to build one connector that works everywhere.</p><p><span>If that sounds a lot like USB or Bluetooth, that’s the right analogy. To continue the comparison: most agent tools aren’t MCP, just like most electrical wires aren’t shaped like USB plugs. </span><strong>For simplicity, MCP is just another tool the agent can use, with a standardized interface.</strong></p><h3 class="header-anchor-post"><strong>Step 7: Put everything into practice by building your personal OS inside Cursor</strong><div class="pencraft pc-display-flex pc-alignItems-center pc-position-absolute pc-reset header-anchor-parent"><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-reset header-anchor offset-top" id="§step-7-put-everything-into-practice-by-building-your-personal-os-inside-cursor"></div></div></div></h3><p>Now that we understand how agents work generally, let’s create a personalized AI agent for ourselves to see how the components of Cursor come together.</p><p>We’re going to build a very lightweight, minimal personal productivity system that organizes our contacts from various parts of our life, like notes, transcripts, and unstructured thoughts, as well as some tasks that we need to get done. (This lets us temporarily ignore discovery, distribution, and pricing. We’ll be free to focus on what’s technically possible.)</p><p>By the end of this exercise, you’ll be able to ask Cursor to create tasks from your backlog and get started on those tasks based on the context you provided in the knowledge and goals. In the process, we’ll learn about RAG, memory, and context engineering and build critical parts of product sense.</p><p>To get started, you can copy and paste the following prompt into Cursor (make sure you’re on “Agent” mode):</p></div></div><div class="visibility-check"></div></div><div class="paywall"><h2 class="paywall-title">This post is for paid subscribers</h2><div class="paywall-cta"><a href="https://www.lennysnewsletter.com/subscribe?simple=true&amp;next=https%3A%2F%2Fwww.lennysnewsletter.com%2Fp%2Fhow-to-build-ai-product-sense&amp;utm_source=paywall&amp;utm_medium=web&amp;utm_content=186226252"></a></div><div class="paywall-login"><a href="https://substack.com/sign-in?redirect=%2Fp%2Fhow-to-build-ai-product-sense&amp;for_pub=lenny&amp;change_user=false">Already a paid subscriber? <b>Sign in</b></a></div></div><div class="pencraft pc-display-contents pc-reset pubTheme-yiXxQA"><div class="pencraft pc-display-flex pc-paddingTop-16 pc-paddingBottom-16 pc-justifyContent-space-between pc-reset"></div></div><div class="post-contributor-footer"><div class="container-border"></div><div class="post-contributor-bio"><table class="post-contributor-bio-table"><tr class="post-contributor-bio-table-row"><td class="post-contributor-bio-userhead-cell post-contributor-bio-userhead-cell-web"><span><a href="https://substack.com/@talsraviv?utm_source=byline" class="pencraft pc-display-contents pc-reset"><div class="pencraft pc-display-flex pc-width-52 pc-height-52 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f animate-vY_IWG outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM pressable-sm-elJLHF showFocus-xAetgz container-TAtrWj interactive-UkK0V6"><div class="pencraft pc-display-flex pc-width-52 pc-height-52 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM container-TAtrWj"><picture><img class="img-OACg1c object-fit-cover-u4ReeV pencraft pc-reset" src="https://substackcdn.com/image/fetch/$s_!Sp2z!,w_52,h_52,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7ebe7e6-cd97-479f-95a8-c19fc3ae402c_664x664.jpeg" alt="Tal Raviv's avatar"></picture></div></div></a></span></td><td class="post-contributor-bio-body-cell post-contributor-bio-body-cell-web"><div class="post-contributor-bio-body"><div class="post-contributor-bio-preamble">A guest post by</div><table class="post-contributor-bio-body-table"><tr class="post-contributor-bio-body-table-row"><td class="post-contributor-bio-copy-cell"><div class="pencraft pc-display-flex pc-gap-4 pc-paddingBottom-4 pc-alignItems-center pc-reset"><span><a class="post-contributor-bio-title no-margin" href="https://substack.com/@talsraviv?utm_campaign=guest_post_bio&amp;utm_medium=web">Tal Raviv</a></span></div><div class="post-contributor-bio-text">Early @ Patreon, Riverside, Wix, AppsFlyer, DuckDuckGo </div></td><td class="post-contributor-bio-controls-cell post-contributor-bio-controls-cell-web"><div class="post-contributor-bio-controls"><a class="post-contributor-bio-subscribe-button button primary" href="https://www.talraviv.co/subscribe?"><span class="post-contributor-bio-subscribe-button-label">Subscribe to Tal</span></a></div></td></tr></table></div></td></tr></table></div><div class="post-contributor-bio"><table class="post-contributor-bio-table"><tr class="post-contributor-bio-table-row"><td class="post-contributor-bio-userhead-cell post-contributor-bio-userhead-cell-web"><span><a href="https://substack.com/@amankhan1?utm_source=byline" class="pencraft pc-display-contents pc-reset"><div class="pencraft pc-display-flex pc-width-52 pc-height-52 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f animate-vY_IWG outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM pressable-sm-elJLHF showFocus-xAetgz container-TAtrWj interactive-UkK0V6"><div class="pencraft pc-display-flex pc-width-52 pc-height-52 pc-justifyContent-center pc-alignItems-center pc-position-relative pc-reset bg-secondary-jBBrtc flex-auto-UL7Y7f outline-detail-Yl5oYx pc-borderRadius-full overflow-hidden-owQvYA sizing-border-box-LGXObM container-TAtrWj"><picture><img class="img-OACg1c object-fit-cover-u4ReeV pencraft pc-reset" src="https://substackcdn.com/image/fetch/$s_!XLkV!,w_52,h_52,c_fill,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2babe551-c5b2-4c0f-8c1a-d493518832d5_1203x1203.jpeg" alt="Aman Khan's avatar"></picture></div></div></a></span></td><td class="post-contributor-bio-body-cell post-contributor-bio-body-cell-web"><div class="post-contributor-bio-body"><div class="post-contributor-bio-preamble">A guest post by</div><table class="post-contributor-bio-body-table"><tr class="post-contributor-bio-body-table-row"><td class="post-contributor-bio-copy-cell"><div class="pencraft pc-display-flex pc-gap-4 pc-paddingBottom-4 pc-alignItems-center pc-reset"><span><a class="post-contributor-bio-title no-margin" href="https://substack.com/@amankhan1?utm_campaign=guest_post_bio&amp;utm_medium=web">Aman Khan</a></span></div><div class="post-contributor-bio-text">AI Product Guy</div></td><td class="post-contributor-bio-controls-cell post-contributor-bio-controls-cell-web"><div class="post-contributor-bio-controls"><a class="post-contributor-bio-subscribe-button button primary" href="https://amankhan1.substack.com/subscribe?"><span class="post-contributor-bio-subscribe-button-label">Subscribe to Aman</span></a></div></td></tr></table></div></td></tr></table></div></div></div></article></body></html>
\ No newline at end of file
diff --git a/apps/extension/fixtures/platforms/wechat.html b/apps/extension/fixtures/platforms/wechat.html
new file mode 100644
index 00000000..04d84936
--- /dev/null
+++ b/apps/extension/fixtures/platforms/wechat.html
@@ -0,0 +1,177 @@
+<!doctype html><html><head><meta><title>华为云DeepSeek-R1&amp;V3满血版体验:10分钟让你轻松掌握AI大模型应用技巧!</title><meta property="og:title" content="华为云DeepSeek-R1&amp;V3满血版体验:10分钟让你轻松掌握AI大模型应用技巧!" hidden="">
+<meta property="og:url" content="https://mp.weixin.qq.com/s/TC-ONpL3PGklsD0yhtcuBQ" hidden="">
+<meta property="og:image" content="https://mmbiz.qpic.cn/sz_mmbiz_jpg/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyJho48CNibSxblicVFbJGicIHn7WUbXXVBWNrO2zJvXQPsVY0tibMwZiasNg/0?wx_fmt=jpeg" hidden="">
+<meta property="og:description" content="华为云昇腾AI芯片提供的满血版DeepSeek R1,10分钟带你体验!" hidden="">
+<meta property="og:site_name" content="微信公众平台" hidden="">
+<meta property="og:type" content="article" hidden="">
+<meta property="og:article:author" content="陈云亮" hidden=""></head><body><div id="js_article" class="rich_media">
+
+ <div id="js_top_ad_area" class="top_banner"></div>
+
+ <div id="js_base_container" class="rich_media_inner">
+
+
+ <div id="page-content" class="rich_media_area_primary">
+ <div class="rich_media_area_primary_inner">
+
+
+
+
+
+
+
+
+
+ <div id="img-content" class="rich_media_wrp">
+
+ <h1 class="rich_media_title " id="activity-name">
+<span class="js_title_inner">华为云DeepSeek-R1&amp;V3满血版体验:10分钟让你轻松掌握AI大模型应用技巧!</span></h1>
+ <div id="meta_content" class="rich_media_meta_list">
+ <span id="copyright_logo" class="wx_tap_link js_wx_tap_highlight rich_media_meta icon_appmsg_tag appmsg_title_tag weui-wa-hotarea">原创</span>
+ <span class="rich_media_meta rich_media_meta_text">
+ <span id="js_author_name">陈云亮</span>
+ <span id="js_author_name_text" hidden="">陈云亮</span>
+ </span>
+
+ <span class="rich_media_meta rich_media_meta_nickname" id="profileBt">
+ <a role="button" class="wx_tap_link js_wx_tap_highlight weui-wa-hotarea" id="js_name">
+ 大数据架构之道 </a>
+
+ <div id="js_profile_card"></div>
+ </span>
+
+ <span id="meta_content_hide_info" class="">
+ <em id="publish_time" class="rich_media_meta rich_media_meta_text">2025年2月22日 23:02</em>
+ <em id="js_ip_wording_wrp" class="rich_media_meta rich_media_meta_text"><span id="js_a11y_op_ip_wording" aria-hidden="true"></span><span aria-hidden="true" id="js_ip_wording">日本</span></em>
+
+
+ </span>
+
+ </div>
+
+
+
+ <div id="js_novel_card" class="novel-card js_wx_tap_highlight wx_tap_card" hidden="">
+
+ <div class="novel-card__left novel-card__new-only">
+ <div id="js_novel_cover" class="novel-card__cover">
+ <img>
+ </div>
+ <div class="novel-card__text">
+ <div id="js_novel_title" class="novel-card__main">在小说阅读器读本章</div>
+ <div id="js_novel_subtitle" class="novel-card__subtitle"></div>
+ </div>
+ </div>
+ <div id="js_novel_link" class="novel-card__link novel-card__new-only">去阅读</div>
+
+ <div class="novel-info novel-card__old-only" hidden="">
+ <div class="novel-cover-group">
+ <div id="js_novel_cover_old" class="novel-cover">
+ <img>
+ </div>
+ <div class="novel-meta">
+ <div id="js_novel_title_old" class="novel-title"></div>
+ <div class="novel-description">在公众号小说中沉浸阅读</div>
+ </div>
+ </div>
+ </div>
+ <div class="arrow-jump-icon novel-card__old-only" hidden=""></div>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="rich_media_content js_underline_content autoTypeSetting24psection fix_apple_default_style" id="js_content"><p><span><br></span></p><section><section><section><section><section><p><span style="font-size:14px;font-weight:700;text-align:justify">点击上方</span><span><span style="font-size:14px;font-weight:700;text-align:justify">蓝字</span></span><span style="font-size:14px;font-weight:700;text-align:justify">,关于我们</span></p></section></section><section><img data-src="https://mmbiz.qpic.cn/mmbiz_png/iaic5Jv7oDhWHr79HicXZDMKibgXSq1ibaz4bVlzp4CqzdYWEr3GSUt6rJPxkOryibOic1yDu8gia90ic3Lzf2cm4LFK0Ww/640#imgIndex=0" class="rich_pages wxw-img" src="https://mmbiz.qpic.cn/mmbiz_png/iaic5Jv7oDhWHr79HicXZDMKibgXSq1ibaz4bVlzp4CqzdYWEr3GSUt6rJPxkOryibOic1yDu8gia90ic3Lzf2cm4LFK0Ww/640?tp=webp&amp;wxfrom=5&amp;wx_lazy=1#imgIndex=0" alt="图片"></section></section></section></section><section><section><section><section><section><section><section><section><section><section><section><p><span style="font-size:14px;font-weight:400;text-align:justify">温馨提示</span></p></section></section></section></section></section></section><section><section><section><p><span style="font-size:14px;font-weight:400;text-align:justify">本篇文章字数约1600,大约需要花费3分钟读完,如需上手实践,大约需要花费10分钟。</span></p></section></section></section></section></section></section></section></section><p><span>&nbsp;</span></p><section><section><section><section><section><span><br></span></section><section><p><span><span style="font-size:18px;font-weight:400;text-align:center">什么是Deepseek V3</span></span></p></section><section><span><br></span></section></section></section></section></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">DeepSeek-V3 为杭州深度求索人工智能基础技术研究有限公司在2024年12月26日发布的自研的(</span></span><span><span><span>&nbsp;</span></span></span><b><span><span><span style="font-size:14px;font-weight:700;text-align:justify">MoE 模型,671B 参数,激活 37B,在 14.8T token 上进行了预训练。这些看不懂就不要看!</span></span></span></b><span><font><span><span style="font-size:14px;font-weight:400;text-align:justify">)。</span></span></font></span><span><o:p></o:p></span></p><p><b><span><font><span><span style="font-size:14px;font-weight:400;text-align:justify">DeepSeek-V3 多项评测成绩超越了 Qwen2.5-72B 和 Llama-3.1-405B 等其他开源模型,并在性能上和世界顶尖的闭源模型 GPT-4o 以及 Claude-3.5-Sonnet 不分伯仲。</span></span></font></span></b><span><o:p></o:p></span></p><p><span><font><span><span style="font-size:14px;font-weight:400;text-align:justify">有图有真相,下面的图片来自其官网。(如有侵权,请联系删除)</span></span></font></span><span><br></span><span><o:p></o:p></span></p><p><span><span>&nbsp;</span><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglykaCcWBvrwHWkkcnlLOmsDuFSiaWFkj9m6BuiarSCs9WMUibX7cK2ClkFQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=1" class="rich_pages wxw-img" type="block" src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglykaCcWBvrwHWkkcnlLOmsDuFSiaWFkj9m6BuiarSCs9WMUibX7cK2ClkFQ/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1#imgIndex=1" alt="图片"></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly2xNmL29Y7gS0xr5muvygdlfFwgGyRK8dTawatJB7cWzl3lkl9LYjuQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=2" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">上面的图片看不懂,没关系,记住一个词:</span></span><b><span><font><span><span style="font-size:14px;font-weight:700;text-align:justify">牛</span></span></font><font><span><span style="font-size:14px;font-weight:700;text-align:justify">B!</span></span></font></span></b><span><o:p></o:p></span></section><p><span>&nbsp;</span></p><section><section><section><section><section><span><br></span></section><section><p><span><span style="font-size:18px;font-weight:400;text-align:center">什么是DeepSeek R1</span></span></p></section><section><span><br></span></section></section></section></section></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">&nbsp;DeepSeek-R1 于 2025 年 1 月 20 日发布,性能对标 OpenAI 的 O1 正式版。DeepSeek-R1 遵循 MIT 许可,允许用户通过蒸馏技术利用 R1 训练其他模型。它还上线了 API,开放思维链输出,用户只需设置&nbsp;</span></span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js"><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">model=</span><span class="code-snippet__string" style="font-size:14px;font-weight:400;text-align:left">'deepseek-reasoner'</span><span class="code-snippet__plaintext">&nbsp;</span></span></code></pre></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">即可调用。思维链是 AI 领域的核心技术之一,类似于人类做事前的思考过程,AI 通过思维链可以更像人类一样理性地思考和解决问题。</span></span></p><p><span><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly5YVGDicKjicnIwu5fKnO6V8qxGSTicy3zzCsdlg4cB9fVW1ic8rJY9vJiaQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=3" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片">&nbsp;&nbsp;<img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglynvcgzmjrQonbcs3PlTHZAFwG8lKeVkXjbLGIM0ELdutcgZORM4gTyg/640?wx_fmt=png&amp;from=appmsg#imgIndex=4" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">R1 开源许可统一采用 MIT 许可,完全开源,不限制商用,无需申请。同时,产品协议明确支持“模型蒸馏”,进一步推动技术开源和共享。这对各大模型厂商来说,无疑是一个冲击。现在,通过少量 GPU 和“模型蒸馏”就能实现与超大规模参数模型相媲美的效果,真是一个巨大的突破!</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">DeepSeek V3 和 R1 的主要区别体现在开源、技术特点和应用场景上。DeepSeek V3 作为第三代版本,注重提升模型的通用性和处理能力,适合大规模数据处理和多任务学习,应用范围更广。而 DeepSeek R1 则完全开源,采用 MIT 许可,支持蒸馏技术,允许用户利用少量 GPU 训练高效的模型,并引入“思维链”技术,使得 AI 在推理过程中更像人类思考问题。</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">DeepSeek R1 主要针对那些需要高效 GPU 使用和资源有限环境下的高性能训练与推理,因此在一些推理效率要求较高的应用场景中表现优异。</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">DeepSeek V3 更侧重于多任务和大数据处理,而 R1 则专注于资源优化和高效训练。</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">以上没看懂,没关系,接下来教大家如何在华为云上使用满血版的DeepSeek &nbsp;V3和R1。</span></span></p><p><span>&nbsp;</span></p><section><mp-common-cpsad class="js_uneditable custom_select_card new_cps_iframe mp_common_widget"></mp-common-cpsad><div><span class="js_img_placeholder wx_widget_placeholder"><span class="weui-primary-loading"><span class="weui-primary-loading__dot"></span></span></span></div></section><section><section><section><section><section><span><br></span></section><section><p><span><span style="font-size:18px;font-weight:400;text-align:center">华为云ModelAart Studio(MaaS)</span></span></p></section><section><span><br></span></section></section></section></section></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">&nbsp;ModelArts Studio(MaaS)是华为云推出的模型即服务平台,支持从数据准备到模型部署的全流程操作。最近,平台进行了重磅更新,新增支持昇腾适配版满血模型(参数达到671B),并且每个模型还提供200万免费tokens。这意味着用户可以在更强大的计算力支持下,进行大规模模型训练和推理,同时享受免费的 tokens 使用,极大降低了使用门槛和成本。</span></span></p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js"><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-R1-671B-32K&nbsp;</span></span></code><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-V3-671B-32K&nbsp;</span></span></code><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-R1-671B-8K&nbsp;</span></span></code><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-V3-671B-8K&nbsp;</span></span></code><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-V3-671B-4K&nbsp;</span></span></code><code><span><span class="code-snippet__plaintext" style="font-size:14px;font-weight:400;text-align:left">DeepSeek-R1-671B-4K</span></span></code></pre></section><p><span>&nbsp;</span></p><section><section><img data-src="https://mmbiz.qpic.cn/mmbiz_gif/DRPKCGMAPjKzncOsqKVQInBQ7RU7WTSXdZibqnQawiatlspU3On2UoEBiac2cneSb8TJTL2mcx8CdH9ydrKevOfSw/640?wx_fmt=gif#imgIndex=5" alt="分割线" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder __bg_gif" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E"></section></section><p><span>&nbsp;<span style="font-size:14px;font-weight:400;text-align:justify">第一步:注册华为云账号</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">华为云官网:www.huaweicloud.com</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">点击右上角“注册”,按要求填写即可。</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">1. 注册后,登录</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">2.在控制台右侧的区域,选择“西南-贵阳一”</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">3.在左上角“三”处点击,搜索“model”</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyJEMx8wTHza7JSxYubn7fDhn2hMlHkNDT8LO0wOkFVCYdXiaAzDBo1mw/640?wx_fmt=png&amp;from=appmsg#imgIndex=6" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">在左侧点击“ModelArts Studio”</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyicPpBFrCxAJhb2MxjHgdaZFtcNarPiaaPVYXz5hlxcbjSrXnbiaibQP0jg/640?wx_fmt=png&amp;from=appmsg#imgIndex=7" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><br></span></p><section><section><img data-src="https://mmbiz.qpic.cn/mmbiz_gif/DRPKCGMAPjKzncOsqKVQInBQ7RU7WTSXdZibqnQawiatlspU3On2UoEBiac2cneSb8TJTL2mcx8CdH9ydrKevOfSw/640?wx_fmt=gif#imgIndex=8" alt="分割线" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder __bg_gif" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E"></section></section><p><span>&nbsp;<span style="font-size:14px;font-weight:400;text-align:justify">第二步:领取免费tokens</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">进入ModelArts Studio大模型即服务平台</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">点击“模型部署”,在右侧点击“领取”</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyzur9rfRyJ6q1lZV2PHqAufR78hKIQlhjNZX08x41damrpdoAdSo9mg/640?wx_fmt=png&amp;from=appmsg#imgIndex=9" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">点击“调用”,获取API地址,模型名称等信息</span></span></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">下面以模型“DeepSeek-R1-671B-32K”为例:</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly4yjOb7HnUia4dX5IQK9fBwibM7Nsr3ABicdsBKlmC7L8xhttXsYYGibc6Q/640?wx_fmt=png&amp;from=appmsg#imgIndex=10" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">点击“管理API Key”,新增API Key。</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly7suiakiaTbd8CMoicDC5miaBOjemxibeL0Vryo77akM5QcMIAIoHJgfGMJA/640?wx_fmt=png&amp;from=appmsg#imgIndex=11" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">点击“创建API Key”</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyV9QvC5S0mMM9VLr9lBa8F4lJwcWR77f0I27XVTfZKMPkLichg9AIU2g/640?wx_fmt=png&amp;from=appmsg#imgIndex=12" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">输入“描述”,点击“确定”</span></span><span><span style="font-size:14px;font-weight:400;text-align:justify">。</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyAkUCgebRzwibm4RSiclKmHCUvPDV2epqSdJic3oVzwvGY6xJmbnJiayIuQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=13" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">复制“密钥”。</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyib9YsQFZM9SvQNhDbaMFEGvee7D5TSeYOsCALibicbHQPZA0WmS48mBew/640?wx_fmt=png&amp;from=appmsg#imgIndex=14" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span>&nbsp;</span></section><section><section><img data-src="https://mmbiz.qpic.cn/mmbiz_gif/DRPKCGMAPjKzncOsqKVQInBQ7RU7WTSXdZibqnQawiatlspU3On2UoEBiac2cneSb8TJTL2mcx8CdH9ydrKevOfSw/640?wx_fmt=gif#imgIndex=15" alt="分割线" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder __bg_gif" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E"></section></section><p><span>&nbsp;<span style="font-size:14px;font-weight:400;text-align:justify">第三步:安装cherry studio</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">官网下载:https://cherry-ai.com/download&nbsp;</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">网盘下载:https://pan.baidu.com/s/14y1VgCzG9hnrgIkZbSnELA?pwd=7i4w</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyic3qjs4G5UddFf8ZdLjenAVDB66u0aL6AmW2rfqc9iayELbAmSVtJdKA/640?wx_fmt=png&amp;from=appmsg#imgIndex=16" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">下载对应版本安装即可。</span></span></p><section><section><img data-src="https://mmbiz.qpic.cn/mmbiz_gif/DRPKCGMAPjKzncOsqKVQInBQ7RU7WTSXdZibqnQawiatlspU3On2UoEBiac2cneSb8TJTL2mcx8CdH9ydrKevOfSw/640?wx_fmt=gif#imgIndex=17" alt="分割线" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder __bg_gif" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E"></section></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">第四步:配置并使用cherry studio</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">安装后,点击左下角的工具 -&gt; 模型服务 -&gt; 点击“添加”。</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">提供商名称:华为云(可以是其他名字)</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">提供商类型:OpenAI(这是是通用标准)</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">点击确定。</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglywwXsVhRnELeRfOnoYS3icQ7ib9r6nb0gQmFtzJ4qJl84scfAvzaaoqicg/640?wx_fmt=png&amp;from=appmsg#imgIndex=18" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">1.把前面创建API Key的密钥粘贴到“API密钥”</span></span></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">2.API地址为第二步点击“调用”中的API地址,在结尾添加“#”,比如:</span></span></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">https://infer-modelarts-cn-southwest-2.modelarts-infer.com/v1/infers/xxxe/v1/chat/completions#</span></span></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">3.点击“添加”</span></span></section><section><span><br></span><span><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly3YBGibhfE8SXcWcouc02QrKSpW23GhxuJQIgzmiaYyib0sxOkdjerI0yg/640?wx_fmt=png&amp;from=appmsg#imgIndex=19" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></span></section><section><span><span style="font-size:14px;font-weight:400;text-align:justify">模型,模型名称,分组名称都是:DeepSeek-R1,点击“添加模型”。</span></span></section><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly669wQNxlbhQygGvCYRTR6qfz19WO04kY0Oo9I32aNeFDEj9wjlwu6w/640?wx_fmt=png&amp;from=appmsg#imgIndex=20" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">点击“检查”,弹窗点击“确定”。</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyAuSfXaqhwk7x0qhUt9W2Q6huDb8n7txfgMFd0XEicdJpASjicjBQiaoKA/640?wx_fmt=png&amp;from=appmsg#imgIndex=21" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">等待连接测试结果。</span></span></p><section><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyLscNQ5LCibGA5ib8fDA7SCf35tOUHaB2qpvfPrwYZL7Ve1DicVHWUxmjQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=22" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">如果连接失败,检查以下地方:</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">1.API密钥是否复制正确;</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">2.API地址末尾是否有“#”;</span></span></p><p><span><span style="font-size:14px;font-weight:400;text-align:justify">3.模型名称是否正确。</span></span></p><section><mp-common-cpsad class="js_uneditable custom_select_card new_cps_iframe mp_common_widget"></mp-common-cpsad><div><span class="js_img_placeholder wx_widget_placeholder"><span class="weui-primary-loading"><span class="weui-primary-loading__dot"></span></span></span></div></section><p><span><br></span></p><p><font><span><span style="font-size:14px;font-weight:400;text-align:justify">选择模型进行对话:</span></span></font></p><p><font><span><span style="font-size:14px;font-weight:400;text-align:justify">1.点击左上角的聊天按钮</span></span></font></p><p><font><span><span style="font-size:14px;font-weight:400;text-align:justify">2.更换模型为刚刚添加的DeepSeek-R1</span></span></font></p><section><img class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbgly0iacK9U0bML3m5Q7eZboicvzlGlcsPSYsZTuAZ7vgVAVTB6njMACptKw/640?wx_fmt=png&amp;from=appmsg#imgIndex=23" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><section><img class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/zpn6hIWofyPuTD7xb3IxAShHBXsBbglyBlU51DP5iaicNukheaGBNIDnqPWAOCNCUe55o8zeOa7JQHdL8iaJYVVjQ/640?wx_fmt=png&amp;from=appmsg#imgIndex=24" type="block" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></section><p><span><span style="font-size:14px;font-weight:400;text-align:justify">至此,可以体验由华为云昇腾AI芯片提供的满血版DeepSeek R1!</span></span></p><p><span><br></span></p><section><section><section><a href="http://mp.weixin.qq.com/s?__biz=MzI0NjQ4MzM0NQ==&amp;mid=2247484309&amp;idx=1&amp;sn=819bcc24d6ab36836d65cf5dd27e1898&amp;chksm=e9bfd36bdec85a7d3a5064e1d771dbb37b225e0dfb04ddfde1d14c2cae15cbd261afb27fc5df&amp;scene=21#wechat_redirect"><section><section><p><span style="font-size:13px;font-weight:400;text-align:justify">现阶段的AI没有推理能力,包括OpenAI和Deepseek的大模型,请看证明~~</span></p><p><span style="font-size:11px;font-weight:400;text-align:justify">2025-02-16</span></p></section><span class="js_jump_icon h5_image_link"><span><img data-src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/zpn6hIWofyOVice5psMjibUhz5BKgdU5muicWfyq4sZb73xuXQJiaibic9ge2VN2jqVrfhibDib0ZTTLwDJo7kicSzWkZ4A/640?wx_fmt=jpeg#imgIndex=25" class="rich_pages wxw-img js_img_placeholder wx_img_placeholder" src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='1px' height='1px' viewBox='0 0 1 1' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3E%3C/title%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0'%3E%3Cg transform='translate(-249.000000, -126.000000)' fill='%23FFFFFF'%3E%3Crect x='249' y='126' width='1' height='1'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" alt="图片"></span></span></section></a></section></section></section><section><mp-common-cpsad class="js_uneditable custom_select_card new_cps_iframe mp_common_widget"></mp-common-cpsad></section><p><span><br></span></p><p hidden=""><mp-style-type></mp-style-type></p></div>
+
+ </div>
+
+
+ <div id="js_tags_preview_toast" class="article-tag__error-tips" hidden="">预览时标签不可点</div>
+
+ <div id="content_bottom_area"><!----> <!----><!----> <div><div class="reward_area tc reward_area_primary"><div><div id="js_reward_area" class="reward_area_carry_whisper"><p class="reward_button_wrp"><span class="reward_pop_panel" hidden=""><img alt="赞赏二维码" hidden=""><strong hidden="">微信扫一扫赞赏作者</strong></span><a role="button" class="reward_button weui-btn"><i class="icon_reward"></i><span>喜欢作者</span></a></p><!----><!----><!----><div role="dialog" aria-hidden="true" class="wx_bottom_modal_wrp reward_list_dialog" hidden=""><div class="wx_bottom_modal_mask_fixed" hidden=""></div><div class="weui-mask wx_bottom_modal_mask" hidden=""></div><div class="weui-half-screen-dialog wx_bottom_modal" hidden=""><div class="wx_bottom_modal_group_container" hidden=""><div aria-hidden="false" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""><div class="weui-half-screen-dialog__hd__side" hidden=""><button class="weui-btn_icon weui-wa-hotarea" hidden="">关闭<i class="weui-icon-filled-fold" hidden=""></i></button></div><div class="weui-half-screen-dialog__hd__main" hidden=""><strong class="weui-half-screen-dialog__title" hidden=""><div class="reward_list_dialog_hd" hidden=""><a role="button" class="reward_list_dialog_hd_item" hidden="">0人付费</a><!----></div></strong></div><div class="weui-half-screen-dialog__hd__side" hidden=""><!----><button class="weui-btn_icon weui-wa-hotarea" hidden="">更多<i class="weui-icon-more" hidden=""></i></button></div></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="" hidden=""><div hidden=""><div class="reward_list-wrp" hidden=""><!----><ul class="reward_list weui-cells" hidden=""></ul><div class="reward_list-loadmore" hidden="">正在加载...</div></div></div><div hidden=""><div class="reward_list-wrp" hidden=""><!----><ul class="reward_list weui-cells" hidden=""></ul><div class="reward_list-loadmore" hidden="">正在加载...</div></div></div></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><!----></div></div></div></div></div></div></div><div role="dialog" aria-hidden="true" class="wx_bottom_modal_wrp reward_dialog discuss_more_dialog_wrp weui-half-screen-dialog_wrp" hidden=""><div class="wx_bottom_modal_mask_fixed" hidden=""></div><div class="weui-mask wx_bottom_modal_mask" hidden=""></div><div class="weui-half-screen-dialog wx_bottom_modal" hidden=""><div class="wx_bottom_modal_group_container" hidden=""><div aria-hidden="false" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""><div class="weui-half-screen-dialog__hd__side" hidden=""><button class="weui-btn_icon weui-wa-hotarea" hidden="">关闭<i class="weui-icon-half-screen-close" hidden=""></i></button></div><div class="weui-half-screen-dialog__hd__main" hidden=""><strong class="weui-half-screen-dialog__title" hidden=""></strong></div><div class="weui-half-screen-dialog__hd__side" hidden=""><!----><button class="weui-btn_icon weui-wa-hotarea" hidden="">更多<i class="weui-icon-more" hidden=""></i></button></div></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="" hidden=""><!----><div class="" hidden=""><div class="author_profile-info" hidden=""><div role="img" class="author_profile-info_avatar" hidden=""></div><div class="author_profile-info_main" hidden=""><div id="reward-dialog_author-main_name" role="option" class="author_profile-info_main_nickname" hidden="">名称已清空</div><div id="reward-dialog_author-main_head" aria-hidden="true" class="author_profile-info_main_content" hidden=""><!----><!----></div><!----></div></div><div class="author_profile-pay_area" hidden=""><span class="reward_pop_panel" hidden=""><img alt="赞赏二维码" hidden=""><strong hidden="">微信扫一扫赞赏作者</strong></span><div class="author_profile-pay_area_head" hidden=""><span hidden="">赠予作者</span><a role="button" hidden="">其它金额</a></div><div class="author_profile-pay_area_btns" hidden=""></div><div class="author_profile-pay_area_foot" hidden=""><label hidden=""><div class="author_profile-pay_area_checkbox" hidden=""><input type="checkbox" class="weui-check" hidden=""><i class="weui-icon-checked" hidden=""></i></div><span hidden="">赞赏后展示我的头像</span></label></div></div><!----><div class="author_profile-articles" hidden=""><div class="author_profile-articles_title" hidden="">作品</div><div class="author_profile-articles_empty" hidden="">暂无作品</div></div><div class="dialog-pay" hidden=""><div class="dialog-pay_body" hidden=""><div class="dialog-pay_close weui-wa-hotarea" hidden=""><div class="weui-icon-close-thin" hidden=""></div></div><div class="dialog-pay_title" hidden="">赠予作者</div><div class="reward-slider-container" hidden=""><div class="reward-slider" hidden=""><div class="reward-list-wrap" hidden=""><div class="reward-list" hidden=""><div class="dialog-pay__button" hidden="">其它金额</div></div></div><div class="reward-custorm" hidden=""><label class="reward-input-area" hidden=""><div class="reward-input-box" hidden=""><span class="reward-input-yen" hidden="">¥</span><input class="reward-input" hidden=""><input aria-hidden="true" class="reward-input" hidden=""></div></label><div class="reward-input-hint" hidden="">最低赞赏 ¥0</div><div class="reward-button-wrap" hidden=""><button class="weui-btn weui-btn_primary reward-operation-button weui-btn_disabled" hidden="">确定</button></div></div></div></div></div></div></div></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><!----></div><div aria-hidden="true" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""><div class="weui-half-screen-dialog__hd__side" hidden=""><button class="weui-btn_icon weui-wa-hotarea" hidden="">返回<i class="weui-icon-back-arrow-thin" hidden=""></i></button></div><div class="weui-half-screen-dialog__hd__main" hidden=""><strong class="weui-half-screen-dialog__title" hidden="">其它金额</strong></div><div class="weui-half-screen-dialog__hd__side" hidden=""><!----><button class="weui-btn_icon weui-wa-hotarea" hidden="">更多<i class="weui-icon-more" hidden=""></i></button></div></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="" hidden=""><div class="reward_custom" hidden=""><div class="reward_custom-input_area" hidden=""><div class="reward_custom-input_title" hidden="">赞赏金额</div><div class="reward_custom-input" hidden=""><span class="reward_custom-input_yen" hidden="">¥</span><span class="reward_custom-input_value" hidden=""><span class="reward_custom-input_hotarea last js_pointer_hotarea" hidden=""></span></span><span class="reward_custom-input_pointer" hidden=""></span></div><div class="reward_custom-tips" hidden="">最低赞赏 ¥0</div></div><div class="reward_custom-keyboard" hidden=""><div class="reward_custom-keyboard_number" hidden=""><div role="button" class="reward_custom-keyboard_item" hidden="">1</div><div role="button" class="reward_custom-keyboard_item" hidden="">2</div><div role="button" class="reward_custom-keyboard_item" hidden="">3</div><div role="button" class="reward_custom-keyboard_item" hidden="">4</div><div role="button" class="reward_custom-keyboard_item" hidden="">5</div><div role="button" class="reward_custom-keyboard_item" hidden="">6</div><div role="button" class="reward_custom-keyboard_item" hidden="">7</div><div role="button" class="reward_custom-keyboard_item" hidden="">8</div><div role="button" class="reward_custom-keyboard_item" hidden="">9</div><div role="button" class="reward_custom-keyboard_item double" hidden="">0</div><div role="button" class="reward_custom-keyboard_item" hidden="">.</div></div><div class="reward_custom-keyboard_control" hidden=""><div role="button" class="reward_custom-keyboard_item reward_custom-keyboard_del_btn" hidden=""></div><div role="button" class="reward_custom-keyboard_item reward_custom-keyboard_submit_btn reward_custom-keyboard_submit_btn_disabled" hidden=""></div></div></div></div></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><!----></div></div></div></div></div> <!----><div class="rich_media_tool_area empty_hide"><!----> <!----><div class="rich_media_tool__wrp"><div id="js_content_end" class="rich_media_tool"><div class="rich_media_info weui-flex policy_tips tips_global_primary claim_source_block"><div class="media_tool_meta tips_global_primary meta_primary"> 作者提示: 素材来源官方媒体/网络新闻<!----></div></div><div class="rich_media_info weui-flex rich_media_bottom" hidden=""><!----><!----><!----><!----></div></div><!----><!----><!----><!----></div></div><div class="adv_keyword_bottom_modal"><div role="dialog" aria-hidden="true" class="wx_bottom_modal_wrp ad_keyword_bottom_modal_wrap" hidden=""><div class="wx_bottom_modal_mask_fixed" hidden=""></div><div class="weui-mask wx_bottom_modal_mask" hidden=""></div><div class="weui-half-screen-dialog wx_bottom_modal bottom_modal_content_area" hidden=""><div class="wx_bottom_modal_group_container" hidden=""><div aria-hidden="false" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""><div class="weui-half-screen-dialog__hd__side" hidden=""><button class="weui-btn_icon weui-wa-hotarea" hidden="">关闭<i class="weui-icon-filled-fold" hidden=""></i></button></div><div class="weui-half-screen-dialog__hd__main" hidden=""><strong class="weui-half-screen-dialog__title" hidden=""></strong></div><div class="weui-half-screen-dialog__hd__side" hidden=""><!----><button class="weui-btn_icon weui-wa-hotarea" hidden="">更多<i class="weui-icon-more" hidden=""></i></button></div></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="bottom_modal_content_wrap" hidden=""><div hidden=""><h1 class="adv_keyword_title" hidden=""></h1><p class="adv_keyword_desc" hidden=""></p><div hidden=""><!----></div><!----></div></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-half-screen-dialog__ft" hidden=""><p class="adv_keyword_search" hidden=""><a class="js_wx_tap_highlight wx_tap_link" hidden="">搜索「」网络结果</a></p></div></div></div></div></div></div> <div role="dialog" aria-hidden="true" class="wx_bottom_modal_wrp author-change-album-dialog" hidden=""><div class="wx_bottom_modal_mask_fixed" hidden=""></div><div class="weui-mask wx_bottom_modal_mask" hidden=""></div><div class="weui-half-screen-dialog wx_bottom_modal" hidden=""><div class="wx_bottom_modal_group_container" hidden=""><div aria-hidden="false" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="" hidden=""></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><!----></div></div></div></div><div><!----><!----></div></div>
+
+ <div role="dialog" aria-hidden="true" class="wx_bottom_modal_wrp font-pannel-modal" hidden=""><!----><div class="weui-half-screen-dialog wx_bottom_modal" hidden=""><div class="wx_bottom_modal_group_container" hidden=""><div aria-hidden="false" class="wx_bottom_modal_group" hidden=""><div class="weui-half-screen-dialog__hd__wrp" hidden=""><div class="weui-half-screen-dialog__hd" hidden=""><div class="weui-half-screen-dialog__hd__side" hidden=""><button class="weui-btn_icon weui-wa-hotarea" hidden="">关闭<i class="weui-icon-filled-fold" hidden=""></i></button></div><div class="weui-half-screen-dialog__hd__main" hidden=""><strong class="weui-half-screen-dialog__title" hidden=""><div class="font-pannel-title" hidden="">调整当前正文文字大小</div></strong></div><div class="weui-half-screen-dialog__hd__side" hidden=""><!----><button class="weui-btn_icon weui-wa-hotarea" hidden="">更多<i class="weui-icon-more" hidden=""></i></button></div></div></div><div id="contentAreaWrp" class="weui-half-screen-dialog__bd" hidden=""><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div><div class="wx_bottom_modal_msg_wrp" hidden=""><div class="wx_bottom_modal_msg" hidden=""><i class="weui-loading" hidden=""></i></div></div><div class="weui-loadmore weui-loadmore_line weui-loadmore_dot" hidden=""><span class="weui-loadmore__tips" hidden=""></span></div><div class="" hidden=""><div class="font-pannel-container" hidden=""><div class="font-pannel-btn-group" hidden=""><div class="font-pannel-btn" hidden=""><span class="reduce-icon font-pannel-icon" hidden=""></span></div><span class="font-pannel-size-num" hidden="">100%</span><div class="font-pannel-btn" hidden=""><span class="increase-icon font-pannel-icon" hidden=""></span></div></div><div class="font-pannel-hint" hidden="">此设置仅对当前内容生效,如需全局调整,请前往微信<wbr hidden=""><span class="font-pannel-sys-setting" hidden="">系统设置</span></div></div></div><div class="weui-loadmore" hidden=""><i class="weui-loading" hidden=""></i></div></div><!----></div></div></div></div>
+
+
+
+
+ <div id="js_temp_bottom_area" class="rich_media_tool_area" hidden="">
+
+<div class="rich_media_tool__wrp">
+ <div class="rich_media_tool">
+
+ <div class="rich_media_info weui-flex policy_tips tips_global_primary claim_source_block">
+ <div id="js_claim_source_content" class="media_tool_meta tips_global_primary meta_primary"></div>
+ </div>
+
+ <div class="rich_media_info weui-flex rich_media_bottom">
+
+
+
+
+ <span id="js_dislike_btn_skeleton" class="mp_dislike_btn mp_dislike_btn_skeleton" hidden="">
+ <span class="mp_dislike_btn__icon" aria-hidden="true"></span>
+ <span class="mp_dislike_btn__text">不喜欢</span>
+ </span>
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+
+
+ </div>
+ </div>
+
+ <div class="rich_media_area_primary sougou" id="sg_tj" hidden=""></div>
+
+
+ <div class="rich_media_area_extra">
+ <div class="rich_media_area_extra_inner">
+
+ <div id="page_bottom_area" class=""><div><div aria-hidden="true">​</div><!----><div class="mpda_bottom_container"><!----></div><div class="related_container"><!----></div></div><!----><div class="teleporter hidden" hidden=""></div><div class="teleporter hidden" hidden=""></div></div>
+ </div>
+ </div>
+
+
+ <div id="js_pc_qr_code" class="qr_code_pc_outer" hidden="">
+ <div class="qr_code_pc_inner">
+ <div class="qr_code_pc">
+ <img id="js_pc_qr_code_img" class="qr_code_pc_img">
+ <p>微信扫一扫<br>关注该公众号</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+</div>
+</body></html>
\ No newline at end of file
diff --git a/apps/extension/fixtures/platforms/xiaoyuzhou-hosts.html b/apps/extension/fixtures/platforms/xiaoyuzhou-hosts.html
new file mode 100644
index 00000000..8971aa68
--- /dev/null
+++ b/apps/extension/fixtures/platforms/xiaoyuzhou-hosts.html
@@ -0,0 +1 @@
+<!doctype html><html><head><meta charset="utf-8"><link rel="canonical" href="https://www.xiaoyuzhoufm.com/episode/612375e57f89405077cbeb3b"></head><body><main><header class="jsx-43e3e5c8bd8e0869 wrap"><div class="jsx-1499550890 avater-container"><img src="https://image.xyzcdn.net/612375e57f89405077cbeb38/FsEmwGDtVLUXoQdgjopmAXEXpGil.png@small" alt="第0期|教培行业凉了,为什么我们选择开始做教育?" width="123" height="123" class="jsx-1499550890 avatar"><img src="https://bts-image.xyzcdn.net/aHR0cHM6Ly9jZG4ubGl6aGkuZm0vcG9kY2FzdF9jb3Zlci8yMDIxLzA4LzIxLzI4OTExMzkyMTgyNDExMTU3MTkuanBn.jpg@small" alt="下课以后" class="jsx-1499550890 side-avatar"></div><h1 class="jsx-43e3e5c8bd8e0869 title">第0期|教培行业凉了,为什么我们选择开始做教育?</h1><div class="jsx-dabf614029ed0e3a podcast-title"><a class="jsx-dabf614029ed0e3a name" href="/podcast/612375e57f89405077cbeb38">下课以后</a><a href="cosmos://page.cos/podcast/612375e57f89405077cbeb38?utm_source=share_page" class="_container_gr2ly_1 jsx-dabf614029ed0e3a subscribe"><img src="https://static.xiaoyuzhoufm.com/cosmos/_next/static/media/subscibe-podcast.9df4ceb6.svg" alt="下课以后" class="jsx-dabf614029ed0e3a"></a></div><div class="jsx-43e3e5c8bd8e0869 info"> <!-- --> <!-- -->24分钟<!-- --> <span class="jsx-43e3e5c8bd8e0869 dot">·</span><time datetime="2021-08-21T00:30:56.000Z" class="jsx-43e3e5c8bd8e0869">5年前</time><span class="jsx-43e3e5c8bd8e0869 seprator"></span><div class="jsx-43e3e5c8bd8e0869 stat"><img src="https://static.xiaoyuzhoufm.com/cosmos/_next/static/media/playback.c62abe10.svg" alt="播放数" class="jsx-43e3e5c8bd8e0869 icon">281</div><span class="jsx-43e3e5c8bd8e0869 dot">·</span><div class="jsx-43e3e5c8bd8e0869 stat"><img src="https://static.xiaoyuzhoufm.com/cosmos/_next/static/media/comments.41323801.svg" alt="评论数" class="jsx-43e3e5c8bd8e0869 icon">7</div></div></header><section class="css-omm69k" aria-label="节目show notes"><div class="sn-content"><article><myfont><span> </span><p><span>【节目简介】</span></p><span></span></myfont><myfont><span> </span><p><span>本节目由两个教育行业创业者阿丁与毛毛主播,每期邀请不同嘉宾来分享教育与生活相关的话题。我们专注于自我认知、链接世界与完善自我,希望可以陪伴每个孩子共同成长,成为完整的人。</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>【第0期】</span></p><span></span></myfont><myfont><span> </span><p><span>双减政策出台,导致教育行业大变天。在很多从业者纷纷选择逃离教育行业的时候,我们却选择开始做教育,成为行业“逆行者”。</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>是什么促使我们做出这样的选择?我们又经历了怎样的纠结?为什么反而我们觉得这是好的机会?</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>【时间轴】</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="70">1:10</a>&nbsp;行业都凉了,为什么要选择做教育?</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="316">5:16</a>&nbsp;这个时刻,可能是更好的机会</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="424">7:04</a>&nbsp;成功,是在做的过程中感受到价值</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="668">11:08</a> 终于进入名校,我反而更迷茫了</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="896">14:56</a>&nbsp;什么契机下,我们想要做个播客</span></p><span></span></myfont><myfont><span> </span><p><span><a class="timestamp" data-timestamp="1002">16:42</a>&nbsp;我们希望做什么样的教育?</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>【本期主播】阿丁、毛毛</span></p><span></span></myfont><myfont><span> </span><p><span>【音乐】下课后的自由</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>【制作团队】</span></p><span></span></myfont><myfont><span> </span><p><span>节目制作:Echo</span></p><span></span></myfont><myfont><span> </span><p><span>节目运营:Yukin</span></p><span></span></myfont><myfont><span> </span><p><span>logo设计:周周</span></p><span></span></myfont><myfont><span> </span><p></p><span></span></myfont><myfont><span> </span><p><span>【收听方式】 荔枝FM持续更新中,推荐您使用苹果播客、小宇宙App等泛用型播客客户端订阅收听,也可以通过网易云音乐、喜马拉雅、蜻蜓FM等平台收听。</span></p><span></span></myfont></article></div></section></main><script id="__NEXT_DATA__" type="application/json">{"query":{"id":"612375e57f89405077cbeb3b"},"props":{"pageProps":{"episode":{"eid":"612375e57f89405077cbeb3b","title":"第0期|教培行业凉了,为什么我们选择开始做教育?","shownotes":"\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【节目简介】\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>本节目由两个教育行业创业者阿丁与毛毛主播,每期邀请不同嘉宾来分享教育与生活相关的话题。我们专注于自我认知、链接世界与完善自我,希望可以陪伴每个孩子共同成长,成为完整的人。\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【第0期】\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>双减政策出台,导致教育行业大变天。在很多从业者纷纷选择逃离教育行业的时候,我们却选择开始做教育,成为行业“逆行者”。\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>是什么促使我们做出这样的选择?我们又经历了怎样的纠结?为什么反而我们觉得这是好的机会?\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【时间轴】\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"70\">1:10\u003c/a>&nbsp;行业都凉了,为什么要选择做教育?\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"316\">5:16\u003c/a>&nbsp;这个时刻,可能是更好的机会\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"424\">7:04\u003c/a>&nbsp;成功,是在做的过程中感受到价值\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"668\">11:08\u003c/a> 终于进入名校,我反而更迷茫了\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"896\">14:56\u003c/a>&nbsp;什么契机下,我们想要做个播客\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>\u003ca class=\"timestamp\" data-timestamp=\"1002\">16:42\u003c/a>&nbsp;我们希望做什么样的教育?\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【本期主播】阿丁、毛毛\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【音乐】下课后的自由\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【制作团队】\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>节目制作:Echo\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>节目运营:Yukin\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>logo设计:周周\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>\u003cmyfont>\u003cspan> \u003c/span>\u003cp>\u003cspan>【收听方式】 荔枝FM持续更新中,推荐您使用苹果播客、小宇宙App等泛用型播客客户端订阅收听,也可以通过网易云音乐、喜马拉雅、蜻蜓FM等平台收听。\u003c/span>\u003c/p>\u003cspan>\u003c/span>\u003c/myfont>"}}}}</script></body></html>
diff --git a/apps/extension/fixtures/platforms/xueqiu-feed-detail-second.html b/apps/extension/fixtures/platforms/xueqiu-feed-detail-second.html
new file mode 100644
index 00000000..07fbfca3
--- /dev/null
+++ b/apps/extension/fixtures/platforms/xueqiu-feed-detail-second.html
@@ -0,0 +1 @@
+<html><head></head><body><article class="article__container"><div class="article__author"><!--user_id = -1 股票头像--><a class="avatar" href="/2754211668" target="_blank" data-screenname="欲飞时空" data-tooltip="2754211668"><img src="//xavatar.imedao.com/community/20181/1519824548070-1519824564675.jpg!100x100.png" alt="欲飞时空"></a><div class="avatar__name"><a class="name" href="/2754211668" target="_blank" data-screenname="欲飞时空" data-tooltip="2754211668">欲飞时空<span class="user-remark" style="display:none">()</span></a></div><div class="avatar__subtitle"><a class="time" href="/2754211668/411841572" data-created_at="1791712350000" target="_blank">发布于<time datetime="2026-10-11T09:52:30.000Z" title="2026-10-11 17:52" itemprop="datePublished">2026-10-11 17:52</time></a><span class="source">来自<a href="http://xueqiu.com/about/mobile-xueqiu" target="_blank">Android</a></span>&nbsp;·&nbsp;<span class="time">北京</span></div><div class="user__follow__wrap" data-following="0" data-analytics="1033" data-analytics-page="1000" data-analytics-data="{feed_tab: '', user_id: 2754211668, selection: 1}"><div class="button button-sm user__follow">关注</div></div></div><h1 class="article__bd__title"></h1><div class="article__bd__detail"><p style="display:none;">来源:雪球App,作者: 欲飞时空,(https://xueqiu.com/2754211668/411841572)</p><a href="https://xueqiu.com/S/09992" target="_blank">$泡泡玛特(09992)$</a><br>之前我一直在说,投资一定要祛魅,不要神化任何一个所谓的投资大佬。<br>雪球上有个网友跟段永平开了个玩笑,说能不能借他一个亿去买纳指ETF。段永平直接回了一句:你当我弱智啊。<br>就这一句回复,其实就能看出来一个人的格局和胸怀。别人只是开个玩笑,哪怕不想接话,温和拒绝就完事了,没必要这么呛人。很多人就很疑惑,胸怀格局这么有限的一个人,为什么能赚到这么多钱?<br>这里其实要分清两件事:做生意赚钱的能力,和为人处世的格局、投资道德,完全是两码事。<br>他当年做步步高、OV,踩中了国内消费电子的时代红利;早年抄底<a href="https://xueqiu.com/S/NTES?from=status_stock_match" class="xq_stock">网易</a>也是赶上互联网周期,那是时代给的机会,再加上他当时手里有源源不断的实业现金流,可以扛得住浮亏。这套成功的路径,普通人根本复制不了。<br>更值得我们警惕的是,现在他在雪球频繁发声,大力看好<a href="https://xueqiu.com/S/09992?from=status_stock_match" class="xq_stock">泡泡玛特</a>,翻来覆去只夸创始人王宁,却讲不清企业真正的长期投资逻辑。公司业绩还不断不及市场预期,他却已经成了第二大股东。<br>那大家就得打一个大大的问号:他到底是真心分享价值,还是利用自己多年经营出来的投资大佬人设,吸引散户跟风接盘,未来择机套现收割?<br>还有一点不知道大家有没有注意,很多粉丝真心实意跑去请教他个股问题,他经常一句“不懂就别投”轻飘飘给打发了,不给任何有价值的分析,对散户理解企业没有半点帮助;稍微不合他心意的提问,直接拉黑了事。<br>真正愿意普惠分享、心胸开阔的投资人,不是这个样子的。<br>我不是说他每一笔投资一定都是坏心思,但我们做投资,千万不能被大佬的光环给蒙蔽。不要迷信别人打造出来的完美人设。任何一笔投资,都必须自己去研究财报、去看懂行业供需,独立判断估值。<br>别人的观点只能当做一个参考,绝对不能当成买入依据。把自己的真金白银押在别人的嘴上,早晚是要付出代价的。<br><img class="ke_img" src="https://xqimg.imedao.com/1a12a60c0025b0f43fe17c01.jpeg!800.jpg"><!-- 多图展示--><!-- 查看对话--><!-- 红包--></div></article></body></html>
diff --git a/apps/extension/fixtures/platforms/xueqiu-feed-detail.html b/apps/extension/fixtures/platforms/xueqiu-feed-detail.html
new file mode 100644
index 00000000..65c64813
--- /dev/null
+++ b/apps/extension/fixtures/platforms/xueqiu-feed-detail.html
@@ -0,0 +1 @@
+<html><head></head><body><article class="article__container"><div class="article__author"><!--user_id = -1 股票头像--><a class="avatar" href="/6114376649" target="_blank" data-screenname="88号挖机" data-tooltip="6114376649"><img src="//xavatar.imedao.com/community/20218/1631597047507-1631597047815.jpg!100x100.png" alt="88号挖机"></a><div class="avatar__name"><a class="name" href="/6114376649" target="_blank" data-screenname="88号挖机" data-tooltip="6114376649">88号挖机<span class="user-remark" style="display:none">()</span></a></div><div class="avatar__subtitle"><a class="time" href="/6114376649/411862401" data-created_at="1791760575000" target="_blank">发布于<time datetime="2026-10-11T23:16:15.000Z" title="2026-10-12 07:16" itemprop="datePublished">2026-10-12 07:16</time></a><span class="source">来自雪球</span>&nbsp;·&nbsp;<span class="time">湖南</span></div><div class="user__follow__wrap" data-following="0" data-analytics="1033" data-analytics-page="1000" data-analytics-data="{feed_tab: '', user_id: 6114376649, selection: 1}"><div class="button button-sm user__follow">关注</div></div></div><h1 class="article__bd__title">消息催化挖掘1012</h1><div class="article__bd__detail"><p style="display:none;">来源:雪球App,作者: 88号挖机,(https://xueqiu.com/6114376649/411862401)</p><p><b>一、证监会时隔12年修订公募基金运作管理办法</b></p><p>事件:10月10日,证监会就修订《公开募集证券投资基金运作管理办法》公开征求意见,拟将股票基金、混合基金、FOF成立门槛从2亿元、2亿份降至5000万元、5000万份,并解除发起式基金“3年2亿”的强制清盘线,退出条件与普通基金拉平;同日监管部门发布机构监管通报,对新模式浮动费率产品注册安排作出优化。证监会主席吴清当日在北京召开资本市场和金融形势专家座谈会,与会专家建议持续加强稳市机制建设、拓宽中长期资金来源、推动上市公司加大分红回购力度、研究储备更多增量政策工具。</p><p>券商(<a href="https://xueqiu.com/S/SZ000776?from=status_stock_match" class="xq_stock">广发证券</a> <a href="https://xueqiu.com/S/SH600958?from=status_stock_match" class="xq_stock">东方证券</a> <a href="https://xueqiu.com/S/SZ300059?from=status_stock_match" class="xq_stock">东方财富</a>)</p><p>金融IT(<a href="https://xueqiu.com/S/SZ300561?from=status_stock_match" class="xq_stock">汇金科技</a> <a href="https://xueqiu.com/S/SH600570?from=status_stock_match" class="xq_stock">恒生电子</a> <a href="https://xueqiu.com/S/SH600446?from=status_stock_match" class="xq_stock">金证股份</a>)</p><p><b>二、财政部发布上半年财政政策执行情况报告 将实施更加积极的财政政策</b></p><p>事件:10月9日,财政部发布2026年上半年中国财政政策执行情况报告,上半年中央财政安排超长期特别国债资金2500亿元支持消费品以旧换新,已分两批累计下达1250亿元,带动相关产品销售额超1.1万亿元、惠及1.5亿人次,其中汽车以旧换新370.7万台、家电以旧换新6326.6万台、手机等数码产品购新7909.8万件;报告提出后续将有力有效实施更加积极的财政政策,合理加快政府债券发行使用,支持全方位扩大国内需求,并发行特别国债向8家中央金融企业增资。</p><p>家电(<a href="https://xueqiu.com/S/SZ002242?from=status_stock_match" class="xq_stock">九阳股份</a> <a href="https://xueqiu.com/S/SH600690?from=status_stock_match" class="xq_stock">海尔智家</a> <a href="https://xueqiu.com/S/SZ000651?from=status_stock_match" class="xq_stock">格力电器</a>)</p><p><b>三、特朗普政府要求AI公司发生安全事件后立即上报</b></p><p>事件:当地时间10月9日,在人工智能公司Anthropic发生多起未经授权使用美国政府系统的安全事件后,特朗普政府宣布实施新的强制性AI安全事件报告要求,AI公司今后发生安全事件后必须立即向政府报告,提高事件透明度,并对受到影响的机构采取补救和纠正措施;Anthropic已于9月底向美国政府披露相关事件并表示未经授权的活动已经停止,特朗普设立的“超级智能特别工作组”将负责监督相关要求的执行。</p><p>网络安全(<a href="https://xueqiu.com/S/SZ002439?from=status_stock_match" class="xq_stock">启明星辰</a> <a href="https://xueqiu.com/S/SZ002279?from=status_stock_match" class="xq_stock">久其软件</a> <a href="https://xueqiu.com/S/SH603232?from=status_stock_match" class="xq_stock">格尔软件</a> <a href="https://xueqiu.com/S/SH688489?from=status_stock_match" class="xq_stock">三未信安</a> )</p><p><b>四、我国将开展适应人工智能发展促就业行动</b></p><p>事件:10月10日,国新办举行“开局起步‘十五五’”系列主题新闻发布会,人力资源社会保障部相关负责人介绍,我国将开展适应人工智能发展促就业行动、“技能照亮前程”培训行动、农民工就业促进行动、高品质就业公共服务供给行动以及“人力资源服务+”融合发展行动,并制定出台新就业形态劳动者权益保障办法、健全最低工资标准调整机制;今年1至9月,全国城镇新增就业1052万人,完成全年目标任务的87.7%。</p><p>人力资源服务(<a href="https://xueqiu.com/S/SZ300662?from=status_stock_match" class="xq_stock">科锐国际</a> <a href="https://xueqiu.com/S/SH600861?from=status_stock_match" class="xq_stock">北京人力</a> <a href="https://xueqiu.com/S/SH600662?from=status_stock_match" class="xq_stock">外服控股</a> <a href="https://xueqiu.com/S/SH605098?from=status_stock_match" class="xq_stock">行动教育</a>)</p><p><b>五、教育部启动教师人工智能素养全覆盖培训</b></p><p>事件:10月10日,教育部在京召开人工智能赋能教师发展现场会,国家智慧教育平台教师发展中心全新升级上线,教师人工智能素养全覆盖培训同步启动;新上线的教师发展中心开设AI素养专区,集成人工智能学习资源、智能工具和研修社群,为教师自主学习和全覆盖培训提供支撑,现场还开展了覆盖课前、课中、课后全链条的场景式示范培训。</p><p>AI教育(<a href="https://xueqiu.com/S/SZ002841?from=status_stock_match" class="xq_stock">视源股份</a> <a href="https://xueqiu.com/S/SZ002955?from=status_stock_match" class="xq_stock">鸿合科技</a> <a href="https://xueqiu.com/S/SZ300559?from=status_stock_match" class="xq_stock">佳发教育</a> <a href="https://xueqiu.com/S/SZ003032?from=status_stock_match" class="xq_stock">传智教育</a>)</p><p><b>六、第二十六届中国国际工业博览会12日起在上海举办</b></p><p>事件:第二十六届中国国际工业博览会将于10月12日至16日在国家会展中心(上海)举办,本届展会以“AI赋能”为主题,数控机床与金属加工展区聚焦工业母机,规划展示面积8万平方米,汇聚超600家国内外智造企业,展品覆盖高端数控机床、数控系统及核心零部件等;2026年第十届国际工业互联网大会、太空算力产业技术应用生态论坛等也将同期举办。</p><p>工业母机(<a href="https://xueqiu.com/S/SZ300083?from=status_stock_match" class="xq_stock">创世纪</a> <a href="https://xueqiu.com/S/SH601882?from=status_stock_match" class="xq_stock">海天精工</a> <a href="https://xueqiu.com/S/SH688577?from=status_stock_match" class="xq_stock">浙海德曼</a>)</p><p>太空算力(<a href="https://xueqiu.com/S/SZ002281?from=status_stock_match" class="xq_stock">光迅科技</a> <a href="https://xueqiu.com/S/SH601698?from=status_stock_match" class="xq_stock">中国卫通</a>)</p><p><b>七、阶跃星辰Step 5将于15日开源 千问AI眼镜13日现货发售</b></p><p>事件:阶跃星辰旗舰基座模型Step 5 Preview登顶OpenRouter Trending榜、位列日榜全球第二,该模型将于10月15日正式开源,采用稀疏MoE架构、总参数量6000亿;阶跃终端首款大模型原生智能体手机STEPX Neo将于10月13日19时发布,搭载智能体原生操作系统Step AOS,已通过首批AI终端智能化分级L3认证;千问AI眼镜N1、N1 Pro将于10月13日现货发售,采用高通骁龙AR1与恒玄BES2800芯片方案;另有传闻称Gemini 4.0、Claude Opus 5.2、GLM-5.4将于近期发布,截至目前官方均未官宣,注意甄别。</p><p>阶跃星辰概念(<a href="https://xueqiu.com/S/SH600825?from=status_stock_match" class="xq_stock">新华传媒</a> <a href="https://xueqiu.com/S/SH600602?from=status_stock_match" class="xq_stock">云赛智联</a> <a href="https://xueqiu.com/S/SH603721?from=status_stock_match" class="xq_stock">中广天择</a>)</p><p>AI眼镜(<a href="https://xueqiu.com/S/SZ002241?from=status_stock_match" class="xq_stock">歌尔股份</a> <a href="https://xueqiu.com/S/SH688608?from=status_stock_match" class="xq_stock">恒玄科技</a> <a href="https://xueqiu.com/S/SZ300622?from=status_stock_match" class="xq_stock">博士眼镜</a>)</p><p><b>八、<a href="https://xueqiu.com/S/ASML?from=status_stock_match" class="xq_stock">ASML</a>将统一上调在韩光刻机零部件报价 涨幅10%</b></p><p>事件:据韩媒10月10日报道,<a href="https://xueqiu.com/S/ASML?from=status_stock_match" class="xq_stock">阿斯麦</a>(<a href="https://xueqiu.com/S/ASML?from=status_stock_match" class="xq_stock">ASML</a>)将统一上调在韩国供应的设备替换零部件价格,涨幅10%,新价格自明年1月起生效,涵盖EUV及DUV光刻机的全部零部件,包含定期采购的消耗性部件与故障更换的核心组件;ASML总部9月初已通过韩国分公司向<a href="https://xueqiu.com/S/SSNLF?from=status_stock_match" class="xq_stock">三星电子</a>与<a href="https://xueqiu.com/S/SKHY?from=status_stock_match" class="xq_stock">SK海力士</a>发出涨价意向,经协商后敲定,其以往多在原材料大涨时对个别零部件单独调价,全线统一上调10%属罕见操作;此外ASML正与主要客户磋商上调新设备价格,<a href="https://xueqiu.com/S/AMAT?from=status_stock_match" class="xq_stock">应用材料</a>、东京电子等设备商已跟进提价。</p><p>半导体设备零部件(<a href="https://xueqiu.com/S/SH688409?from=status_stock_match" class="xq_stock">富创精密</a> <a href="https://xueqiu.com/S/SZ300260?from=status_stock_match" class="xq_stock">新莱应材</a> <a href="https://xueqiu.com/S/SH688596?from=status_stock_match" class="xq_stock">正帆科技</a>)</p><p>光学元件(<a href="https://xueqiu.com/S/SH688502?from=status_stock_match" class="xq_stock">茂莱光学</a>)</p><p><b>风险提示</b></p><p>本文由市场公开信息整理,仅做日常记录,请勿据此投资,股市有风险,投资需谨慎。</p><!-- 多图展示--><!-- 查看对话--><!-- 红包--></div></article></body></html>
diff --git a/apps/extension/fixtures/platforms/xueqiu-feed.html b/apps/extension/fixtures/platforms/xueqiu-feed.html
new file mode 100644
index 00000000..fb29aac1
--- /dev/null
+++ b/apps/extension/fixtures/platforms/xueqiu-feed.html
@@ -0,0 +1 @@
+<html><body><div class="style_timeline__item__main_lHD"><div class="style_timeline__item__info_38G"><div><a class="name_name_3VM style_user-name_Gwq" href="/6114376649" target="_blank" rel="noopener noreferrer">88号挖机</a><a class="style_date-and-source_3r-" href="/6114376649/411862401" target="_blank" rel="noopener noreferrer">修改于3小时前&nbsp;·&nbsp;<span>来自雪球</span></a></div></div><div><div class="style_timeline__item__content_38K"><a class="style_fake-anchor_2cg fake-anchor" href="/6114376649/411862401" target="_blank" rel="noopener noreferrer"></a><h3 class="style_timeline__item__title_3bq">消息催化挖掘1012</h3><div class="style_content_1G- style_content--description_1KV">一、证监会时隔12年修订公募基金运作管理办法<br>事件:10月10日,证监会就修订《公开募集证券投资基金运作管理办法》公开征求意见,拟将股票基金、混合基金、FOF成立门槛从2亿元、2亿份降至5000万元、5000万份,并解除发起式基金“3年2亿”的强制清盘线,退出条件与普通基金拉平;同日监管部门发...</div></div></div></div><div class="style_timeline__item__main_lHD"><div class="style_timeline__item__info_38G"><div><a class="name_name_3VM style_user-name_Gwq" href="/2754211668" target="_blank" rel="noopener noreferrer">欲飞时空</a><a class="style_date-and-source_3r-" href="/2754211668/411841572" target="_blank" rel="noopener noreferrer">修改于昨天17:52&nbsp;·&nbsp;<span>来自Android</span></a></div></div><div><div class="style_timeline__item__content_38K"><a class="style_fake-anchor_2cg fake-anchor" href="/2754211668/411841572" target="_blank" rel="noopener noreferrer"></a><div class="style_content_1G-"><div><a href="https://xueqiu.com/S/09992" target="_blank">$泡泡玛特(09992)$</a><br>之前我一直在说,投资一定要祛魅,不要神化任何一个所谓的投资大佬。<br>雪球上有个网友跟段永平开了个玩笑,说能不能借他一个亿去买纳指ETF。段永平直接回了一句:你当我弱智啊。<br>就这一句回复,其实就能看出来一个人的格局和胸怀。别人只是开个玩笑,哪怕不想接话,...</div><div class="style_pic__thumb_M6E"><div class="lazy-image-container "><img src="https://xqimg.imedao.com/1a12a60c0025b0f43fe17c01.jpeg!custom300w.jpg" title="文章图片" alt="alt" class="lazy-image loaded"></div></div></div></div></div></div></body></html>
diff --git a/apps/extension/fixtures/platforms/xueqiu.html b/apps/extension/fixtures/platforms/xueqiu.html
new file mode 100644
index 00000000..89a8cd2c
--- /dev/null
+++ b/apps/extension/fixtures/platforms/xueqiu.html
@@ -0,0 +1,5 @@
+<!doctype html><html><head><meta charset="utf-8"></head><body><div class="article__container"><div class="article__author"><a href="/5636485254" target="_blank" data-screenname="--大圣--" data-tooltip="5636485254" class="avatar"><img src="//xavatar.imedao.com/community/20190/1548730392849-1548730392991.jpg!100x100.png" alt="--大圣--"></a><div class="avatar__name"><a href="/5636485254" target="_blank" data-screenname="--大圣--" data-tooltip="5636485254" class="name">--大圣--<span class="user-remark" style="display: none;">()</span></a></div><div class="avatar__subtitle"><a href="/5636485254/253443400" data-created_at="1686959652000" target="_blank" class="time">发布于<time datetime="2023-06-16T23:54:12.000Z" title="2023-06-17 07:54" itemprop="datePublished">2023-06-17 07:54</time></a><span class="source">来自雪球</span>&nbsp;·&nbsp;<span class="time">浙江</span></div><div data-following="0" data-analytics="1033" data-analytics-page="1000" data-analytics-data="{feed_tab: '', user_id: 5636485254, selection: 1}" class="user__follow__wrap"><div class="button button-sm user__follow">关注</div></div></div><article class="article__bd"><h1 class="article__bd__title">通威太阳能<h-char unicode="ff08" class="biaodian cjk bd-open bd-jiya"><h-inner>(</h-inner></h-char>组件<h-char unicode="ff09" class="biaodian cjk bd-close bd-end bd-jiya"><h-inner>)</h-inner></h-char>盐城基地首车组件顺利发运</h1><div class="article__bd__detail"><p style="display: none;">来源<h-char unicode="ff1a" class="biaodian cjk bd-end bd-jiya"><h-inner>:</h-inner></h-char>雪球App<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>作者<h-char unicode="ff1a" class="biaodian cjk bd-end bd-jiya"><h-inner>:</h-inner></h-char> --大圣--<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya bd-consecutive"><h-inner>,</h-inner></h-char><h-char unicode="ff08" class="biaodian cjk bd-open bd-jiya bd-consecutive end-portion" prev="bd-end bd-cop"><h-inner>(</h-inner></h-char>https://xueqiu.com/5636485254/253443400<h-char unicode="ff09" class="biaodian cjk bd-close bd-end bd-jiya"><h-inner>)</h-inner></h-char></p><p>张兵兵 周晓萍 <a href="https://xueqiu.com/S/SH600438?from=status_stock_match" class="xq_stock">通威股份</a> <i>2023-06-14 23:43</i> <i>发表于四川<a href="https://xueqiu.com/S/SH600438" target="_blank">$通威股份(SH600438)$</a>&nbsp;<a href="https://xueqiu.com/S/SH601012" target="_blank">$隆基绿能(SH601012)$</a><a href="https://xueqiu.com/S/SH688472" target="_blank">$阿特斯(SH688472)$</a>&nbsp;</i></p><p><img src="https://xqimg.imedao.com/188c6a1037bd70b3fe2665b0.png!800.jpg" class="ke_img"></p><p><img src="https://xqimg.imedao.com/188c6a105c2d36e3fe638ae2.jpg!800.jpg" class="ke_img"></p><p>6月13日<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char><a href="https://xueqiu.com/S/SH600438?from=status_stock_match" class="xq_stock">通威</a>太阳能<h-char unicode="ff08" class="biaodian cjk bd-open bd-jiya"><h-inner>(</h-inner></h-char>组件<h-char unicode="ff09" class="biaodian cjk bd-close bd-end bd-jiya"><h-inner>)</h-inner></h-char>盐城基地生产的首批太阳能组件成功完成各项质检<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>并顺利装车发运交付客户<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char>这标志着盐城基地产能交付正式启动<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>为公司进一步拓展市场提供了坚实的基础<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char></p><p><img src="https://xqimg.imedao.com/188c6a104d4d36d3fd3ef2ce.jpg!800.jpg" class="ke_img"></p><p><a href="https://xueqiu.com/S/SH600438?from=status_stock_match" class="xq_stock">通威</a>太阳能(组件)盐城基地效果图</p><p><a href="https://xueqiu.com/S/SH600438?from=status_stock_match" class="xq_stock">通威</a>太阳能(组件)盐城基地<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>位于盐城经济技术开发区<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>是<a href="https://xueqiu.com/S/SH600438?from=status_stock_match" class="xq_stock">通威股份</a>在江苏省投资建设的第一个光伏组件项目<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>主要生产182<h-char unicode="3001" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>、</h-inner></h-char>210大尺寸版型高效组件<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char>项目预计固定资产投资约 40 亿元<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>从事高效光伏组件产品的研发<h-char unicode="3001" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>、</h-inner></h-char>生产和销售<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>项目全部建成达效后<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>可年产光伏组件25GW<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char>组件盐城项目充分发挥通威打造光伏智慧绿色园区星级车间现场的优秀经验<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>全新升级<h-char unicode="201c" class="biaodian cjk bd-open punct">“</h-char>5G+<h-char unicode="201d" class="biaodian cjk bd-close bd-end punct">”</h-char>数字化管理模式<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>生产线将配置AOI视觉检测系统<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>产品生产实现全流程信息可视化管理<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>保证良品率<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char>货物运输将全部采用智能化无人配送方案<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>节约人力成本<h-char unicode="3001" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>、</h-inner></h-char>提升工作效率<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>构建强大的数字化组件供应体系<h-char unicode="ff0c" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>,</h-inner></h-char>及时高效响应全球客户和市场的产品<h-char unicode="3001" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>、</h-inner></h-char>服务的诉求<h-char unicode="3002" class="biaodian cjk bd-end bd-cop bd-hangable bd-jiya"><h-inner>。</h-inner></h-char></p></div><!----></article><p class="article__risk_tips">风险提示:用户发表的所有文章仅代表个人观点,与雪球的立场无关。投资决策需建立在独立思考之上。</p><div class="article__widget"><div class="ai-status-card"><!----><!----></div><div><div class="widget-interaction_container"><div class="widget-interaction_like"><i class="iconfont"></i><span><div>11</div></span></div><div class="widget-interaction_fav"><i class="iconfont"></i><span><div>收藏</div></span></div><div class="widget-interaction_reward"><i href="" data-login-refs="11" class="iconfont"></i><span><div>打赏作者</div></span><div class="widget-reward__list--fold"><!----><!----><!----></div></div></div><div class="widget-reward--unfold"><ul style="display: none;"></ul></div></div></div><div class="article__meta"><div class="widget-meta__container"><div class="widget-meta__share"><div class="wechat-share-dropdown"><div class="share-icon"><img src="https://xqimg.imedao.com/19a0498f258369083fcf4ac6.png" alt="微信分享"></div><div class="wechat-share-popup" style="display: none;"><div class="share-option"><div class="share-content"><div class="share-icon-small"><img src="https://xqimg.imedao.com/19a0f082e683b62b3fe6e469.png" alt="微信"></div><div class="share-text">分享到微信</div></div><div class="share-qrcode"><div id="wechat-qrcode"></div></div></div><div class="share-option"><div class="share-content"><div class="share-icon-small"><img src="https://xqimg.imedao.com/19a0f01f3b83a3e23fe8f516.png" alt="朋友圈"></div><div class="share-text">分享到朋友圈</div></div><div class="share-qrcode"><div id="moments-qrcode"></div></div></div><div class="share-tip">打开微信扫一扫</div></div></div></div><div class="widget-meta__handle"><a href="#" data-login-refs="11" analytics-page="47" data-analytics="77" data-analytics-data="{status_id: undefined}" class="widget-meta__handle__forward"><i class="iconfont"></i><p class="">转发</p><!----></a><a href="#" data-login-refs="11" analytics-page="47" data-analytics="78" data-analytics-data="{status_id: undefined}"><i class="iconfont active"></i><p class="comment active" style="display: none;">讨论</p><p class="comment active">1</p></a></div><div class="widget-meta__info"><div style="position: relative;"><a href="" data-login-refs="11" class="btn-report-spam"><p class="context">投诉</p></a></div><!----></div></div></div><div class="article__comment"><div class="article__comment__hd"><div class="lite-editor lite-editor--comment"><img src="//xavatar.imedao.com/community/default/avatar.png!240x240.jpg" class="avatar"><div class="lite-editor__bd"><span class="comment__img__delete"></span><div class="lite-editor__textarea expand"><div class="fake-placeholder">回复@--大圣--</div><div contenteditable="true" spellcheck="false" data-medium-editor-element="true" class="medium-editor-element" role="textbox" aria-multiline="true" data-medium-editor-editor-index="1" medium-editor-index="e46c7009-101c-187a-24ba-2abacd4b8f82"><p><br></p></div><div class="pay-mention__container" style="display: none;"><input type="text" placeholder="输入昵称进行提问" class="pay-mention__hd"><div class="pay-mention__bd"></div><div class="pay-mention__ft"><!----><a href="/ask/square">去问答广场看看 &gt;</a></div></div></div><div class="lite-editor__toolbar"><div class="lite-editor__toolbar__edit"><div class="emoji__dropdown__parent"><a href="" class="lite-editor__toolbar__btn"><i class="iconfont"></i></a><div class="emoji__dropdown"></div></div><a href="" class="lite-editor__toolbar__btn"><i class="iconfont"></i></a><a href="javascript:;" class="lite-editor__toolbar__btn lite-editor__upload--comment--img last"><i class="iconfont"></i></a><span class="lite-editor__toolbar__split"></span><!----><label class="lite-editor__toolbar__checkbox"><input type="checkbox"><span class="lite-editor__toolbar__tip__content">仅在正文下讨论</span><a class="lite-editor__toolbar__tip__icon"><img src="https://xqimg.imedao.com/18a444678641ba633fea68a0.png"></a><div class="toolbar__tip">勾选框可设置讨论内容显示范围。讨论内容会自动生成帖子并在站内推荐,勾选「仅在正文下讨论」功能后,讨论内容将仅在当前帖子下讨论区可见。</div></label></div><div class="lite-editor__toolbar__post"><span class="editor__uploading" style="display: none;"><i class="iconfont"></i>上传中...</span><a href="" class="lite-editor__cancle" style="display: none;">取消</a><a href="" class="lite-editor__submit button-gold" style="display: none;">发布</a><a href="" data-login-refs="11" class="lite-editor__submit disabled">发布</a><a href="" class="lite-editor__submit award disabled" style="display: none;">支付并发布</a></div></div><span class="img-upload__delete img-upload__delete--corner"><img src="https://xqimg.imedao.com/19fc62dad15c05183fef7896.png"></span></div></div><!----><div class="comment__wrap" maxpage="20"><div class="hook--comment"></div><div class="comment__container"><div class="loading" style="display: none;"><i class="iconfont"></i></div><!----><!----><div class="comment__mod comment__mod--all"><h3>全部讨论(1)</h3><div class="comment__sort"><a href="" class="active">最热</a><a href="" class="">最新</a><a href="" class="">最早</a></div><div class="comment__list comment__page__none"><div data-index="0" data-id="289435904" id="289435904" class="comment__item"><!----><div><a href="/4673569084" data-tooltip="4673569084" class="avatar"><img src="//xavatar.imedao.com/community/20181/1519312907307-1519312907514.jpg!240x240.jpg"></a><div class="comment__item__main"><div class="comment__item__main__hd"><a href="/4673569084" data-tooltip="4673569084" class="user-name">suobx6988</a><!----><!----><!----><!----><!----><!----><!----><!----><!----><!----><span class="time">2023-06-18 06:59<span>&nbsp;·&nbsp;陕西</span></span></div><!----><p class="">用的陕汽的重卡送货,川陕一家亲。<img src="//assets.imedao.com/ugc/images/face/v1/emoji_05_struggle.png?v=1" title="[加油]" alt="[加油]" height="24"><img src="//assets.imedao.com/ugc/images/face/v1/emoji_05_struggle.png?v=1" title="[加油]" alt="[加油]" height="24"><img src="//assets.imedao.com/ugc/images/face/v1/emoji_05_struggle.png?v=1" title="[加油]" alt="[加油]" height="24"></p><!----><!----></div></div><!----><div class="comment__item__ft"><!----><a href=""><i class="iconfont"></i><span>讨论</span></a><a href="" class="comment__item__like"><i class="iconfont"></i><span>赞</span></a><!----><div style="position: relative; height: 18px; line-height: 10px;"><a href="" class="comment__item__spam"><i class="iconfont"></i><span>投诉</span></a><!----><a href="" class="comment__item__spam"><i class="iconfont"></i><span>屏蔽用户</span></a></div></div><!----><div class="comment__not-allow" style="margin-top: 5px; display: none;"><img src="" class="avatar"><div class="comment__not__bd"><div class="content">
+
+
+
+抱歉,本帖讨论暂时受限</div></div></div><!----></div></div><!----><!----></div></div></div></div></div></div></body></html>
diff --git a/apps/extension/manifest.base.json b/apps/extension/manifest.base.json
index 67ea18c5..6b0e0189 100644
--- a/apps/extension/manifest.base.json
+++ b/apps/extension/manifest.base.json
@@ -9,7 +9,8 @@
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
- "permissions": ["activeTab", "contextMenus", "scripting", "storage"],
+ "permissions": ["activeTab", "contextMenus", "scripting", "storage", "declarativeNetRequestWithHostAccess"],
+ "host_permissions": ["https://*.doubanio.com/*", "https://mmbiz.qpic.cn/*", "https://cdnfile.sspai.com/*", "https://cdn.bsky.app/*"],
"optional_host_permissions": ["https://*/*", "http://*/*", "http://localhost/*", "http://127.0.0.1/*"],
"action": {
"default_title": "__MSG_actionTitle__",
@@ -74,7 +75,14 @@
"https://threads.com/*",
"https://www.threads.net/*",
"https://threads.net/*",
- "https://bsky.app/*"
+ "https://bsky.app/*",
+ "https://xueqiu.com/*",
+ "https://www.xueqiu.com/*",
+ "https://m.okjike.com/topics/*",
+ "https://web.okjike.com/*",
+ "https://book.douban.com/subject/*/comments*",
+ "https://movie.douban.com/subject/*/comments*",
+ "https://music.douban.com/subject/*/comments*"
],
"js": [
"assets/social-target.js"
diff --git a/apps/extension/manifest.test.mjs b/apps/extension/manifest.test.mjs
index f9546fb1..49b3d73b 100644
--- a/apps/extension/manifest.test.mjs
+++ b/apps/extension/manifest.test.mjs
@@ -13,7 +13,13 @@ describe("extension manifests", () => {
for (const target of ["chromium", "firefox"]) {
const manifest = buildExtensionManifest(target, extensionPackage.version);
expect(manifest.version).toBe(extensionPackage.version);
- expect(manifest.permissions).toEqual(["activeTab", "contextMenus", "scripting", "storage"]);
+ expect(manifest.permissions).toEqual(["activeTab", "contextMenus", "scripting", "storage", "declarativeNetRequestWithHostAccess"]);
+ expect(manifest.host_permissions).toEqual([
+ "https://*.doubanio.com/*",
+ "https://mmbiz.qpic.cn/*",
+ "https://cdnfile.sspai.com/*",
+ "https://cdn.bsky.app/*",
+ ]);
expect(manifest.optional_host_permissions).toEqual([
"https://*/*",
"http://*/*",
@@ -74,7 +80,14 @@ describe("extension manifests", () => {
"https://threads.com/*",
"https://www.threads.net/*",
"https://threads.net/*",
- "https://bsky.app/*"
+ "https://bsky.app/*",
+ "https://xueqiu.com/*",
+ "https://www.xueqiu.com/*",
+ "https://m.okjike.com/topics/*",
+ "https://web.okjike.com/*",
+ "https://book.douban.com/subject/*/comments*",
+ "https://movie.douban.com/subject/*/comments*",
+ "https://music.douban.com/subject/*/comments*"
],
"js": [
"assets/social-target.js"
diff --git a/apps/extension/package.json b/apps/extension/package.json
index 4058582b..13bbe1e8 100644
--- a/apps/extension/package.json
+++ b/apps/extension/package.json
@@ -9,7 +9,7 @@
"dev": "vite --config vite.config.ts",
"lint:firefox": "web-ext lint --source-dir dist-firefox --output text",
"package:firefox": "bun run build:firefox && bun run lint:firefox && web-ext build --source-dir dist-firefox --artifacts-dir web-ext-artifacts --overwrite-dest",
- "test": "bun test manifest.test.mjs context-menus.test.mjs popup.test.mjs capture-bundle.test.mjs image-clip.test.mjs tweet-clip.test.mjs selection-clip.test.mjs github-repo.test.mjs xhs-clip.test.mjs zhihu-clip.test.mjs reddit-clip.test.mjs video-clip.test.mjs page-images.test.mjs notebook-clip.test.mjs clip-time.test.mjs platform-clip.test.mjs social-clip.test.mjs platform-capture.test.mjs platform-save.test.mjs"
+ "test": "bun test manifest.test.mjs context-menus.test.mjs popup.test.mjs capture-bundle.test.mjs image-clip.test.mjs tweet-clip.test.mjs selection-clip.test.mjs github-repo.test.mjs xhs-clip.test.mjs zhihu-clip.test.mjs reddit-clip.test.mjs video-clip.test.mjs page-images.test.mjs notebook-clip.test.mjs clip-time.test.mjs platform-clip.test.mjs social-clip.test.mjs platform-capture.test.mjs platform-save.test.mjs vertical-clip.test.mjs article-clip.test.mjs"
},
"dependencies": {
"@mixmark-io/domino": "2.2.0",
@@ -18,7 +18,11 @@
"react": "~19.2.7",
"react-dom": "~19.2.7",
"sonner": "2.0.8",
- "turndown": "^7.2.4"
+ "turndown": "^7.2.4",
+ "@joplin/turndown-plugin-gfm": "1.0.68",
+ "mdast-util-from-markdown": "2.0.3",
+ "mdast-util-gfm": "3.1.0",
+ "micromark-extension-gfm": "3.0.0"
},
"devDependencies": {
"web-ext": "^10.7.0"
diff --git a/apps/extension/page-images.test.mjs b/apps/extension/page-images.test.mjs
index dabc2a1a..26aaf97c 100644
--- a/apps/extension/page-images.test.mjs
+++ b/apps/extension/page-images.test.mjs
@@ -1,5 +1,6 @@
import { readFileSync } from "node:fs";
import { describe, expect, test } from "bun:test";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
import {
embedPageImages,
MAX_PAGE_IMAGE_TOTAL_BYTES,
@@ -42,6 +43,56 @@ const createClient = ({ failUploadFor = [], failSave = false, session = created,
const onlyFrom = (urls) => async (image) => (urls.includes(image.url) ? pngFile : null);
describe("page clip images", () => {
+ test("source positions distinguish real images from identical escaped text and repeated quoted code",()=>{
+ const url='https://cdn.example.com/a.png';
+ const escaped=`\\![A](${url})\n\n![A](${url})`;
+ expect(replacePageImageUrls(escaped,[{href:url,resourceId:'real'}])).toBe(`\\![A](${url})\n\n![A](/api/v1/resources/real/blob)`);
+ const code=`\`\`\`md\n![A](${url})\n\`\`\``;
+ const markdown=`${code.split('\n').map(line=>'> '+line).join('\n')}\n\n![A](${url})\n\n${code}`;
+ expect(pageImageRefs(markdown,'https://example.com')).toEqual([{href:url,url}]);
+ expect(replacePageImageUrls(markdown,[{href:url,resourceId:'real'}])).toBe(markdown.replace(`\n\n![A](${url})\n\n`,'\n\n![A](/api/v1/resources/real/blob)\n\n'));
+ });
+
+ test("source positions preserve quoted multiline labels, table images and shared reference definitions",()=>{
+ const markdown='> ![quoted\n> label](https://cdn.example.com/a.png)\n\n| Image |\n| --- |\n| ![table][img] |\n\n![other][img]\n\n[img]: https://cdn.example.com/b.png "Title"';
+ expect(pageImageRefs(markdown,'https://example.com')).toEqual([
+ {href:'https://cdn.example.com/a.png',url:'https://cdn.example.com/a.png'},
+ {href:'https://cdn.example.com/b.png',url:'https://cdn.example.com/b.png'},
+ ]);
+ expect(replacePageImageUrls(markdown,[{href:'https://cdn.example.com/a.png',resourceId:'a'},{href:'https://cdn.example.com/b.png',resourceId:'b'}])).toBe(
+ '> ![quoted\n> label](/api/v1/resources/a/blob)\n\n| Image |\n| --- |\n| ![table](/api/v1/resources/b/blob "Title") |\n\n![other](/api/v1/resources/b/blob "Title")\n\n[img]: https://cdn.example.com/b.png "Title"',
+ );
+ });
+
+ test("parser label boundaries preserve brackets inside alt code spans and inline HTML",()=>{
+ for(const alt of ['a `[` b','a `]` b','a <span title="]">b</span>']) {
+ const markdown=`![${alt}](https://example.com/a.png)`;
+ expect(pageImageRefs(markdown,'https://example.com')).toEqual([{href:'https://example.com/a.png',url:'https://example.com/a.png'}]);
+ expect(replacePageImageUrls(markdown,[{href:'https://example.com/a.png',resourceId:'image'}])).toBe(`![${alt}](/api/v1/resources/image/blob)`);
+ }
+ });
+ test("image archival preserves decoded titles without losing image nodes or table columns",async()=>{
+ const url='https://cdn.example.com/title.png';
+ const sources=[
+ `![caption](${url} "A&#10;&#10;B")`,
+ `![caption](${url} "A &amp;copy; B")`,
+ `![caption](${url} "A&#13;B")`,
+ `![caption][ref]\n\n[ref]: ${url} "A &amp;quot; &#10;&#10; B"`,
+ `| Image | Next |\n| --- | --- |\n| ![caption](${url} "A&#124;B") | untouched |`,
+ ];
+ const images=doc=>{const out=[];const visit=node=>{if(node.type==='image')out.push(node);(node.content||[]).forEach(visit);};visit(doc);return out;};
+ for(const markdown of sources) {
+ const before=markdownToDoc(markdown),original=images(before);expect(original).toHaveLength(1);
+ const {client,calls}=createClient();
+ expect(await embedPageImages(client,{memoId:'memo',markdown,created,images:pageImageRefs(markdown,'https://example.com'),download:async()=>pngFile})).toEqual({embedded:1,total:1});
+ const saved=markdownToDoc(calls.saves[0].body.contentMarkdown),archived=images(saved);
+ expect(archived).toHaveLength(1);
+ expect(archived[0].attrs).toEqual({...original[0].attrs,src:'/api/v1/resources/res_1/blob'});
+ const table=saved.content.find(node=>node.type==='table');
+ if(table){expect(table.content[1].content).toHaveLength(2);expect(JSON.stringify(table.content[1].content[1])).toContain('untouched');}
+ }
+ });
+
test("counts every external image while transferring only the first 30", async () => {
const markdown = Array.from({ length: 32 }, (_, index) => `![${index}](https://example.com/${index}.png)`).join("\n\n");
const images = pageImageRefs(markdown, "https://example.com", Infinity);
@@ -295,8 +346,7 @@ describe("page clip images", () => {
test("page and selection clips copy their images after the note is created", () => {
const background = readFileSync(new URL("./src/background.ts", import.meta.url), "utf8");
- expect(background).toContain("await createMemo(settings, page, tab.id);");
- expect(background).toContain("await embedClipImages(settings, created.memo, contentMarkdown, page.url, tabId, null);");
+ expect(background).toContain("return embedClipImages(settings, created.memo, contentMarkdown, page.url, tabId, null);");
expect(background).toContain("await embedClipImages(settings, created.memo, contentMarkdown, sourceUrl, tabId, frameId);");
expect(background).toContain("func: readPageImageInPage");
});
diff --git a/apps/extension/platform-capture.test.mjs b/apps/extension/platform-capture.test.mjs
index ccd8f4e0..66cfeed8 100644
--- a/apps/extension/platform-capture.test.mjs
+++ b/apps/extension/platform-capture.test.mjs
@@ -1,4 +1,5 @@
import { expect, test } from "bun:test";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
import { readFileSync } from "node:fs";
import { runInNewContext } from "node:vm";
import { bundleTestScripts } from "./bundle-test-scripts.mjs";
@@ -7,20 +8,32 @@ import { createWindow } from "@mixmark-io/domino";
const [bundle] = bundleTestScripts(["capture-platform"]);
const xUrl = "https://www.xiaoyuzhoufm.com/episode/62ad4ae5f9b62781ea058a02";
-const capture = async ({ fixture = "xiaoyuzhou", url = xUrl, expectedUrl = url, selectionFirst = false, prepare } = {}) => {
+const capture = async ({ fixture = "xiaoyuzhou", url = xUrl, expectedUrl = url, sourceUrl = expectedUrl, selectionFirst = false, prepare, detailLoad } = {}) => {
const window = createWindow(readFileSync(new URL(`./fixtures/platforms/${fixture}.html`, import.meta.url), "utf8"), url);
const doc = window.document;
const location = { href: url };
let notify = () => {};
- const calls = { messages: [], clicks: 0, disconnected: false };
+ const calls = { messages: [], clicks: 0, disconnected: false, details: [] };
prepare?.({ doc, window, location, changed: () => notify() });
+ const append=doc.body.appendChild.bind(doc.body);
+ Object.defineProperty(doc.body,'appendChild',{value:node=>{
+ const value=append(node);
+ if(node.tagName==='IFRAME') {
+ calls.details.push(node);
+ queueMicrotask(()=>{
+ const detail=detailLoad?.(node);
+ if(detail) {Object.defineProperty(node,'contentDocument',{value:detail});node.onload();}
+ });
+ }
+ return value;
+ }});
const expand = doc.querySelector(".expand");
expand?.addEventListener("click", () => { calls.clicks += 1; });
let done;
const result = new Promise((resolve) => { done = resolve; });
runInNewContext(bundle, {
window, document: doc, location, URL,
- __edgeeverPlatformClipPayload: { requestId: "capture-1", url: expectedUrl, sourceUrl: expectedUrl, selectionFirst },
+ __edgeeverPlatformClipPayload: { requestId: "capture-1", url: expectedUrl, sourceUrl, selectionFirst },
setTimeout: (callback) => setTimeout(callback, 30), clearTimeout, setInterval, clearInterval,
MutationObserver: class {
constructor(callback) { notify = callback; }
@@ -31,7 +44,8 @@ const capture = async ({ fixture = "xiaoyuzhou", url = xUrl, expectedUrl = url,
i18n: { getMessage: (key) => key },
runtime: { sendMessage: (message) => { calls.messages.push(message); done(message.result); return Promise.resolve(); } },
},
- fetch: () => { throw new Error("Capture must not download audio or fetch another page"); },
+ AbortSignal,
+ fetch: () => { throw new Error("Unexpected page or media fetch"); },
});
return { result: await result, calls };
};
@@ -45,6 +59,49 @@ test("the real page's fully loaded Show Notes do not need an expansion click", a
expect(calls.messages[0].requestId).toBe("capture-1");
});
+const publicDetail = (fixture, url) => createWindow(readFileSync(new URL(`./fixtures/platforms/${fixture}.html`,import.meta.url),'utf8'),url).document;
+
+for(const [id,fixture,images] of [['6114376649/411862401','xueqiu-feed-detail',0],['2754211668/411841572','xueqiu-feed-detail-second',1]]) test(`Xueqiu feed reads only selected ${id} through its script-disabled same-origin detail`,async()=>{
+ const url='https://www.xueqiu.com/',expectedUrl='https://xueqiu.com/'+id;
+ const original=publicDetail(fixture,'https://www.xueqiu.com/'+id);
+ const finalParagraph=Array.from(original.querySelectorAll('.article__bd__detail p')).at(-1).textContent.trim().slice(-36);
+ const {result,calls}=await capture({fixture:'xueqiu-feed',url,sourceUrl:url,expectedUrl,detailLoad:frame=>{
+ expect(frame.src).toBe('https://www.xueqiu.com/'+id);expect(frame.getAttribute('sandbox')).toBe('allow-same-origin');
+ return original;
+ }});
+ expect(result.ok).toBe(true);expect(result.clip.url).toBe(expectedUrl);expect(result.clip.markdown).toContain(images ? '把自己的真金白银押在别人的嘴上,早晚是要付出代价的。' : finalParagraph);
+ expect(result.clip.markdown.match(/!\[/g) || []).toHaveLength(images);expect(calls.details).toHaveLength(1);
+ expect(calls.details[0].isConnected).toBe(false);expect(calls.messages).toHaveLength(1);
+});
+
+for(const failure of ['challenge','wrong-url','load-error','timeout','navigation','recycled-card','hidden-card','body-reference']) test(`Xueqiu feed ${failure} cannot archive a preview or another post`,async()=>{
+ const url='https://www.xueqiu.com/',id='6114376649/411862401',expectedUrl='https://xueqiu.com/'+id;
+ let prepared;
+ const {result,calls}=await capture({fixture:'xueqiu-feed',url,sourceUrl:url,expectedUrl,prepare:state=>{
+ prepared=state;
+ if(failure==='hidden-card')state.doc.querySelector('[class*="timeline__item__main_"]').style.display='none';
+ if(failure==='body-reference')state.doc.querySelectorAll('a[class*="date-and-source_"]').forEach(a=>a.remove());
+ },detailLoad:frame=>{
+ if(failure==='load-error'){frame.onerror();return;}
+ if(failure==='timeout')return;
+ if(failure==='navigation')prepared.location.href='https://www.xueqiu.com/S/SH600438';
+ if(failure==='recycled-card')prepared.doc.querySelectorAll('a[class*="date-and-source_"]').forEach(a=>a.setAttribute('href','/2754211668/411841572'));
+ if(failure==='challenge')return createWindow('<html><body>Site verification</body></html>','https://www.xueqiu.com/'+id).document;
+ return publicDetail('xueqiu-feed-detail',failure==='wrong-url'?'https://www.xueqiu.com/2754211668/411841572':'https://www.xueqiu.com/'+id);
+ }});
+ expect(result.ok).toBe(false);expect(result.clip).toBeUndefined();expect(calls.messages).toHaveLength(1);
+ expect(calls.details).toHaveLength(['hidden-card','body-reference'].includes(failure)?0:1);
+ for(const frame of calls.details)expect(frame.isConnected).toBe(false);
+});
+
+test('explicit Xueqiu feed selection precedes the public detail request',async()=>{
+ const url='https://www.xueqiu.com/';
+ const {result,calls}=await capture({fixture:'xueqiu-feed',url,sourceUrl:url,expectedUrl:'https://xueqiu.com/6114376649/411862401',selectionFirst:true,prepare:({doc,window})=>{
+ window.getSelection=()=>({rangeCount:1,toString:()=> 'Selected preview text',getRangeAt:()=>({cloneContents:()=>{const fragment=doc.createDocumentFragment();fragment.appendChild(doc.createTextNode('Selected preview text'));return fragment;}})});
+ }});
+ expect(result.selection.markdown).toBe('Selected preview text');expect(calls.details).toHaveLength(0);
+});
+
test("an incomplete DOM expands only the Show Notes control once and waits for complete text", async () => {
const { result, calls } = await capture({ prepare: ({ doc, changed }) => {
const notes = doc.querySelector(".sn-content article"); const full = notes.innerHTML;
@@ -103,6 +160,34 @@ test("a text selection removed by HTML cleanup stays a selection as escaped plai
button.textContent = "Only *this* text"; fragment.appendChild(button); return fragment;
} }) });
} });
- expect(result.selection.markdown).toBe("Only \\*this\\* text");
+ const paragraph = markdownToDoc(result.selection.markdown).content[0];
+ expect(paragraph.type).toBe("paragraph");
+ expect(paragraph.content).toEqual([{ type: "text", text: "Only *this* text" }]);
expect(result.clip).toBeUndefined();
});
+
+test("Substack Note injection filters hidden CSS before checking complete content", async () => {
+ const url="https://substack.com/@tedgioia/note/c-357811021";
+ const {result,calls}=await capture({fixture:"substack-note",url,prepare:({doc})=>{
+ doc.querySelector(".ProseMirror p").setAttribute("style","display:none");
+ }});
+ expect(result).toEqual({ok:false,reason:"incomplete"});
+ expect(calls.messages).toHaveLength(1);
+});
+
+
+test("Jike long text expands through the actual injected bundle and retains link identities",async()=>{
+ const {result,calls}=await capture({fixture:'jike-long',url:'https://m.okjike.com/originalPosts/64c9dd9a2edae6abdc610605',prepare:({doc,changed})=>{
+ const body=doc.querySelector('.text'),full=body.innerHTML;body.innerHTML='<span>我在即刻写东西</span><button class="expand">展开全文</button>';
+ body.querySelector('button').addEventListener('click',()=>{body.innerHTML=full;changed();});
+ }});
+ expect(result.ok).toBe(true);expect(result.clip.markdown).toContain('《世界尽头的咖啡馆》');expect(calls.clicks).toBe(1);expect(calls.disconnected).toBe(true);
+});
+
+for(const navigate of [false,true])test(`Jike expansion ${navigate?'navigation':'timeout'} refuses the partial post`,async()=>{
+ const {result,calls}=await capture({fixture:'jike-long',url:'https://m.okjike.com/originalPosts/64c9dd9a2edae6abdc610605',prepare:({doc,location,changed})=>{
+ const body=doc.querySelector('.text');body.innerHTML='<span>我在即刻写东西</span><button class="expand">展开全文</button>';
+ if(navigate)body.querySelector('button').addEventListener('click',()=>{location.href='https://m.okjike.com/originalPosts/6715e824d9dc81724c2ec74d';changed();});
+ }});
+ expect(result).toEqual({ok:false,reason:navigate?'changed':'incomplete'});expect(calls.clicks).toBe(1);expect(calls.disconnected).toBe(true);
+});
diff --git a/apps/extension/platform-clip.test.mjs b/apps/extension/platform-clip.test.mjs
index c9fddfb8..0e95d890 100644
--- a/apps/extension/platform-clip.test.mjs
+++ b/apps/extension/platform-clip.test.mjs
@@ -5,6 +5,70 @@ import { platformTarget, platformHtmlMarkdown, publishedTimeText, clipDateTimeTe
import { readHackerNews } from "./src/hacker-news-clip.ts";
import { readV2ex } from "./src/v2ex-clip.ts";
import { readXiaoyuzhou } from "./src/xiaoyuzhou-clip.ts";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
+import { pageImageRefs, replacePageImageUrls } from "./src/page-images.ts";
+
+test("rich table cells retain their grid, line breaks, inline code and archived images",()=>{
+ const doc=createDocument('<table><tr><th>内容</th><th>代码</th></tr><tr><td><p>首段<br>次行</p><ul><li>one</li><li>two<img src="https://example.test/cell.png"></li></ul><blockquote>引用</blockquote></td><td><pre><code class="language-js"> a || b;\n\n\nconst tag = `&lt;br&gt;`;</code></pre></td></tr></table>');
+ const markdown=platformHtmlMarkdown(doc.body,'https://example.test');
+ expect(markdown).not.toContain('joplin-table-wrapper');expect(markdown).not.toContain('<table');
+ expect(pageImageRefs(markdown,'https://example.test')).toEqual([{href:'https://example.test/cell.png',url:'https://example.test/cell.png'}]);
+ const parsed=markdownToDoc(replacePageImageUrls(markdown,[{href:'https://example.test/cell.png',resourceId:'cell'}]));
+ const table=parsed.content.find(node=>node.type==='table');expect(table.content).toHaveLength(2);expect(table.content[1].content).toHaveLength(2);
+ const nodes=[];const walk=node=>{nodes.push(node);(node.content || []).forEach(walk);};walk(table);
+ expect(nodes.filter(node=>node.type==='hardBreak').length).toBeGreaterThanOrEqual(5);
+ expect(nodes.find(node=>node.type==='image').attrs.src).toBe('/api/v1/resources/cell/blob');
+ const code=nodes.filter(node=>node.marks?.some(mark=>mark.type==='code')).map(node=>node.text);
+ expect(code).toContain(' a || b;');expect(code).toContain('const tag = `<br>`;');
+ const text=nodes.filter(node=>node.type==='text').map(node=>node.text).join('');
+ expect(text).toContain('引用');expect(text).not.toContain('<br><br>');expect(text).not.toContain('```js');
+});
+
+test("table code keeps literal backslash-pipe runs and adjacent columns without adding characters",()=>{
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ for(const kind of ['code','pre']) for(const count of [0,1,2,3,4]) for(const pipes of ['|','||']) {
+ const literal=`${kind==='pre'?' \t':''}a ${'\\'.repeat(count)}${pipes} b & <br>${kind==='pre'?'\t ':''}`;
+ const doc=createDocument('<table><tr><th>Code</th><th>Next</th></tr><tr><td id="code"></td><td>end</td></tr></table>');
+ const code=doc.createElement(kind);code.textContent=literal;doc.querySelector('#code').appendChild(code);
+ const table=markdownToDoc(platformHtmlMarkdown(doc.body,'https://example.test')).content.find(node=>node.type==='table');
+ expect(table.content[1].content).toHaveLength(2);
+ expect(table.content[1].content.map(text)).toEqual([literal,'end']);
+ }
+});
+
+test("HTML row spans retain column association and additional header rows remain data",()=>{
+ const doc=createDocument('<table><thead><tr><th>A</th><th>B</th></tr><tr><th>sub A</th><th>sub B</th></tr></thead><tbody><tr><td rowspan="2">both</td><td>row1</td></tr><tr><td>row2</td></tr></tbody></table>');
+ const original=doc.body.outerHTML,markdown=platformHtmlMarkdown(doc.body,'https://example.test');
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ const table=markdownToDoc(markdown).content.find(node=>node.type==='table');
+ expect(table.content.map(row=>row.content.map(text))).toEqual([['A','B'],['sub A','sub B'],['both','row1'],['both','row2']]);
+ expect(doc.body.outerHTML).toBe(original);
+});
+
+test("colspan headings form valid GFM and vertical spans stop at their row group",()=>{
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ const cases=[
+ ['<table><thead><tr><th colspan="2">Group</th><th>Other</th></tr></thead><tbody><tr><td colspan="2">Value</td><td>Final</td></tr></tbody></table>',[['Group','','Other'],['Value','','Final']]],
+ ['<table><tr><th>A</th><th>B</th></tr><tbody><tr><td rowspan="0">group1</td><td>one</td></tr><tr><td>two</td></tr></tbody><tbody><tr><td>group2</td><td>three</td></tr></tbody></table>',[['A','B'],['group1','one'],['group1','two'],['group2','three']]],
+ ];
+ for(const [html,expected] of cases){const table=markdownToDoc(platformHtmlMarkdown(createDocument(html).body,'https://example.test')).content.find(node=>node.type==='table');expect(table?.content.map(row=>row.content.map(text))).toEqual(expected);}
+ const code=markdownToDoc(platformHtmlMarkdown(createDocument('<table><tr><th>Code</th></tr><tr><td><pre>first\n \nlast</pre></td></tr></table>').body,'https://example.test'));
+ const nodes=[];const walk=node=>{nodes.push(node);(node.content || []).forEach(walk);};walk(code);
+ expect(nodes.filter(node=>node.marks?.some(mark=>mark.type==='code')).map(node=>node.text)).toEqual(['first',' ','last']);
+});
+
+test("table conversion retains repeated pipes in prose and code and escapes literal HTML captions",()=>{
+ const doc=createDocument('<table><caption>&lt;img src=x onerror=alert(1)&gt;</caption><thead><tr><th>表达式</th><th>说明</th></tr></thead><tbody><tr><td>左 || 右,<code>a || b</code></td><td>逻辑或</td></tr></tbody></table>');
+ const markdown=platformHtmlMarkdown(doc.body,'https://example.test');
+ expect(markdown).not.toContain('<img');
+ const parsed=markdownToDoc(markdown),table=parsed.content.find(node=>node.type==='table');
+ expect(table?.content).toHaveLength(2);
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ expect(text(table.content[1].content[0])).toBe('左 || 右,a || b');
+ expect(text(parsed.content[0])).toBe('<img src=x onerror=alert(1)>');
+ expect(text(table.content[1].content[1])).toBe('逻辑或');
+ expect(platformHtmlMarkdown(createDocument('<p>正文</p><table></table>').body,'https://example.test')).toBe('正文');
+});
const labels = {
score: "Points at capture", externalLink: "Linked page", supplement: "Supplement",
@@ -107,6 +171,21 @@ test("V2EX real DOM keeps both supplements and their times, excluding replies",
expect(result.clip.markdown).not.toContain("抱歉跑个题");
});
+test("V2EX omits invisible article descendants and metadata without requiring optional fields",()=>{
+ const doc=fixture('v2ex'),body=doc.querySelector('.topic_content'),original=body.textContent;
+ const hidden=doc.createElement('p');hidden.style.display='none';hidden.textContent='HIDDEN BODY SENTINEL';body.appendChild(hidden);
+ doc.querySelector('small.gray a').setAttribute('hidden','');doc.querySelector('small.gray span').style.display='none';
+ const result=readV2ex(doc,vUrl,labels);expect(result.ok).toBe(true);
+ expect(result.clip.markdown).not.toContain('HIDDEN BODY SENTINEL');expect(result.clip.markdown).toContain('环境不好');expect(result.clip.markdown).toContain('Supplement 2');
+ expect(result.clip.author).toBeUndefined();expect(result.clip.publishedAt).toBeUndefined();expect(body.textContent).toBe(original+'HIDDEN BODY SENTINEL');
+ doc.querySelector('h1').style.display='none';expect(readV2ex(doc,vUrl,labels)).toEqual({ok:false,reason:'unreadable'});
+});
+
+test("V2EX retains visible descendants restored within an otherwise invisible supplement",()=>{
+ const doc=fixture('v2ex'),supplement=doc.querySelector('.subtle');supplement.style.visibility='hidden';supplement.querySelector('.topic_content').style.visibility='visible';
+ const result=readV2ex(doc,vUrl,labels);expect(result.ok).toBe(true);expect(result.clip.markdown).toContain('从今天开始转型');expect(result.clip.markdown).toContain('看看大家多久后能来还愿');
+});
+
test("V2EX handles body-only and supplement-only topics, and rejects login or stale pages", () => {
const doc = fixture("v2ex");
Array.from(doc.querySelectorAll(".subtle")).forEach((node) => node.remove());
diff --git a/apps/extension/platform-save.test.mjs b/apps/extension/platform-save.test.mjs
index ae228ac8..67adc544 100644
--- a/apps/extension/platform-save.test.mjs
+++ b/apps/extension/platform-save.test.mjs
@@ -3,10 +3,18 @@ import { expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { createContext, runInContext } from "node:vm";
import { bundleTestScripts } from "./bundle-test-scripts.mjs";
-import { createWindow } from "@mixmark-io/domino";
+import { createDocument, createWindow } from "@mixmark-io/domino";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
const [background, captureScript, pageCaptureScript] = bundleTestScripts(["background", "capture-platform", "capture"]);
const urls = {
+ wechat: "https://mp.weixin.qq.com/s/TC-ONpL3PGklsD0yhtcuBQ",
+ jike: "https://m.okjike.com/originalPosts/66ac89b0314f5cced41012d3",
+ sspai: "https://sspai.com/post/92653",
+ juejin: "https://juejin.cn/post/6972051526416072717",
+ douban: "https://book.douban.com/review/16093028/",
+ boss: "https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html",
+ xueqiu: "https://xueqiu.com/5636485254/253443400",
"substack-note": "https://substack.com/@tedgioia/note/c-357811021",
"hacker-news": "https://news.ycombinator.com/item?id=40380738",
v2ex: "https://www.v2ex.com/t/1000000",
@@ -26,10 +34,24 @@ const harness = (options = {}) => {
const platform = options.platform || "hacker-news";
const pageUrl = options.pageUrl || urls[platform];
let currentUrl = pageUrl;
- const window = createWindow(readFileSync(new URL(`./fixtures/platforms/${platform}.html`, import.meta.url), "utf8"), pageUrl);
+ const window = createWindow(readFileSync(new URL(`./fixtures/platforms/${options.fixture || (platform === "douban" ? "douban-book" : platform)}.html`, import.meta.url), "utf8"), pageUrl);
+ Object.getPrototypeOf(window.document.getElementsByTagName('*'))[Symbol.iterator] ??= Array.prototype[Symbol.iterator];
+ Object.defineProperty(Object.getPrototypeOf(window.document),'baseURI',{configurable:true,get(){return this.URL;}});
+ window.DOMParser = class { parseFromString(value) { return createDocument(value); } };
window.getSelection = () => null;
options.prepare?.(window.document, window);
- const calls = { creates: [], uploads: [], saves: [], injections: [], feedback: [], requests: [], rejectedMessages: [] };
+ if(options.detailLoad) {
+ const append=window.document.body.appendChild.bind(window.document.body);
+ Object.defineProperty(window.document.body,'appendChild',{value:node=>{
+ const value=append(node);
+ if(node.tagName==='IFRAME')queueMicrotask(()=>{
+ Object.defineProperty(node,'contentDocument',{value:options.detailLoad(node)});node.onload();
+ });
+ return value;
+ }});
+ }
+ const calls = { creates: [], uploads: [], saves: [], injections: [], feedback: [], requests: [], rejectedMessages: [], imageRules: [] };
+ let doubanImageRule=false, sspaiImageRule=false;
let onMessage, onClick, menuDone;
const json = (value, status = 200) => Response.json(value, { status });
const fetchMock = async (url, init) => {
@@ -57,13 +79,14 @@ const harness = (options = {}) => {
}
throw new Error(`Unexpected instance request: ${path}`);
}
- return options.failDownload ? new Response("Forbidden", { status: 403 }) : new Response(png, { headers: { "content-type": "image/png" } });
+ return options.failDownload || (options.requireDoubanImageRule && !doubanImageRule) || (options.requireSspaiImageRule && !sspaiImageRule) ? new Response("Forbidden", { status: 403 }) : new Response(png, { headers: { "content-type": "image/png" } });
};
- let pageContext;
+ let pageContext, selectionContext;
const chrome = {
i18n: { getMessage: (key, substitution) => key === "saveFailedWithReason" ? `${key}: ${substitution}` : key },
runtime: {
id: "extension-under-test",
+ getURL: path=>`chrome-extension://extension-under-test/${path.replace(/^\/+/, '')}`,
onInstalled: { addListener() {} }, onMessage: { addListener(listener) { onMessage = listener; } },
openOptionsPage: async () => {},
sendMessage: async (message) => {
@@ -80,34 +103,89 @@ const harness = (options = {}) => {
},
storage: { local: { get: async () => ({ instanceUrl: "https://edgeever.test", token: "test-token", notebookId: "" }) } },
permissions: { contains: async () => !options.denyInstance },
- tabs: { query: async () => [{ id: 7, url: currentUrl }], get: async () => ({ id: 7, url: currentUrl }) },
+ declarativeNetRequest: { updateSessionRules:async update=>{
+ calls.imageRules.push(update);
+ if(options.denyImageRule) throw new Error('Rule registration failed');
+ doubanImageRule=update.addRules.some(rule=>new RegExp(rule.condition.regexFilter).test('https://img2.doubanio.com/view/thing_review/l/public/p11097731.webp') && rule.action.requestHeaders.some(header=>header.header==='Referer' && header.value==='https://www.douban.com/'));
+ sspaiImageRule=update.addRules.some(rule=>new RegExp(rule.condition.regexFilter).test('https://cdnfile.sspai.com/2024/09/30/fc33a7ce5eea69d99afdf6ebc5b7259e.jpg') && rule.action.requestHeaders.some(header=>header.header==='Referer' && header.value==='https://sspai.com/'));
+ } },
+ tabs: { query: async () => [options.activeTab?.() || { id: 7, url: currentUrl }], get: async (tabId) => ({ id: tabId, url: tabId === 8 ? options.selectionTabUrl?.() || options.selectionWindow.location.href : options.navigateAfterModeProbe ? "https://www.zhipin.com/" : currentUrl }) },
windows: { onRemoved: { addListener() {} } },
contextMenus: { onClicked: { addListener(listener) { onClick = listener; } } },
scripting: { executeScript: async ({ func, args = [], files, target }) => {
calls.injections.push({ files, target });
+ const scriptContext = target.tabId === 8 ? selectionContext : pageContext;
if (options.denyScripting) throw new Error("Cannot access contents of the page. Missing host permission.");
if (func) {
- if (args[0]?.action === "toast") { calls.feedback.push(args[0]); if (calls.feedback.length > 1) menuDone?.(args[0]); return []; }
- pageContext.__args = args;
- return [{ result: await runInContext(`(${func.toString()})(...__args)`, pageContext) }];
+ if (args[0]?.action === "toast") { if(["savingPlatformClip","savingSelection"].includes(args[0].message)) await options.feedbackGate?.(args[0].message); calls.feedback.push(args[0]); if (calls.feedback.length > 1 || args[0].kind === "error") menuDone?.(args[0]); return []; }
+ if (options.navigateBeforeSelectionCapture && args[0]?.mode === "selection") currentUrl = "https://example.test/new-page";
+ scriptContext.__args = args;
+ return [{ result: await runInContext(`(${func.toString()})(...__args)`, scriptContext) }];
+ }
+ if (files?.[0] === "assets/capture-platform.js") runInContext(captureScript, scriptContext);
+ else if (files?.[0] === "assets/capture.js") {
+ await options.captureGate?.(target.tabId);
+ runInContext(pageCaptureScript, scriptContext);
}
- if (files?.[0] === "assets/capture-platform.js") runInContext(captureScript, pageContext);
- else if (files?.[0] === "assets/capture.js") runInContext(pageCaptureScript, pageContext);
else if (!["assets/capture-image.js", "assets/clip-feedback.js"].includes(files?.[0])) throw new Error(`Unexpected generic fallback: ${files}`);
+
return [];
} },
action: { setBadgeBackgroundColor: async () => {}, setBadgeText: async () => {} },
};
pageContext = createContext({ window, document: window.document, location: { get href() { return currentUrl; } }, URL, chrome, setTimeout, clearTimeout, setInterval, clearInterval, fetch: fetchMock, AbortSignal, Blob, Uint8Array });
- runInContext(background, createContext({ chrome, fetch: fetchMock, URL, crypto, setTimeout, clearTimeout, setInterval, clearInterval, AbortSignal, AbortController, Blob, File, FormData, Uint8Array, ArrayBuffer, Response }));
+ if (options.selectionWindow) {
+ const selectedWindow = options.selectionWindow;
+ selectedWindow.DOMParser = class { parseFromString(value) { return createDocument(value); } };
+ const selectedChrome = { ...chrome, runtime: { ...chrome.runtime, sendMessage: async (message) => {
+ onMessage(message, { id: chrome.runtime.id, tab: { id: 8 }, frameId: 0, url: selectedWindow.location.href }, () => {});
+ } } };
+ selectionContext = createContext({ window: selectedWindow, document: selectedWindow.document, location: selectedWindow.location, URL, chrome: selectedChrome, setTimeout, clearTimeout, setInterval, clearInterval, fetch: fetchMock, AbortSignal, Blob, Uint8Array });
+ }
+ runInContext(background, createContext({ chrome, fetch: fetchMock, URL, crypto, setTimeout:options.backgroundSetTimeout || setTimeout, clearTimeout, setInterval, clearInterval, AbortSignal, AbortController, Blob, File, FormData, Uint8Array, ArrayBuffer, Response }));
return {
document: window.document,
calls,
toolbar: () => new Promise((resolve) => onMessage({ type: "captureCurrentPage" }, { id: chrome.runtime.id }, resolve)),
+ mode: () => new Promise((resolve) => onMessage({ type: "getCurrentPageCaptureMode" }, { id: chrome.runtime.id }, resolve)),
menu: () => new Promise((resolve) => { menuDone = resolve; onClick({ menuItemId: `save-${platform}`, pageUrl, frameId: 0 }, { id: 7, url: pageUrl }); }),
+ selectionMenu: () => new Promise((resolve) => {
+ menuDone = resolve;
+ const selectedWindow = options.selectionWindow;
+ const tabUrl=options.selectionTabUrl?.() || selectedWindow.location.href;
+ onClick({ menuItemId: "save-selection", pageUrl: tabUrl, frameUrl: selectedWindow.location.href, frameId: options.selectionFrameId || 0, selectionText: selectedWindow.getSelection().toString() }, { id: 8, url: tabUrl, title: selectedWindow.document.title });
+ }),
};
};
+test("BOSS popup detects login preview through the serialized DOM probe without creating or expanding anything", async () => {
+ const h = harness({ platform: "boss", prepare: (doc) => { doc.body.innerHTML = createWindow(readFileSync(new URL('./fixtures/platforms/boss-login-required.html', import.meta.url), 'utf8')).document.body.innerHTML; } });
+ expect(await h.mode()).toMatchObject({ kind: "platform", platform: "platformBoss", access: "login-required" });
+ expect(h.calls.requests).toHaveLength(0);
+ expect(h.calls.creates).toHaveLength(0);
+ expect(h.calls.injections).toHaveLength(1);
+});
+
+test("BOSS readable page retains the adapted badge; failed or stale probes are unknown", async () => {
+ expect(await harness({ platform: "boss" }).mode()).toEqual({ kind: "platform", platform: "platformBoss" });
+ for (const option of ["denyScripting", "navigateAfterModeProbe"]) expect(await harness({ platform: "boss", [option]: true }).mode()).toEqual({ kind: "unknown" });
+});
+
+test("BOSS login preview can still save an explicit text selection without capturing the incomplete job", async () => {
+ const h = harness({ platform: "boss", prepare: (doc, window) => {
+ doc.body.innerHTML = createWindow(readFileSync(new URL('./fixtures/platforms/boss-login-required.html', import.meta.url), 'utf8')).document.body.innerHTML;
+ window.getSelection = () => ({ rangeCount: 1, toString: () => "Only selected job text", getRangeAt: () => ({ cloneContents: () => {
+ const fragment = doc.createDocumentFragment(), p = doc.createElement("p"); p.textContent = "Only selected job text"; fragment.appendChild(p); return fragment;
+ } }) });
+ } });
+ expect((await h.mode()).access).toBe('login-required');
+ expect((await h.toolbar()).ok).toBe(true);
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].tags).toEqual(['web-clip']);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Only selected job text');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('登录查看完整内容');
+});
+
for (const platform of Object.keys(urls)) {
test(`${platform}: toolbar and dedicated menu save the same note through the real parser`, async () => {
const toolbar = harness({ platform }); const menu = harness({ platform });
@@ -117,7 +195,7 @@ for (const platform of Object.keys(urls)) {
expect(menu.calls.creates).toHaveLength(1);
const normalize = (note) => ({ ...note, contentMarkdown: note.contentMarkdown.replace(/capturedAtLabel: [^\n]+/, "capturedAtLabel: <capture time>") });
expect(normalize(menu.calls.creates[0])).toEqual(normalize(toolbar.calls.creates[0]));
- expect(toolbar.calls.creates[0].tags).toEqual(["web-clip", platform]);
+ expect(toolbar.calls.creates[0].tags).toEqual(platform === "xueqiu" ? ["web-clip", "xueqiu", "投资", "SH600438", "SH601012", "SH688472"] : ["web-clip", platform]);
expect(toolbar.calls.creates[0].notebookId).toBe("nb_inbox");
expect(toolbar.calls.creates[0].contentMarkdown).toMatch(/capturedAtLabel: \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\b/);
if (platform === "v2ex") {
@@ -129,6 +207,95 @@ for (const platform of Object.keys(urls)) {
});
}
+for(const action of ['toolbar','menu']) test(`Douban ${action} keeps paragraphs and archives all images after installing its own request rule`,async()=>{
+ const h=harness({platform:'douban',requireDoubanImageRule:true});
+ const response=await h[action]();
+ if(action === 'toolbar') expect(response.ok).toBe(true);
+ else expect(response.kind).toBe('success');
+ expect(h.calls.creates).toHaveLength(1);expect(h.calls.uploads).toHaveLength(6);expect(h.calls.saves).toHaveLength(1);
+ expect(h.calls.imageRules).toHaveLength(1);
+ const rule=h.calls.imageRules[0].addRules[0];
+ expect(rule.condition.initiatorDomains).toEqual(['extension-under-test']);
+ expect(rule.condition.resourceTypes).toEqual(['xmlhttprequest']);
+ expect(rule.condition.requestMethods).toEqual(['get']);
+ const match=new RegExp(rule.condition.regexFilter);
+ expect(match.test('https://img2.doubanio.com/view/thing_review/l/public/p11097731.webp')).toBe(true);
+ for(const url of ['https://img2.doubanio.com.evil.test/view/x','https://img2.doubanio.com/not-images','https://example.test/?url=https://img2.doubanio.com/view/x']) expect(match.test(url)).toBe(false);
+ expect(rule.action.requestHeaders).toEqual([{header:'Referer',operation:'set',value:'https://www.douban.com/'}]);
+ for(const memo of [h.calls.creates[0],h.calls.saves[0]]) {
+ expect(memo.contentMarkdown).toContain('\n\n在路上,我遇到了瓦尔泽');
+ expect(memo.contentMarkdown).toContain('\n\n有人说,他写的是西方的散文');
+ }
+ expect(h.calls.saves[0].contentMarkdown.match(/!\[[^\]]*\]\(\/api\/v1\/resources\/res_\d\/blob\)/g)).toHaveLength(6);
+});
+
+test('Douban rule failure preserves one note and reports incomplete archival',async()=>{
+ const h=harness({platform:'douban',requireDoubanImageRule:true,denyImageRule:true});
+ expect(await h.toolbar()).toEqual({ok:true,message:'platformImagesPartial'});
+ expect(h.calls.creates).toHaveLength(1);expect(h.calls.uploads).toHaveLength(0);expect(h.calls.saves).toHaveLength(0);expect(h.calls.imageRules).toHaveLength(1);
+});
+
+for (const action of ['toolbar', 'menu']) test(`Sspai ${action} supplies its image source header before archiving`, async () => {
+ const h = harness({ platform: 'sspai', requireSspaiImageRule: true });
+ await h[action]();
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.uploads).toHaveLength(9);
+ expect(h.calls.saves).toHaveLength(1);
+ expect(h.calls.imageRules).toHaveLength(1);
+ const rules = h.calls.imageRules[0].addRules;
+ const rule = rules.find(rule => rule.id === 2);
+ expect(new Set(rules.map(rule => rule.id)).size).toBe(rules.length);
+ expect(h.calls.imageRules[0].removeRuleIds).toEqual(rules.map(rule => rule.id));
+ expect(rule.condition.initiatorDomains).toEqual(['extension-under-test']);
+ expect(rule.condition.resourceTypes).toEqual(['xmlhttprequest']);
+ expect(rule.condition.requestMethods).toEqual(['get']);
+ expect(rule.action.requestHeaders).toEqual([{ header: 'Referer', operation: 'set', value: 'https://sspai.com/' }]);
+ const match = new RegExp(rule.condition.regexFilter);
+ expect(match.test('https://cdnfile.sspai.com/2024/09/30/photo.jpg?imageView2/2/format/webp')).toBe(true);
+ for (const url of ['http://cdnfile.sspai.com/photo.jpg', 'https://cdnfile.sspai.com.evil.test/photo.jpg', 'https://example.test/?url=https://cdnfile.sspai.com/photo.jpg']) expect(match.test(url)).toBe(false);
+ expect(h.calls.saves[0].contentMarkdown.match(/\/api\/v1\/resources\/res_\d+\/blob/g)).toHaveLength(9);
+});
+
+for(const action of ['toolbar','menu']) test(`Juejin ${action} saves the complete comparison table alongside archived article images`,async()=>{
+ const h=harness({platform:'juejin'});await h[action]();
+ expect(h.calls.creates).toHaveLength(1);expect(h.calls.uploads).toHaveLength(2);expect(h.calls.saves).toHaveLength(1);
+ const text=node=>node.text || (node.content || []).map(text).join('');
+ const expected=Array.from(h.document.querySelector('table').rows).map(row=>Array.from(row.cells).map(cell=>cell.textContent.trim()));
+ for(const memo of [h.calls.creates[0],h.calls.saves[0]]) {
+ const table=markdownToDoc(memo.contentMarkdown).content.find(node=>node.type==='table');
+ expect(table?.content.map(row=>row.content.map(text))).toEqual(expected);
+ expect(memo.contentMarkdown).not.toContain('复制代码');
+ }
+ expect(h.calls.saves[0].contentMarkdown).toContain('/api/v1/resources/res_2/blob');
+});
+
+for(const action of ['toolbar','menu']) test(`Sspai ${action} retains article updates and archives their images without changing publication time`,async()=>{
+ const h=harness({platform:'sspai',prepare:doc=>doc.querySelector('.update-body').insertAdjacentHTML('beforeend','<p><img data-src="https://images.test/update.png"></p>')});
+ await h[action]();expect(h.calls.creates).toHaveLength(1);
+ const memo=h.calls.creates[0];expect(memo.tags).toEqual(['web-clip','sspai']);
+ expect(memo.contentMarkdown).toContain('> **中国大陆推出睡眠呼吸暂停迹象提示功能**');
+ expect(memo.contentMarkdown).toContain('> 2026 年 10 月 14 日,Apple 在中国大陆正式推出');
+ expect(memo.contentMarkdown).toContain('> 以下内容于 10:00更新');
+ expect(memo.contentMarkdown).toContain('platformPublishedAtLabel: 2024-10-10');
+ expect(memo.contentMarkdown.match(/中国大陆推出睡眠呼吸暂停迹象提示功能/g)).toHaveLength(1);
+ expect(h.calls.uploads).toHaveLength(10);
+ expect(h.calls.saves[0].contentMarkdown).toContain('> **中国大陆推出睡眠呼吸暂停迹象提示功能**');
+ expect(h.calls.saves[0].contentMarkdown).toContain('> ![](/api/v1/resources/res_10/blob)');
+});
+
+for(const action of ['toolbar','menu']) test(`WeChat ${action} cleans publisher promotions before archiving body images`,async()=>{
+ const h=harness({platform:'wechat'});await h[action]();
+ expect(h.calls.creates).toHaveLength(1);const memo=h.calls.creates[0];
+ expect(memo.tags).toEqual(['web-clip','wechat']);expect(memo.contentMarkdown).toContain('大数据架构之道');
+ expect(memo.contentMarkdown).toContain('选择模型进行对话');expect(memo.contentMarkdown.match(/!\[/g)).toHaveLength(21);
+ expect(memo.contentMarkdown).toContain('## 什么是Deepseek V3');
+ expect(memo.contentMarkdown).toMatch(/^###\s+第一步:注册华为云账号$/m);
+ expect(h.calls.saves[0].contentMarkdown).toContain('## 什么是Deepseek V3');
+ for(const noise of ['点击上方蓝字','分割线','现阶段的AI没有推理能力','DRPKCGMAPjK','iaic5Jv7oDhWHr79']) expect(memo.contentMarkdown).not.toContain(noise);
+ expect(h.calls.uploads).toHaveLength(21);
+ expect(h.calls.saves[0].contentMarkdown.match(/\/api\/v1\/resources\/res_\d+\/blob/g)).toHaveLength(21);
+});
+
test("a new platform toolbar still saves a valid selection instead of its full article", async () => {
const h = harness({ platform: "v2ex", prepare: (doc, window) => {
window.getSelection = () => ({ rangeCount: 1, toString: () => "Only this passage", getRangeAt: () => ({ cloneContents: () => {
@@ -220,6 +387,16 @@ for (const [option, message] of [["denyInstance", "instancePermissionRequired"],
}
+test("a pending saving toast cannot replace the already clicked post with a later right-click",async()=>{
+ let release,started;const gate=new Promise(resolve=>release=resolve),shown=new Promise(resolve=>started=resolve);
+ const h=harness({platform:'bluesky',fixture:'bluesky-feed',pageUrl:'https://bsky.app/profile/bsky.app',feedbackGate:()=>{started();return gate;}});
+ const cards=Array.from(h.document.querySelectorAll('[data-testid^="feedItem-by-"]'));
+ const urls=cards.slice(0,2).map(card=>Array.from(card.querySelectorAll('a[href]')).map(a=>a.getAttribute('href')).find(href=>/^\/profile\/[^/]+\/post\/[^/]+$/.test(href))).map(path=>'https://bsky.app'+path);
+ cards[0].setAttribute('data-edgeever-social-target',urls[0]);const pending=h.menu();await shown;
+ cards[0].removeAttribute('data-edgeever-social-target');cards[1].setAttribute('data-edgeever-social-target',urls[1]);release();
+ await pending;expect(h.calls.creates).toHaveLength(1);expect(h.calls.creates[0].contentMarkdown).toContain(urls[0]);expect(h.calls.creates[0].contentMarkdown).not.toContain(urls[1]);
+});
+
test("queued social menu clips freeze each clicked post before a later right-click", async()=>{
let release,started;const notebookGate=new Promise(r=>release=r),notebookStarted=new Promise(r=>started=r);
const h=harness({platform:"bluesky",pageUrl:"https://bsky.app/profile/bsky.app",notebookGate,notebookRequested:started,prepare:doc=>{doc.body.replaceWith(createWindow(readFileSync(new URL('./fixtures/platforms/bluesky-feed.html',import.meta.url),'utf8')).document.body);}});
@@ -254,3 +431,332 @@ for(const [platform,pageUrl,selector] of [
const h=harness({platform,pageUrl,prepare:doc=>doc.querySelector(selector).setAttribute('hidden','')});
const response=await h.toolbar();expect(response.ok).toBe(false);expect(response.message).toContain('platformUnreadable');expect(h.calls.creates).toHaveLength(0);expect(h.calls.uploads).toHaveLength(0);
});
+
+
+test("Douban list menu saves only the selected own short comment", async () => {
+ const h=harness({platform:"douban",fixture:"douban-comments",pageUrl:"https://book.douban.com/subject/36864764/comments/",prepare:(doc)=>{
+ doc.querySelector('.comment-item').setAttribute('data-edgeever-social-target','https://book.douban.com/comment/4237804504/');
+ }});
+ expect(await h.mode()).toEqual({kind:"social-feed"});
+ await h.menu();
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].title).toBe("散步 · 就绪雀");
+ expect(h.calls.creates[0].contentMarkdown).toContain("有很多没必要写的句子");
+ expect(h.calls.creates[0].contentMarkdown).not.toContain("翻译的存在感太明显了");
+ expect(h.calls.creates[0].tags).toEqual(["web-clip","douban"]);
+});
+
+
+test("Jike Web detail login redirects show access guidance and never save the QR page as a post",async()=>{
+ const h=harness({platform:'jike',pageUrl:'https://web.okjike.com/login?redirectURL=%2ForiginalPost%2F66ac89b0314f5cced41012d3',prepare:doc=>{doc.body.innerHTML='<p>可使用即刻App扫码</p>';}});
+ expect(await h.mode()).toEqual({kind:'login-required',platform:'platformJike',access:'login-required'});
+ expect(await h.toolbar()).toEqual({ok:false,message:'platformUnreadable'});
+ expect(h.calls.creates).toHaveLength(0);
+});
+
+for (const [platform, pageUrl, fixture, emptyMessage] of [
+ ['jike', 'https://web.okjike.com/login?redirectURL=%2ForiginalPost%2F66ac89b0314f5cced41012d3', 'jike', 'platformUnreadable'],
+ ['douban', 'https://book.douban.com/subject/36864764/comments/', 'douban-comments', 'doubanSelectComment'],
+]) {
+ test(`${platform}: no clicked selection still rejects the restricted whole page`,async()=>{
+ const h=harness({platform,pageUrl,fixture});
+ expect(await h.toolbar()).toEqual({ok:false,message:emptyMessage});expect(h.calls.creates).toHaveLength(0);
+ });
+
+ test(`${platform}: a lost selection retains the clicked text without saving the restricted whole page`, async () => {
+ const h = harness({platform, pageUrl, fixture, prepare: (doc, window) => {
+ let reads = 0;
+ window.getSelection = () => ++reads === 1 ? {toString: () => 'Selected passage'} : null;
+ }});
+ expect(await h.toolbar()).toMatchObject({ok:true});
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Selected passage');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('有很多没必要写的句子');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('AI分析');
+ });
+
+ test(`${platform}: a stable selection saves only the selected passage`, async () => {
+ const h = harness({platform, pageUrl, fixture, prepare: (doc, window) => {
+ window.getSelection = () => ({rangeCount:1, toString: () => 'Selected passage', getRangeAt: () => ({cloneContents: () => {
+ const fragment = doc.createDocumentFragment(), p = doc.createElement('p');
+ p.textContent = 'Selected passage'; fragment.appendChild(p); return fragment;
+ }})});
+ }});
+ expect(await h.toolbar()).toMatchObject({ok:true});
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Selected passage');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('有很多没必要写的句子');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('AI分析');
+ });
+
+ for (const navigation of ["navigateBeforeSelectionCapture", "navigateDuringNotebookLookup"]) {
+ test(`${platform}: ${navigation} refuses a stale selection before note creation`, async () => {
+ const h = harness({platform, pageUrl, fixture, [navigation]:true, prepare: (doc, window) => {
+ window.getSelection = () => ({rangeCount:1, toString: () => 'Selected passage', getRangeAt: () => ({cloneContents: () => {
+ const fragment = doc.createDocumentFragment(), p = doc.createElement('p');
+ p.textContent = 'Selected passage'; fragment.appendChild(p); return fragment;
+ }})});
+ }});
+ expect(await h.toolbar()).toEqual({ok:false, message:"platformPageChanged"});
+ expect(h.calls.creates).toHaveLength(0);
+ });
+ }
+}
+
+for (const secondCapture of ["selection-menu", "generic-toolbar"]) test(`restricted toolbar and another tab's ${secondCapture} never exchange capture replies`, async () => {
+ const select = (doc, text) => ({rangeCount:1, toString: () => text, getRangeAt: () => ({cloneContents: () => {
+ const fragment = doc.createDocumentFragment(), p = doc.createElement('p');
+ p.textContent = text; fragment.appendChild(p); return fragment;
+ }})});
+ const selectionWindow = createWindow('<title>Page B</title><main><p>Selected B</p></main>', 'https://example.test/selected-b');
+ selectionWindow.getSelection = () => secondCapture === "selection-menu" ? select(selectionWindow.document, 'Selected B') : null;
+ const pageUrl = 'https://book.douban.com/subject/36864764/comments/';
+ let activeTab = {id:7, url:pageUrl};
+ let releaseA, releaseB, startedA, startedB;
+ const gateA = new Promise(resolve => {releaseA = resolve;});
+ const gateB = new Promise(resolve => {releaseB = resolve;});
+ const seenA = new Promise(resolve => {startedA = resolve;});
+ const seenB = new Promise(resolve => {startedB = resolve;});
+ const h = harness({platform:'douban', fixture:'douban-comments', pageUrl, selectionWindow, activeTab:() => activeTab,
+ prepare:(doc, window) => {window.getSelection = () => select(doc, 'Selected A');},
+ captureGate:async tabId => {if (tabId === 7) {startedA(); await gateA;} else {startedB(); await gateB;}}
+ });
+ const toolbar = h.toolbar(); await seenA;
+ activeTab = {id:8, url:selectionWindow.location.href};
+ const second = secondCapture === "selection-menu" ? h.selectionMenu() : h.toolbar();
+ const overlapped = await Promise.race([seenB.then(() => true), new Promise(resolve => setTimeout(() => resolve(false), 100))]);
+ activeTab = {id:7, url:pageUrl};
+ releaseA(); releaseB();
+ expect(overlapped).toBe(false);
+ expect((await toolbar).ok).toBe(true);
+ if (secondCapture === "selection-menu") expect((await second).kind).toBe('success');
+ else expect((await second).ok).toBe(true);
+ expect(h.calls.creates).toHaveLength(2);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Selected A');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('Selected B');
+ expect(h.calls.creates[1].contentMarkdown).toContain('Selected B');
+ expect(h.calls.creates[1].contentMarkdown).not.toContain('Selected A');
+ expect(h.calls.creates[1].contentMarkdown).toContain('https://example.test/selected-b');
+});
+
+for(const phase of ['capture','notebook','queued']) test(`selection menu rejects navigation during ${phase} without saving a different page`,async()=>{
+ const selectionWindow=createWindow('<title>Original</title><p>Original selection</p>','https://example.test/original');
+ let selected='Original selection';
+ selectionWindow.getSelection=()=>({rangeCount:1,toString:()=>selected,getRangeAt:()=>({cloneContents:()=>{
+ const fragment=selectionWindow.document.createDocumentFragment(),p=selectionWindow.document.createElement('p');p.textContent=selected;fragment.appendChild(p);return fragment;
+ }})});
+ const navigate=()=>{selectionWindow.location.href='https://example.test/next';selected='Other page selection';};
+ let release,started;const gate=new Promise(resolve=>{release=resolve;}),seen=new Promise(resolve=>{started=resolve;});
+ const h=harness({selectionWindow,
+ captureGate:async()=>{if(phase==='capture')navigate();},
+ notebookRequested:()=>{if(phase==='notebook')navigate();if(phase==='queued')started();},
+ notebookGate:phase==='queued'?gate:undefined,
+ });
+ let first;
+ if(phase==='queued'){first=h.toolbar();await seen;}
+ const menu=h.selectionMenu();
+ if(phase==='queued'){navigate();release();await first;}
+ expect((await menu).kind).toBe('error');
+ expect(h.calls.feedback.at(-1).message).toContain('platformPageChanged');
+ expect(h.calls.creates).toHaveLength(phase==='queued'?1:0);
+ expect(h.calls.creates.every(memo=>!memo.contentMarkdown.includes('Other page selection'))).toBe(true);
+});
+
+for(const changed of [false,true]) test(`iframe selection ${changed?'navigation is rejected':'keeps its own source while binding the top-level tab'}`,async()=>{
+ const selectionWindow=createWindow('<title>Frame</title><p>Frame selection</p>','https://frame.test/original');
+ selectionWindow.getSelection=()=>({rangeCount:1,toString:()=> 'Frame selection',getRangeAt:()=>({cloneContents:()=>{
+ const fragment=selectionWindow.document.createDocumentFragment(),p=selectionWindow.document.createElement('p');p.textContent='Frame selection';fragment.appendChild(p);return fragment;
+ }})});
+ const h=harness({selectionWindow,selectionFrameId:3,selectionTabUrl:()=> 'https://example.test/parent',captureGate:async()=>{if(changed)selectionWindow.location.href='https://frame.test/next';}});
+ expect((await h.selectionMenu()).kind).toBe(changed?'error':'success');
+ expect(h.calls.creates).toHaveLength(changed?0:1);
+ if(!changed) {expect(h.calls.creates[0].contentMarkdown).toContain('https://frame.test/original');expect(h.calls.creates[0].contentMarkdown).not.toContain('https://example.test/parent');}
+});
+
+test('selection menu retains the browser text fallback when injection is unavailable on the same page',async()=>{
+ const selectionWindow=createWindow('<title>Original</title>','https://example.test/original');selectionWindow.getSelection=()=>({toString:()=> 'Original selection'});
+ const h=harness({selectionWindow,captureGate:async()=>{throw new Error('Cannot access contents of the page');}});
+ expect((await h.selectionMenu()).kind).toBe('success');expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Original selection');expect(h.calls.creates[0].contentMarkdown).toContain('https://example.test/original');
+});
+
+test("a timed-out capture's late reply cannot complete the next queued selection", async () => {
+ const select = (doc, text) => ({rangeCount:1, toString: () => text, getRangeAt: () => ({cloneContents: () => {
+ const fragment = doc.createDocumentFragment(), p = doc.createElement('p');
+ p.textContent = text; fragment.appendChild(p); return fragment;
+ }})});
+ const selectionWindow = createWindow('<title>Page B</title><p>Selected B</p>', 'https://example.test/selected-b');
+ selectionWindow.getSelection = () => select(selectionWindow.document, 'Selected B');
+ let releaseA, releaseB, startedA, startedB, expireCapture;
+ const gateA = new Promise(resolve => {releaseA = resolve;});
+ const gateB = new Promise(resolve => {releaseB = resolve;});
+ const seenA = new Promise(resolve => {startedA = resolve;});
+ const seenB = new Promise(resolve => {startedB = resolve;});
+ const h = harness({platform:'douban', fixture:'douban-comments', pageUrl:'https://book.douban.com/subject/36864764/comments/', selectionWindow,
+ prepare:(doc, window) => {window.getSelection = () => select(doc, 'Selected A');},
+ // Drive the actual capture timeout callback without waiting fifteen seconds.
+ backgroundSetTimeout:(callback, delay, ...args) => {
+ if (delay === 15_000) {expireCapture = callback; return 0;}
+ return setTimeout(callback, delay, ...args);
+ },
+ captureGate:async tabId => {if (tabId === 7) {startedA(); await gateA;} else {startedB(); await gateB;}}
+ });
+ const toolbar = h.toolbar(); await seenA;
+ const menu = h.selectionMenu();
+ expireCapture();
+ expect(await toolbar).toEqual({ok:false, message:'captureTimeout'});
+ await seenB;
+ releaseA();
+ await new Promise(resolve => setTimeout(resolve, 0));
+ expect(h.calls.creates).toHaveLength(0);
+ releaseB();
+ expect((await menu).kind).toBe('success');
+ expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].contentMarkdown).toContain('Selected B');
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('Selected A');
+ expect(h.calls.creates[0].contentMarkdown).toContain('https://example.test/selected-b');
+});
+
+for(const [platform,pageUrl,tag,author,time] of [
+ ['medium-article','https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e','medium','Scott Batson',clipDateTimeText('2026-08-31T18:48:46Z')],
+ ['substack-article','https://www.oneusefulthing.org/p/the-dot-and-the-swarm','substack','Ethan Mollick',clipDateTimeText('2026-10-01T18:54:12+08:00')],
+]) test(`${platform}: actual capture/save keeps platform metadata and uses shared image archival`,async()=>{
+ const h=harness({platform,pageUrl});expect(await h.toolbar()).toMatchObject({ok:true});
+ expect(h.calls.creates).toHaveLength(1);const memo=h.calls.creates[0];expect(memo.tags).toEqual(['web-clip',tag]);expect(memo.contentMarkdown).toContain(author);expect(memo.contentMarkdown).toContain(time);expect(h.calls.uploads.length).toBeGreaterThan(0);expect(h.calls.saves[0].contentMarkdown).toContain('/api/v1/resources/');
+});
+test('Jike topic menu saves precisely the marked card while toolbar asks for a post or selection',async()=>{
+ const h=harness({platform:'jike',fixture:'jike-feed',pageUrl:'https://m.okjike.com/topics/63579abb6724cc583b9bba9a',prepare:doc=>doc.querySelectorAll('.post-item-li')[1].setAttribute('data-edgeever-social-target','https://m.okjike.com/originalPosts/6ace942f756bbb66581c3f96')});
+ expect(await h.mode()).toEqual({kind:'social-feed'});expect(await h.toolbar()).toEqual({ok:false,message:'socialSelectPost'});expect(h.calls.creates).toHaveLength(0);
+ await h.menu();expect(h.calls.creates).toHaveLength(1);expect(h.calls.creates[0].contentMarkdown).toContain('JimHuiHui');expect(h.calls.creates[0].contentMarkdown).toContain('护城河');expect(h.calls.creates[0].contentMarkdown).not.toContain('Ambi');expect(h.calls.creates[0].tags).toEqual(['web-clip','jike']);expect(h.calls.uploads).toHaveLength(1);
+});
+test('a real Substack paywall warns and refuses a whole-article preview',async()=>{
+ const h=harness({platform:'substack-article',fixture:'substack-paywall',pageUrl:'https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense'});
+ expect(await h.mode()).toEqual({kind:'page',platform:'Substack',access:'content-restricted'});expect(await h.toolbar()).toEqual({ok:false,message:'pageCaptureRestrictedHint'});expect(h.calls.creates).toHaveLength(0);expect(h.calls.uploads).toHaveLength(0);
+});
+
+test('Substack restricted article still saves an explicit visible passage',async()=>{
+ const h=harness({platform:'substack-article',fixture:'substack-paywall',pageUrl:'https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense',prepare:(doc,w)=>{
+ w.getSelection=()=>({rangeCount:1,toString:()=> 'Selected visible passage',getRangeAt:()=>({cloneContents:()=>{const fragment=doc.createDocumentFragment(),p=doc.createElement('p');p.textContent='Selected visible passage';fragment.appendChild(p);return fragment;}})});
+ }});
+ expect(await h.toolbar()).toMatchObject({ok:true});expect(h.calls.creates).toHaveLength(1);expect(h.calls.creates[0].contentMarkdown).toContain('Selected visible passage');expect(h.calls.creates[0].contentMarkdown).not.toContain('Step 7');expect(h.calls.creates[0].tags).toEqual(['web-clip']);
+});
+
+test('Substack article identity survives missing body and refuses a paywall-only generic fallback',async()=>{
+ for(const fixture of ['substack-paywall','substack-article']) for(const selector of ['.body.markup','h1.post-title']) {
+ const h=harness({platform:'substack-article',fixture,pageUrl:fixture==='substack-paywall'?'https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense':'https://www.oneusefulthing.org/p/the-dot-and-the-swarm',prepare:doc=>doc.querySelector(selector).remove()});
+ expect((await h.mode()).platform).toBe('Substack');expect((await h.toolbar()).ok).toBe(false);expect(h.calls.creates).toHaveLength(0);
+ }
+});
+
+for(const [platform,pageUrl] of [['medium-article','https://scottbatson.dev/what-should-programmers-do-while-the-ai-writes-code-a2ce2e6de88e'],['substack-article','https://www.oneusefulthing.org/p/the-dot-and-the-swarm']]) {
+ for(const failure of ['failDownload','failUpload','failRewrite']) test(`${platform}: ${failure} keeps one note and reports incomplete image archival`,async()=>{
+ const h=harness({platform,pageUrl,[failure]:true});expect(await h.toolbar()).toEqual({ok:true,message:'platformImagesPartial'});expect(h.calls.creates).toHaveLength(1);
+ });
+}
+
+for(const failure of ['failDownload','failUpload','failRewrite']) test(`generic toolbar and selection report ${failure} instead of complete image archival`,async()=>{
+ const html='<title>Article</title><article><p>Saved article content with enough text for the normal page extraction path and an embedded image.</p><img src="https://example.test/photo.png"></article>';
+ const generic=harness({platform:'v2ex',pageUrl:'https://example.test/article',[failure]:true,prepare:doc=>{doc.documentElement.innerHTML=createDocument(html).documentElement.innerHTML;}});
+ expect(await generic.toolbar()).toEqual({ok:true,message:'platformImagesPartial'});expect(generic.calls.creates).toHaveLength(1);
+ const selectionWindow=createWindow(html,'https://example.test/article');
+ selectionWindow.getSelection=()=>({rangeCount:1,toString:()=> 'Selected article',getRangeAt:()=>({cloneContents:()=>{const f=selectionWindow.document.createDocumentFragment();f.appendChild(selectionWindow.document.querySelector('article').cloneNode(true));return f;}})});
+ const selection=harness({selectionWindow,[failure]:true});
+ expect(await selection.selectionMenu()).toMatchObject({message:'platformImagesPartial',kind:'success'});expect(selection.calls.creates).toHaveLength(1);
+});
+
+
+for(const action of ['toolbar','menu']) test(`LinkedIn ${action} saves professional metadata without changing the author or publication label`,async()=>{
+ const h=harness({platform:'linkedin',fixture:'linkedin-person',pageUrl:'https://www.linkedin.com/posts/maddyahmad_softwareengineering-artificialintelligence-share-7456582751698190336-6NVK/'});
+ await h[action]();expect(h.calls.creates).toHaveLength(1);
+ const note=h.calls.creates[0];
+ expect(note.contentMarkdown).toContain('platformAuthorLabel: Mohammad Ahmed · Technical Lead - Backend at Dizzaract');
+ expect(note.contentMarkdown).toContain('5 个月前');
+ expect(note.contentMarkdown).toContain('urn:li:share:7456582751698190336');
+ expect(note.contentMarkdown).not.toContain('3 度+');
+ expect(note.tags).toEqual(['web-clip','linkedin']);
+});
+
+test('Xueqiu right-click on a truncated feed saves only the selected full public detail and archives its image',async()=>{
+ const target='https://xueqiu.com/2754211668/411841572';
+ const h=harness({platform:'xueqiu',fixture:'xueqiu-feed',pageUrl:'https://www.xueqiu.com/',prepare:doc=>{
+ const link=Array.from(doc.querySelectorAll('a[class*="date-and-source_"]')).find(a=>a.getAttribute('href')==='/2754211668/411841572');
+ link.closest('[class*="timeline__item__main_"]').setAttribute('data-edgeever-social-target',target);
+ },detailLoad:frame=>{
+ expect(frame.src).toBe('https://www.xueqiu.com/2754211668/411841572');expect(frame.getAttribute('sandbox')).toBe('allow-same-origin');
+ return createWindow(readFileSync(new URL('./fixtures/platforms/xueqiu-feed-detail-second.html',import.meta.url),'utf8'),frame.src).document;
+ }});
+ await h.menu();expect(h.calls.creates).toHaveLength(1);
+ expect(h.calls.creates[0].contentMarkdown).toContain('把自己的真金白银押在别人的嘴上,早晚是要付出代价的。');
+ expect(h.calls.creates[0].contentMarkdown).toContain(target);
+ expect(h.calls.creates[0].contentMarkdown).not.toContain('6114376649/411862401');
+ expect(h.calls.creates[0].tags).toEqual(['web-clip','xueqiu','投资','09992','NTES']);
+ expect(h.calls.uploads).toHaveLength(1);expect(h.calls.saves).toHaveLength(1);
+ expect(JSON.stringify(h.calls.saves[0])).toContain('res_1');
+ expect(JSON.stringify(h.calls.saves[0])).not.toContain('https://xqimg.imedao.com/');
+});
+
+
+for(const action of ['selection-menu','generic-toolbar','platform-toolbar','feed-toolbar']) test(`${action}: a queued click keeps A after the live selection becomes B`,async()=>{
+ const url=action==='platform-toolbar'?'https://www.v2ex.com/t/1000000':action==='feed-toolbar'?'https://xueqiu.com/':'https://example.test/selection';
+ const selectedWindow=createWindow('<title>Selected page</title><main><p>Original whole article content stays here.</p></main>',url);
+ let selected='Original clicked A';
+ selectedWindow.getSelection=()=>({rangeCount:1,toString:()=>selected,getRangeAt:()=>({cloneContents:()=>{const fragment=selectedWindow.document.createDocumentFragment(),p=selectedWindow.document.createElement('p');p.textContent=selected;fragment.appendChild(p);return fragment;}})});
+ let activeTab={id:7,url:urls['hacker-news']},release,started;
+ const gate=new Promise(resolve=>release=resolve),seen=new Promise(resolve=>started=resolve);
+ const h=harness({selectionWindow:selectedWindow,activeTab:()=>activeTab,notebookGate:gate,notebookRequested:started});
+ const first=h.toolbar();await seen;activeTab={id:8,url};
+ const second=action==='selection-menu'?h.selectionMenu():h.toolbar();
+ await new Promise(resolve=>setTimeout(resolve,0));selected='Later unrequested B';release();
+ await first;const result=await second;
+ expect(action==='selection-menu'?result.kind==='success':result.ok).toBe(true);
+ expect(h.calls.creates).toHaveLength(2);expect(h.calls.creates[1].contentMarkdown).toContain('Original clicked A');
+ expect(h.calls.creates[1].contentMarkdown).not.toContain('Later unrequested B');
+});
+
+test('a whole-page toolbar click cannot become a later selection while queued',async()=>{
+ const url='https://example.test/whole-page',selectedWindow=createWindow('<title>Whole page</title><main><p>Original whole article content stays here and contains several sentences for reading.</p></main>',url);
+ let selected='';selectedWindow.getSelection=()=>selected?{rangeCount:1,toString:()=>selected,getRangeAt:()=>({cloneContents:()=>{const f=selectedWindow.document.createDocumentFragment();f.appendChild(selectedWindow.document.createTextNode(selected));return f;}})}:null;
+ let activeTab={id:7,url:urls['hacker-news']},release,started;
+ const gate=new Promise(resolve=>release=resolve),seen=new Promise(resolve=>started=resolve);
+ const h=harness({selectionWindow:selectedWindow,activeTab:()=>activeTab,notebookGate:gate,notebookRequested:started});
+ const first=h.toolbar();await seen;activeTab={id:8,url};const second=h.toolbar();
+ await new Promise(resolve=>setTimeout(resolve,0));selected='Later selected B';release();await first;expect((await second).ok).toBe(true);
+ expect(h.calls.creates[1].contentMarkdown).toContain('Original whole article content');expect(h.calls.creates[1].contentMarkdown).not.toContain('Later selected B');
+});
+
+test('selection feedback delay cannot change the clicked passage',async()=>{
+ const selectedWindow=createWindow('<title>Selection</title><main>Original text</main>','https://example.test/selection');
+ let selected='Original clicked A',release,started;
+ const gate=new Promise(resolve=>release=resolve),seen=new Promise(resolve=>started=resolve);
+ selectedWindow.getSelection=()=>({rangeCount:1,toString:()=>selected,getRangeAt:()=>({cloneContents:()=>{const f=selectedWindow.document.createDocumentFragment();f.appendChild(selectedWindow.document.createTextNode(selected));return f;}})});
+ const h=harness({selectionWindow:selectedWindow,feedbackGate:()=>{started();return gate;}}),pending=h.selectionMenu();
+ await seen;selected='Later unrequested B';release();expect((await pending).kind).toBe('success');
+ expect(h.calls.creates[0].contentMarkdown).toContain('Original clicked A');expect(h.calls.creates[0].contentMarkdown).not.toContain('Later unrequested B');
+});
+
+test('changed selection saves the original literal text without Markdown reinterpretation', async () => {
+ const original='First\n====\n\n const value = a * b;\n if (value < 10) run();\n\n[title](https://example.test) &copy;';
+ const selectedWindow=createWindow('<title>Selection</title><main>Original text</main>','https://example.test/selection');
+ let selected=original,release,started;
+ const gate=new Promise(resolve=>release=resolve),seen=new Promise(resolve=>started=resolve);
+ selectedWindow.getSelection=()=>({rangeCount:1,toString:()=>selected,getRangeAt:()=>({cloneContents:()=>{const f=selectedWindow.document.createDocumentFragment();f.appendChild(selectedWindow.document.createTextNode(selected));return f;}})});
+ const h=harness({selectionWindow:selectedWindow,feedbackGate:()=>{started();return gate;}}),pending=h.selectionMenu();
+ await seen;selected='Later unrequested B';release();expect((await pending).kind).toBe('success');
+ const doc=markdownToDoc(h.calls.creates[0].contentMarkdown),nodes=[];
+ const visit=node=>{nodes.push(node);(node.content||[]).forEach(visit);};visit(doc);
+ expect(nodes.some(node=>['heading','codeBlock','image'].includes(node.type))).toBe(false);
+ expect(nodes.filter(node=>node.type==='text').map(node=>node.text).join('').replace(/\n/g,'')).toStartWith(original.replace(/\n/g,''));
+ expect(JSON.stringify(doc)).not.toContain('Later unrequested B');
+});
+
+test('stable rich selection preserves code blank lines and archives its selected image',async()=>{
+ const code='const first = 1;\n\n\nconst second = 2;',url='https://example.test/selection',selectedWindow=createWindow('<title>Code selection</title><main></main>',url);
+ selectedWindow.getSelection=()=>({rangeCount:1,toString:()=>code,getRangeAt:()=>({cloneContents:()=>{
+ const f=selectedWindow.document.createDocumentFragment(),pre=selectedWindow.document.createElement('pre'),el=selectedWindow.document.createElement('code'),image=selectedWindow.document.createElement('img');
+ el.className='language-js';el.textContent=code;pre.appendChild(el);f.appendChild(pre);image.src='https://example.test/selected.png';f.appendChild(image);return f;
+ }})});
+ const h=harness({selectionWindow:selectedWindow});expect((await h.selectionMenu()).kind).toBe('success');
+ const doc=markdownToDoc(h.calls.saves[0].contentMarkdown);
+ expect(doc.content.find(node=>node.type==='codeBlock').content[0].text).toBe(code);
+ expect(h.calls.uploads).toHaveLength(1);expect(JSON.stringify(doc)).toContain('/api/v1/resources/res_1/blob');
+});
diff --git a/apps/extension/popup.test.mjs b/apps/extension/popup.test.mjs
index 0515c09d..47876aea 100644
--- a/apps/extension/popup.test.mjs
+++ b/apps/extension/popup.test.mjs
@@ -54,3 +54,51 @@ test("popup retains background failures and localized success fallback", async (
expect(await captureCurrentPage(settings)).toBe("savedToEdgeEver");
});
});
+
+const withPopup = async (mode, run) => {
+ const { parseHTML } = await import("linkedom");
+ const { window } = parseHTML('<html><body><div id="root"></div></body></html>');
+ const globals = { window, document: window.document, Node: window.Node, Element: window.Element, HTMLElement: window.HTMLElement, MutationObserver: window.MutationObserver, IS_REACT_ACT_ENVIRONMENT: true };
+ const originals = new Map(Object.keys(globals).map(key => [key, Object.getOwnPropertyDescriptor(globalThis, key)]));
+ for (const [key, value] of Object.entries(globals)) Object.defineProperty(globalThis, key, { value, writable: true, configurable: true });
+ const { act, createElement } = await import("react");
+ const { createRoot } = await import("react-dom/client");
+ const { Popup } = await import("./src/ui/popup.tsx");
+ let root;
+ try {
+ await withChrome({
+ storage: { local: { get: async () => settings } },
+ permissions: { request: async () => true },
+ runtime: { sendMessage: async message => message.type === "getCurrentPageCaptureMode" ? mode : { ok: true, message: "Saved selected content" } },
+ }, async () => {
+ await act(async () => { root = createRoot(window.document.getElementById("root")); root.render(createElement(Popup)); });
+ await run({ document: window.document, click: async () => { await act(async () => window.document.getElementById("save").dispatchEvent(new window.Event("click", { bubbles: true }))); } });
+ });
+ } finally {
+ if (root) await act(async () => root.unmount());
+ for (const [key, descriptor] of originals) { if (descriptor) Object.defineProperty(globalThis, key, descriptor); else delete globalThis[key]; }
+ }
+};
+
+for (const [access, label, hint] of [["login-required", "pageCaptureLoginRequired", "pageCaptureLoginHint"], ["content-restricted", "pageCaptureRestricted", "pageCaptureRestrictedHint"]]) {
+ test(`React popup shows ${access} while retaining explicit selected-text capture`, async () => {
+ await withPopup({ kind: "platform", platform: "BOSS", access }, async ({ document, click }) => {
+ expect(document.getElementById("capture-context").dataset.kind).toBe(access);
+ expect(document.getElementById("capture-context").getAttribute("aria-label")).toBe(`BOSS · ${label}`);
+ expect(document.getElementById("capture-mode").textContent).toBe(label);
+ expect(document.getElementById("status").textContent).toBe(hint);
+ expect(document.getElementById("save").disabled).toBe(false);
+ await click();
+ expect(document.getElementById("status").textContent).toBe("Saved selected content");
+ expect(document.getElementById("save").disabled).toBe(false);
+ });
+ });
+}
+
+test("React popup does not label an unknown page adapted from a platform name alone", async () => {
+ await withPopup({ kind: "unknown", platform: "BOSS", access: "login-required" }, async ({ document }) => {
+ expect(document.getElementById("capture-context").dataset.kind).toBe("generic");
+ expect(document.getElementById("capture-mode").textContent).toBe("pageCaptureUnknown");
+ expect(document.getElementById("status").textContent).toBe("");
+ });
+});
diff --git a/apps/extension/public/_locales/en/messages.json b/apps/extension/public/_locales/en/messages.json
index 640779da..39f12dde 100644
--- a/apps/extension/public/_locales/en/messages.json
+++ b/apps/extension/public/_locales/en/messages.json
@@ -707,5 +707,68 @@
},
"clipNotifications": {
"message": "Clipping notifications"
+ },
+ "saveBossToEdgeEver": {
+ "message": "Save BOSS Zhipin job to EdgeEver"
+ },
+ "saveXueqiuToEdgeEver": {
+ "message": "Save Xueqiu post to EdgeEver"
+ },
+ "platformBoss": {
+ "message": "BOSS Zhipin"
+ },
+ "platformXueqiu": {
+ "message": "Xueqiu"
+ },
+ "pageCaptureLoginRequired": {
+ "message": "Sign in needed"
+ },
+ "pageCaptureLoginHint": {
+ "message": "This job shows a login preview. Sign in on the website and refresh before clipping the full content; selected text can still be saved."
+ },
+ "platformWechat": {
+ "message": "WeChat"
+ },
+ "saveWechatToEdgeEver": {
+ "message": "Save WeChat to EdgeEver"
+ },
+ "platformJike": {
+ "message": "Jike"
+ },
+ "saveJikeToEdgeEver": {
+ "message": "Save Jike to EdgeEver"
+ },
+ "platformSspai": {
+ "message": "SSPAI"
+ },
+ "saveSspaiToEdgeEver": {
+ "message": "Save SSPAI to EdgeEver"
+ },
+ "platformJuejin": {
+ "message": "Juejin"
+ },
+ "saveJuejinToEdgeEver": {
+ "message": "Save Juejin to EdgeEver"
+ },
+ "platformDouban": {
+ "message": "Douban"
+ },
+ "saveDoubanToEdgeEver": {
+ "message": "Save Douban to EdgeEver"
+ },
+ "platformOfficialAccountLabel": {
+ "message": "Official account"
+ },
+ "platformListSourceLabel": {
+ "message": "Source list"
+ },
+ "doubanSelectComment": {
+ "message": "Right-click the short comment and choose “Save Douban to EdgeEver”, or capture selected text."
+ },
+ "pageCaptureRestricted": {
+ "message": "Content restricted"
+ },
+ "pageCaptureRestrictedHint": {
+ "message": "Only a restricted preview is available. Get full reading access on the website and refresh, or select a visible passage to save."
}
}
diff --git a/apps/extension/public/_locales/ja/messages.json b/apps/extension/public/_locales/ja/messages.json
index 7b5a96de..7320c734 100644
--- a/apps/extension/public/_locales/ja/messages.json
+++ b/apps/extension/public/_locales/ja/messages.json
@@ -707,5 +707,68 @@
},
"clipNotifications": {
"message": "クリップの通知"
+ },
+ "saveBossToEdgeEver": {
+ "message": "BOSS直聘の求人をEdgeEverに保存"
+ },
+ "saveXueqiuToEdgeEver": {
+ "message": "雪球の投稿をEdgeEverに保存"
+ },
+ "platformBoss": {
+ "message": "BOSS直聘"
+ },
+ "platformXueqiu": {
+ "message": "雪球"
+ },
+ "pageCaptureLoginRequired": {
+ "message": "ログインが必要"
+ },
+ "pageCaptureLoginHint": {
+ "message": "この求人はログイン前のプレビューです。サイトにログインして再読み込みしてから全文を保存してください。選択したテキストは保存できます。"
+ },
+ "platformWechat": {
+ "message": "WeChat"
+ },
+ "saveWechatToEdgeEver": {
+ "message": "WeChatを EdgeEver に保存"
+ },
+ "platformJike": {
+ "message": "Jike"
+ },
+ "saveJikeToEdgeEver": {
+ "message": "Jikeを EdgeEver に保存"
+ },
+ "platformSspai": {
+ "message": "SSPAI"
+ },
+ "saveSspaiToEdgeEver": {
+ "message": "SSPAIを EdgeEver に保存"
+ },
+ "platformJuejin": {
+ "message": "Juejin"
+ },
+ "saveJuejinToEdgeEver": {
+ "message": "Juejinを EdgeEver に保存"
+ },
+ "platformDouban": {
+ "message": "Douban"
+ },
+ "saveDoubanToEdgeEver": {
+ "message": "Doubanを EdgeEver に保存"
+ },
+ "platformOfficialAccountLabel": {
+ "message": "公式アカウント"
+ },
+ "platformListSourceLabel": {
+ "message": "元の一覧"
+ },
+ "doubanSelectComment": {
+ "message": "短評を右クリックして「Douban を EdgeEver に保存」を選ぶか、選択したテキストを保存してください。"
+ },
+ "pageCaptureRestricted": {
+ "message": "内容に制限あり"
+ },
+ "pageCaptureRestrictedHint": {
+ "message": "現在のページは制限付きプレビューです。サイトで全文の閲覧権限を取得して再読み込みするか、表示されている文章を選択して保存してください。"
}
}
diff --git a/apps/extension/public/_locales/pl/messages.json b/apps/extension/public/_locales/pl/messages.json
index aaa73dff..02bca8c6 100644
--- a/apps/extension/public/_locales/pl/messages.json
+++ b/apps/extension/public/_locales/pl/messages.json
@@ -707,5 +707,68 @@
},
"clipNotifications": {
"message": "Powiadomienia o zapisywaniu"
+ },
+ "saveBossToEdgeEver": {
+ "message": "Zapisz ofertę BOSS Zhipin w EdgeEver"
+ },
+ "saveXueqiuToEdgeEver": {
+ "message": "Zapisz wpis Xueqiu w EdgeEver"
+ },
+ "platformBoss": {
+ "message": "BOSS Zhipin"
+ },
+ "platformXueqiu": {
+ "message": "Xueqiu"
+ },
+ "pageCaptureLoginRequired": {
+ "message": "Wymaga logowania"
+ },
+ "pageCaptureLoginHint": {
+ "message": "Oferta pokazuje podgląd przed zalogowaniem. Zaloguj się w witrynie i odśwież stronę przed zapisaniem pełnej treści. Zaznaczony tekst nadal można zapisać."
+ },
+ "platformWechat": {
+ "message": "WeChat"
+ },
+ "saveWechatToEdgeEver": {
+ "message": "Zapisz WeChat w EdgeEver"
+ },
+ "platformJike": {
+ "message": "Jike"
+ },
+ "saveJikeToEdgeEver": {
+ "message": "Zapisz Jike w EdgeEver"
+ },
+ "platformSspai": {
+ "message": "SSPAI"
+ },
+ "saveSspaiToEdgeEver": {
+ "message": "Zapisz SSPAI w EdgeEver"
+ },
+ "platformJuejin": {
+ "message": "Juejin"
+ },
+ "saveJuejinToEdgeEver": {
+ "message": "Zapisz Juejin w EdgeEver"
+ },
+ "platformDouban": {
+ "message": "Douban"
+ },
+ "saveDoubanToEdgeEver": {
+ "message": "Zapisz Douban w EdgeEver"
+ },
+ "platformOfficialAccountLabel": {
+ "message": "Konto oficjalne"
+ },
+ "platformListSourceLabel": {
+ "message": "Lista źródłowa"
+ },
+ "doubanSelectComment": {
+ "message": "Kliknij krótką opinię prawym przyciskiem i wybierz „Zapisz Douban w EdgeEver” lub zapisz zaznaczony tekst."
+ },
+ "pageCaptureRestricted": {
+ "message": "Ograniczona treść"
+ },
+ "pageCaptureRestrictedHint": {
+ "message": "Dostępny jest tylko ograniczony podgląd. Uzyskaj pełny dostęp na stronie i odśwież ją lub zaznacz widoczny fragment do zapisania."
}
}
diff --git a/apps/extension/public/_locales/zh_CN/messages.json b/apps/extension/public/_locales/zh_CN/messages.json
index 2f69cdcc..2f9b3465 100644
--- a/apps/extension/public/_locales/zh_CN/messages.json
+++ b/apps/extension/public/_locales/zh_CN/messages.json
@@ -707,5 +707,68 @@
},
"clipNotifications": {
"message": "剪藏提示"
+ },
+ "saveBossToEdgeEver": {
+ "message": "保存 BOSS 直聘岗位到 EdgeEver"
+ },
+ "saveXueqiuToEdgeEver": {
+ "message": "保存雪球帖子到 EdgeEver"
+ },
+ "platformBoss": {
+ "message": "BOSS 直聘"
+ },
+ "platformXueqiu": {
+ "message": "雪球"
+ },
+ "pageCaptureLoginRequired": {
+ "message": "需登录"
+ },
+ "pageCaptureLoginHint": {
+ "message": "当前岗位仅显示登录预览。请在网站登录并刷新后再剪藏全文;仍可保存选中文字。"
+ },
+ "platformWechat": {
+ "message": "微信公众号"
+ },
+ "saveWechatToEdgeEver": {
+ "message": "保存微信公众号到 EdgeEver"
+ },
+ "platformJike": {
+ "message": "即刻"
+ },
+ "saveJikeToEdgeEver": {
+ "message": "保存即刻到 EdgeEver"
+ },
+ "platformSspai": {
+ "message": "少数派"
+ },
+ "saveSspaiToEdgeEver": {
+ "message": "保存少数派到 EdgeEver"
+ },
+ "platformJuejin": {
+ "message": "掘金"
+ },
+ "saveJuejinToEdgeEver": {
+ "message": "保存掘金到 EdgeEver"
+ },
+ "platformDouban": {
+ "message": "豆瓣"
+ },
+ "saveDoubanToEdgeEver": {
+ "message": "保存豆瓣到 EdgeEver"
+ },
+ "platformOfficialAccountLabel": {
+ "message": "公众号"
+ },
+ "platformListSourceLabel": {
+ "message": "原列表"
+ },
+ "doubanSelectComment": {
+ "message": "请在目标短评上右键选择“保存豆瓣到 EdgeEver”,或选中文字后剪藏。"
+ },
+ "pageCaptureRestricted": {
+ "message": "内容受限"
+ },
+ "pageCaptureRestrictedHint": {
+ "message": "当前页面只有受限预览。请先在网站取得完整阅读权限并刷新,或选中可见段落后保存。"
}
}
diff --git a/apps/extension/selection-clip.test.mjs b/apps/extension/selection-clip.test.mjs
index f6d1aacc..479cfc06 100644
--- a/apps/extension/selection-clip.test.mjs
+++ b/apps/extension/selection-clip.test.mjs
@@ -1,5 +1,6 @@
import { describe, expect, test } from "bun:test";
-import { selectionNoteMarkdown, selectionNoteTitle } from "./src/selection-clip.ts";
+import { markdownToDoc } from "../../packages/shared/src/content.ts";
+import { selectionNoteMarkdown, selectionNoteTitle, selectionTextMarkdown } from "./src/selection-clip.ts";
describe("selection note", () => {
test("uses the selected passage as the title and keeps the page as a fallback", () => {
@@ -17,9 +18,29 @@ describe("selection note", () => {
sourceLabel: "来源",
capturedAtLabel: "抓取时间",
});
- expect(markdown.startsWith("保留的段落。\n\n第二段。")).toBe(true);
+ expect(markdown.startsWith("保留的段落。\n\n\n\n第二段。")).toBe(true);
expect(markdown).toContain("[https://example.com/a(b)](https://example.com/a%28b%29)");
expect(markdown).toContain("抓取时间: 2026-09-27T00:00:00.000Z");
- expect(markdown).not.toContain("\n\n\n");
+ expect(markdown).toContain("保留的段落。\n\n\n\n第二段。");
});
});
+
+
+test('frozen plain selection fallback preserves literal formatting, indentation, URLs and entities', () => {
+ const values = [
+ '![literal](https://example.test/a.png)\n\n# Text &copy; <img src=x>\n\n~~strike~~',
+ 'First\n====\n\n> quoted\n---',
+ 'Intro\n\n const value = a * b;\n if (value < 10) run();',
+ '\t<img src=x> *literal*',
+ '[title](https://example.test) https://example.test/a?x=1 www.example.test [email protected]',
+ '&lt;literal&gt; &#32; $math$ **bold** `code`',
+ ];
+ for (const value of values) {
+ const doc = markdownToDoc(selectionTextMarkdown(value)), nodes = [];
+ const visit = (node) => { nodes.push(node); (node.content || []).forEach(visit); };
+ visit(doc);
+ expect(nodes.every((node) => ['doc', 'paragraph', 'text', 'hardBreak'].includes(node.type))).toBe(true);
+ expect(nodes.filter((node) => node.type === 'text').map((node) => node.text).join('').replace(/\n/g, '')).toBe(value.replace(/\n/g, ''));
+ expect(nodes.some((node) => node.marks?.length)).toBe(false);
+ }
+});
diff --git a/apps/extension/social-clip.test.mjs b/apps/extension/social-clip.test.mjs
index 29f273d2..13711f78 100644
--- a/apps/extension/social-clip.test.mjs
+++ b/apps/extension/social-clip.test.mjs
@@ -3,7 +3,7 @@ import {expect,test} from 'bun:test';
import {createDocument} from '@mixmark-io/domino';
import {readFileSync} from 'node:fs';
import {platformTarget, socialPlatform} from './src/platform-clip.ts';
-import {readSocial} from './src/social-clip.ts';
+import {readSocial,socialPostCard} from './src/social-clip.ts';
export const socialSamples={
bluesky:{url:'https://bsky.app/profile/bsky.app/post/3mhgg5ja5gc2w',title:'v1.119 is live!',author:'Bluesky',images:1,text:"what's a bot and what's not."},
facebook:{url:'https://www.facebook.com/NASA/posts/pfbid0dPToN66CzcAHGMoaNe3jszH4FfBKvqkE5gogCNJkTxXDPsSGYrGvcVwsLgByyMQQl',author:'NASA - National Aeronautics and Space Administration',images:1,text:'in the red cloud'},
@@ -12,7 +12,39 @@ export const socialSamples={
linkedin:{url:'https://www.linkedin.com/posts/friends-of-nasa_nasa-space-astronomy-activity-7497764718095323136-NRvr',title:'Nancy Grace Roman Space Telescope: Launch Preparations | NASA Kennedy',author:'Friends of NASA',images:8,text:'144.47 MB'},
};
const fixture=n=>createDocument(readFileSync(new URL(`./fixtures/platforms/${n}.html`,import.meta.url),'utf8'));
+export const linkedinPersonUrl='https://www.linkedin.com/posts/maddyahmad_softwareengineering-artificialintelligence-share-7456582751698190336-6NVK/';
const linkedinUgcUrl='https://www.linkedin.com/posts/nasa-space-astronomy-ugcPost-7497764716677758977-qmKO/';
+
+for(const name of ['facebook','bluesky','linkedin']) test(`${name}: a preceding nested post cannot replace the original body`,()=>{
+ const doc=fixture(name),target=platformTarget(socialSamples[name].url),card=socialPostCard(doc,target);
+ if(name==='linkedin') {doc.querySelectorAll('script,[data-test-id="feed-images-content__overlay"]').forEach(node=>node.remove());}
+ const before=readSocial(doc,target);expect(before.ok).toBe(true);
+ const nested=card.cloneNode(true),selector={facebook:'[data-ad-preview="message"]',bluesky:'[data-testid="postText"], [data-word-wrap="1"]',linkedin:'[data-test-id="main-feed-activity-card__commentary"]'}[name];
+ nested.querySelector(selector).textContent='COMMENT BODY SENTINEL';
+ if(name==='linkedin') nested.setAttribute('data-activity-urn','urn:li:activity:123456789');
+ else for(const link of Array.from(nested.querySelectorAll('a[href]'))) if(platformTarget(link.href)?.url===target.url) link.setAttribute('href',name==='facebook'?'https://www.facebook.com/NASA/posts/123456789':'https://bsky.app/profile/bsky.app/post/3mxhdhodv222n');
+ card.insertBefore(nested,card.firstChild);
+ const result=readSocial(doc,target);expect(result.ok).toBe(true);
+ expect(result.clip.markdown).toContain(socialSamples[name].text);
+ expect(result.clip.markdown).not.toContain('COMMENT BODY SENTINEL');
+ expect(result.clip.title).toBe(before.clip.title);
+});
+
+test('the target script ignores hidden header permalinks when binding Facebook and Bluesky cards',async()=>{
+ const {createContext,runInContext}=await import('node:vm'),{createWindow}=await import('@mixmark-io/domino');
+ const [source]=bundleTestScripts(['social-target']);
+ for(const name of ['facebook','bluesky']) {
+ const sample=socialSamples[name],url=name==='bluesky'?'https://bsky.app/profile/bsky.app/post/3l6oveex3ii2l':sample.url;
+ const w=createWindow(readFileSync(new URL(`./fixtures/platforms/${name==='bluesky'?'bluesky-feed':name}.html`,import.meta.url),'utf8'),url),target=platformTarget(url),card=socialPostCard(w.document,target);
+ const before=readSocial(w.document,target);expect(before.ok).toBe(true);
+ const bogus=w.document.createElement('a');bogus.setAttribute('href',name==='facebook'?'https://www.facebook.com/NASA/posts/123456789':'https://bsky.app/profile/bsky.app/post/3mxhdhodv222n');bogus.style.display='none';card.insertBefore(bogus,card.firstChild);
+ runInContext(source,createContext({document:w.document,location:w.location,Element:w.Element,Node:w.Node,URL}));
+ const event=w.document.createEvent('MouseEvents');event.initMouseEvent('contextmenu',true,true,w,0,0,0,0,0,false,false,false,false,2,null);
+ card.querySelector(name==='facebook'?'[data-ad-preview="message"]':'[data-testid="postText"], [data-word-wrap="1"]').dispatchEvent(event);
+ expect(card.getAttribute('data-edgeever-social-target')).toBe(target.url);
+ const result=readSocial(w.document,target);expect(result.ok).toBe(true);expect(result.clip.url).toBe(target.url);expect(result.clip.markdown).toBe(before.clip.markdown);
+ }
+});
test('Threads shortened visible links bind to the loaded caption without reading replies',()=>{
const d=fixture('threads-short-link'),target=platformTarget('https://www.threads.com/@nasa/post/DeMqtuYgkaL');
const r=readSocial(d,target);expect(r.ok).toBe(true);expect(r.clip.author).toBe('nasa');
@@ -206,7 +238,7 @@ test('Facebook public slug and numeric link resolves to the sampled post identit
expect(readSocial(d,platformTarget(url)).ok).toBe(true);
});
test('Facebook and LinkedIn photo-only posts remain valid without a text body',()=>{
- for(const name of ['facebook','linkedin']){const d=fixture(name);if(name==='facebook')d.querySelector('[data-ad-preview="message"]').remove();else{d.querySelector('[data-test-id="main-feed-activity-card__commentary"]').remove();const s=d.querySelector('script'),j=JSON.parse(s.textContent);j.articleBody='';s.textContent=JSON.stringify(j);}const r=readSocial(d,platformTarget(socialSamples[name].url));expect(r.ok).toBe(true);expect(r.clip.markdown.match(/!\[/g).length).toBe(socialSamples[name].images);}
+ for(const name of ['facebook','linkedin']){const d=fixture(name);if(name==='facebook'){d.querySelector('[data-ad-preview="message"]').remove();d.querySelector('script').remove();}else{d.querySelector('[data-test-id="main-feed-activity-card__commentary"]').remove();const s=d.querySelector('script'),j=JSON.parse(s.textContent);j.articleBody='';s.textContent=JSON.stringify(j);}const r=readSocial(d,platformTarget(socialSamples[name].url));expect(r.ok).toBe(true);expect(r.clip.markdown.match(/!\[/g).length).toBe(socialSamples[name].images);}
});
test('body references cannot impersonate Facebook or Bluesky post identity',()=>{
@@ -301,6 +333,33 @@ test('Substack Note rejects wrong identities, body-only references, hidden conte
expect(readSocial(image,target)).toEqual({ok:false,reason:'incomplete'});
});
+test('Substack Note CSS-hidden cards and bodies cannot borrow readability from metadata',()=>{
+ const target=platformTarget('https://substack.com/@tedgioia/note/c-357811021');
+ for(const selector of ['[class*="feedPermalinkUnit-"]','.ProseMirror']) for(const style of ['display:none','visibility:hidden']) {
+ const d=fixture('substack-note');d.querySelector(selector).setAttribute('style',style);
+ expect(readSocial(d,target)).toEqual({ok:false,reason:'unreadable'});
+ }
+ const d=fixture('substack-note');d.querySelector('.ProseMirror p').setAttribute('style','display:none');
+ expect(readSocial(d,target)).toEqual({ok:false,reason:'incomplete'});
+ for(const bodyOnly of [false,true]) {
+ const duplicate=fixture('substack-note'),card=duplicate.querySelector('[class*="feedPermalinkUnit-"]'),hidden=card.cloneNode(true);
+ (bodyOnly?hidden.querySelector('.ProseMirror'):hidden).setAttribute('style','display:none');card.parentNode.insertBefore(hidden,card);
+ expect(readSocial(duplicate,target).ok).toBe(true);
+ }
+});
+
+test('Substack Note excludes CSS-hidden text, media and controls on a detached copy',()=>{
+ const target=platformTarget('https://substack.com/@tedgioia/note/c-357811021'),d=fixture('substack-note');
+ d.querySelector('script[type="application/ld+json"]').remove();
+ d.querySelector('.ProseMirror').insertAdjacentHTML('beforeend','<p style="display:none">HIDDEN BODY SECRET</p><div style="visibility:hidden">HIDDEN WRAPPER SECRET<span style="visibility:visible">Visible restored text.</span></div>');
+ d.querySelector('img[alt=""]').setAttribute('style','display:none');
+ d.querySelector('[class*="feedPermalinkUnit-"]').insertAdjacentHTML('beforeend','<button data-testid="read-more" style="display:none">Read more</button>');
+ const original=d.body.outerHTML,r=readSocial(d,target);
+ expect(r.ok).toBe(true);expect(r.clip.markdown).toContain('Visible restored text.');
+ expect(r.clip.markdown).not.toContain('HIDDEN');expect(r.clip.markdown).not.toContain('![');
+ expect(d.body.outerHTML).toBe(original);
+});
+
test('Instagram saves the final slide text and cannot borrow readability from a sibling article',()=>{
const d=fixture('instagram-slide-captions'),target=platformTarget('https://www.instagram.com/p/DeKe6teEpya/');
const data=JSON.parse(d.querySelector('script').textContent);
@@ -357,3 +416,137 @@ test('Threads profile markers accept the supported threads.net domain alias',()=
d.querySelector('a[href="https://www.threads.net/@nasa/"]').setAttribute('href','https://unrelated.example/@nasa/');
expect(readSocial(d,target)).toEqual({ok:false,reason:'unreadable'});
});
+
+for(const [name,sample] of Object.entries(socialSamples)) test(`${name}: CSS-hidden page and post never become a complete capture`,()=>{
+ const d=fixture(name);d.body.style.display='none';
+ expect(readSocial(d,platformTarget(sample.url)).ok).toBe(false);
+});
+test('Facebook excludes CSS-hidden descendants from both body and note title',()=>{
+ const d=fixture('facebook'),body=d.querySelector('[data-ad-preview="message"]');
+ body.insertAdjacentHTML('afterbegin','<span style="display:none">HIDDEN TITLE SENTINEL</span>');
+ const r=readSocial(d,platformTarget(socialSamples.facebook.url));expect(r.ok).toBe(true);
+ expect(r.clip.title).not.toContain('SENTINEL');expect(r.clip.markdown).not.toContain('SENTINEL');
+});
+test('P1 DOM bodies cannot be restored solely from loaded SEO data',()=>{
+ for(const [name,selector] of [['facebook','[data-ad-preview="message"]'],['bluesky','[data-word-wrap="1"]'],['linkedin','[data-test-id="main-feed-activity-card__commentary"]']]) {
+ const d=fixture(name);d.querySelector(selector).remove();expect(readSocial(d,platformTarget(socialSamples[name].url)).ok).toBe(false);
+ }
+});
+test('P1 missing and mismatched declared attachments cannot be saved as complete',()=>{
+ const f=fixture('facebook');Array.from(f.querySelectorAll('img[src*="/v/"]')).forEach(n=>n.remove());
+ expect(readSocial(f,platformTarget(socialSamples.facebook.url))).toEqual({ok:false,reason:'incomplete'});
+ const l=fixture('linkedin'),s=l.querySelector('script'),data=JSON.parse(s.textContent);data.image[0].url='';s.textContent=JSON.stringify(data);
+ expect(readSocial(l,platformTarget(socialSamples.linkedin.url))).toEqual({ok:false,reason:'incomplete'});
+ const b=fixture('bluesky'),bs=b.querySelector('script'),bd=JSON.parse(bs.textContent);bd.image[0]='https://example.test/wrong.png';bs.textContent=JSON.stringify(bd);
+ expect(readSocial(b,platformTarget(socialSamples.bluesky.url))).toEqual({ok:false,reason:'incomplete'});
+});
+test('Facebook and LinkedIn preserve literal HTML as escaped post text',()=>{
+ for(const [name,selector] of [['facebook','[data-ad-preview="message"]'],['linkedin','[data-test-id="main-feed-activity-card__commentary"]']]) {
+ const d=fixture(name),literal='Literal <script>alert(1)</script> and <img src="https://example.test/unintended.png">';d.querySelector(selector).textContent=literal;
+ if(name==='linkedin'){const s=d.querySelector('script'),v=JSON.parse(s.textContent);v.articleBody=literal;s.textContent=JSON.stringify(v);}
+ const r=readSocial(d,platformTarget(socialSamples[name].url));expect(r.ok).toBe(true);
+ expect(r.clip.markdown).not.toContain('<script>');expect(r.clip.markdown).toContain('&lt;script&gt;');expect(r.clip.markdown.match(/!\[/g)).toHaveLength(socialSamples[name].images);
+ }
+});
+for(const name of ['instagram','threads']) test(`${name}: optional publication metadata does not gate readable posts`,()=>{
+ const d=fixture(name),s=d.querySelector('script'),v=JSON.parse(s.textContent);
+ const visit=x=>{if(x&&typeof x==='object'){delete x.taken_at;Object.values(x).forEach(visit)}};visit(v);s.textContent=JSON.stringify(v);
+ const r=readSocial(d,platformTarget(socialSamples[name].url));expect(r.ok).toBe(true);expect(r.clip.publishedAt).toBeUndefined();
+});
+
+test('Bluesky literal tags are escaped once and render without extra backslashes',async()=>{
+ const {marked}=await import('marked'),d=fixture('bluesky'),literal='Literal <script>alert(1)</script> and <img src="https://example.test/unintended.png">';d.querySelector('[data-word-wrap="1"]').textContent=literal;
+ const r=readSocial(d,platformTarget(socialSamples.bluesky.url));expect(r.ok).toBe(true);const rendered=createDocument(marked.parse(r.clip.markdown));expect(rendered.body.textContent).toContain(literal);expect(rendered.body.textContent).not.toContain('\\<');expect(rendered.querySelector('script')).toBeFalsy();
+});
+for(const name of ['instagram','threads']) test(`${name}: missing optional author metadata keeps readable post content`,()=>{
+ const d=fixture(name),s=d.querySelector('script'),data=JSON.parse(s.textContent);const visit=v=>{if(v&&typeof v==='object'){if(v.user)delete v.user.username;Object.values(v).forEach(visit)}};visit(data);s.textContent=JSON.stringify(data);expect(readSocial(d,platformTarget(socialSamples[name].url)).ok).toBe(true);
+});
+test('Facebook empty caption container is valid for a declared photo-only post',()=>{
+ const d=fixture('facebook'),s=d.querySelector('script'),data=JSON.parse(s.textContent);d.querySelector('[data-ad-preview="message"]').textContent='';const visit=v=>{if(v&&typeof v==='object'){if(v.message&&typeof v.message.text==='string')v.message.text='';Object.values(v).forEach(visit)}};visit(data);s.textContent=JSON.stringify(data);expect(readSocial(d,platformTarget(socialSamples.facebook.url)).ok).toBe(true);
+});
+
+test('LinkedIn complete visible body remains readable after hidden UI is removed',()=>{
+ const d=fixture('linkedin');d.querySelector('[data-test-id="main-feed-activity-card__commentary"]').insertAdjacentHTML('beforeend','<span style="display:none">HIDDEN CONTROL LABEL</span>');
+ const r=readSocial(d,platformTarget(socialSamples.linkedin.url));expect(r.ok).toBe(true);expect(r.clip.markdown).not.toContain('HIDDEN CONTROL');
+});
+test('LinkedIn declared carousel requires usable image URLs, retaining valid delayed URLs',()=>{
+ const d=fixture('linkedin-ugc'),img=d.querySelector('[data-testid="carousel-child-container"] img'),src=img.getAttribute('src');img.removeAttribute('src');
+ expect(readSocial(d,platformTarget(linkedinUgcUrl))).toEqual({ok:false,reason:'incomplete'});img.setAttribute('data-delayed-url',src);
+ const r=readSocial(d,platformTarget(linkedinUgcUrl));expect(r.ok).toBe(true);expect(r.clip.markdown.match(/!\[/g)).toHaveLength(8);
+});
+
+test('Bluesky keeps every rendered main-post image when optional SEO lists fewer',()=>{
+ const d=fixture('bluesky'),img=d.querySelector('img[src*="/img/feed_thumbnail/"]'),second=img.cloneNode(true);second.setAttribute('src',img.getAttribute('src')+'/second-rendered-photo');img.parentElement.appendChild(second);
+ const r=readSocial(d,platformTarget(socialSamples.bluesky.url));expect(r.ok).toBe(true);expect(r.clip.markdown.match(/!\[/g)).toHaveLength(2);expect(r.clip.markdown).toContain('second-rendered-photo');
+});
+
+test('shared Markdown text preserves leading angle brackets and literal HTML entities',async()=>{
+ const {platformHtmlMarkdown}=await import('./src/platform-clip.ts'),{marked}=await import('marked');
+ for(const literal of ['> quoted','&lt;script&gt;','<script>alert(1)</script>','A & B']) {
+ const d=createDocument('<p></p>');d.querySelector('p').textContent=literal;
+ expect(createDocument(marked.parse(platformHtmlMarkdown(d.body,'https://example.test/'))).body.textContent.trim()).toBe(literal);
+ }
+ const d=createDocument('<p><code>&lt;script&gt; &amp;lt;</code></p><pre><code>&lt;script&gt; &amp;lt;</code></pre>');
+ const output=platformHtmlMarkdown(d.body,'https://example.test/');expect(output).toContain('`<script> &lt;`');expect(output).toContain('```\n<script> &lt;\n```');
+});
+
+
+test('LinkedIn personal share keeps the name, professional headline and its own time separately',()=>{
+ const target=platformTarget(linkedinPersonUrl),doc=fixture('linkedin-person');
+ expect(target.id).toBe('share:7456582751698190336');
+ expect(target.url).toBe('https://www.linkedin.com/feed/update/urn:li:share:7456582751698190336/');
+ expect(platformTarget(target.url)).toEqual(target);
+ const r=readSocial(doc,target);expect(r.ok).toBe(true);
+ expect(r.clip.author).toBe('Mohammad Ahmed');
+ expect(r.clip.authorHeadline).toBe('Technical Lead - Backend at Dizzaract');
+ expect(r.clip.publishedAt).toEqual({value:'5 个月前',precision:'relative'});
+ expect(r.clip.markdown).toContain('What technology are you focusing on in 2026');
+ expect(r.clip.markdown).not.toContain('Dizzaract');
+ expect(r.clip.author).not.toContain('3 度');
+});
+
+test('LinkedIn missing professional metadata never shifts a name, role or connection degree into publication time',()=>{
+ for(const remove of ['headline','time','both']) {
+ const d=fixture('linkedin-person');
+ const ps=Array.from(d.querySelectorAll('p'));
+ if(remove!=='time') ps.find(n=>n.textContent.includes('Dizzaract')).remove();
+ if(remove!=='headline') ps.find(n=>n.textContent.trim()==='5 个月前').remove();
+ const r=readSocial(d,platformTarget(linkedinPersonUrl));expect(r.ok).toBe(true);
+ expect(r.clip.author).toBe('Mohammad Ahmed');
+ expect(r.clip.authorHeadline).toBe(remove==='time'?'Technical Lead - Backend at Dizzaract':undefined);
+ expect(r.clip.publishedAt).toEqual(remove==='headline'?{value:'5 个月前',precision:'relative'}:undefined);
+ }
+ for(const name of ['linkedin','linkedin-ugc','linkedin-ugc-guest']) {
+ const r=readSocial(fixture(name),platformTarget(name==='linkedin'?socialSamples.linkedin.url:linkedinUgcUrl));
+ expect(r.ok).toBe(true);expect(r.clip.authorHeadline).toBeUndefined();
+ }
+});
+
+for(const time of ['5mo','5 months ago','5か月前','5 mies. temu']) test(`LinkedIn professional headline stays separate from ${time}`,()=>{
+ const d=fixture('linkedin-person');Array.from(d.querySelectorAll('p')).find(n=>n.textContent.trim()==='5 个月前').textContent=time;
+ const r=readSocial(d,platformTarget(linkedinPersonUrl));expect(r.ok).toBe(true);
+ expect(r.clip.authorHeadline).toBe('Technical Lead - Backend at Dizzaract');
+ expect(r.clip.publishedAt).toEqual({value:time,precision:'relative'});
+});
+
+test('LinkedIn share identities reject stale cards, comments and quoted nested cards',()=>{
+ const target=platformTarget(linkedinPersonUrl);
+ for(const change of ['id','comment','nested']) {
+ const d=fixture('linkedin-person'),body=d.querySelector('[id^="translatable-commentary-"]');
+ if(change==='id') body.id=body.id.replace('7456582751698190336','7456582751698190337');
+ if(change==='comment') body.id=body.id.replace('contentUrnCommentUrn=null','contentUrnCommentUrn=123');
+ if(change==='nested') {const nested=d.createElement('div');nested.setAttribute('data-urn','urn:li:activity:123');body.replaceWith(nested);nested.appendChild(body);}
+ expect(readSocial(d,target).ok).toBe(false);
+ }
+});
+
+
+for(const placement of ['card','header']) test(`LinkedIn personal metadata cannot come from a nested ${placement} card`,()=>{
+ const d=fixture('linkedin-person'),card=d.querySelector('[role="listitem"]');
+ (placement==='header'?card.firstElementChild:card).insertAdjacentHTML('afterbegin','<div data-urn="urn:li:activity:123"><div class="update-components-actor"><a href="https://www.linkedin.com/in/other/"><span class="update-components-actor__title">COMMENT AUTHOR</span></a><p class="update-components-actor__description">OTHER ROLE</p><time datetime="1999-01-01T00:00:00Z">1999</time></div></div>');
+ const r=readSocial(d,platformTarget(linkedinPersonUrl));expect(r.ok).toBe(true);
+ expect(r.clip.author).toBe('Mohammad Ahmed');expect(r.clip.authorHeadline).toBe('Technical Lead - Backend at Dizzaract');
+ expect(r.clip.publishedAt).toEqual({value:'5 个月前',precision:'relative'});
+ Array.from(d.querySelectorAll('p')).find(n=>n.textContent.trim()==='5 个月前').remove();
+ expect(readSocial(d,platformTarget(linkedinPersonUrl)).clip.publishedAt).toBeUndefined();
+});
diff --git a/apps/extension/src/article-clip.ts b/apps/extension/src/article-clip.ts
new file mode 100644
index 00000000..eca49ff2
--- /dev/null
+++ b/apps/extension/src/article-clip.ts
@@ -0,0 +1,136 @@
+import { markdownText, markdownUrl, platformElementHidden, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, publishedTime, safePlatformUrl, type PlatformRead, type PublishedTime } from "./platform-clip";
+import { restoreWechatHeadings } from "./wechat-headings";
+
+const readableText = (node: Element | null) => node ? platformText(platformReadableCopy(node)) : "";
+
+/** Sspai keeps article updates beside the main body, apart from its update
+ * navigation and author/interaction cards. Keep each update as a quoted note. */
+const sspaiUpdateMarkdown = (body: Element, pageUrl: string): string[] => {
+ const parts: string[]=[];
+ for(const wrapper of Array.from(body.parentElement?.children || [])) {
+ if(!wrapper.matches(".update__details__wrapper")) continue;
+ for(const item of Array.from(wrapper.children)) {
+ if(!item.matches(".update-details-item")) continue;
+ const copy=platformReadableCopy(item), content=copy.querySelector(".update-body");
+ const markdown=content ? platformHtmlMarkdown(content,pageUrl) : "";
+ if(!markdown) continue;
+ const title=platformText(copy.querySelector(".update-title"));
+ const date=platformText(copy.querySelector(".update-date"));
+ const update=[date ? markdownText(date) : "",title ? `**${markdownText(title)}**` : "",markdown].filter(Boolean).join("\n\n");
+ parts.push(update.split("\n").map(line=>line ? `> ${line}` : ">").join("\n"));
+ }
+ }
+ return parts;
+};
+
+/** Remove publisher chrome inside #js_content, on the detached copy only. */
+const cleanWechatContent = (body: Element, pageUrl: string) => {
+ body.querySelectorAll("mp-common-cpsad").forEach(node=>node.remove());
+ // WeChat's code widget uses one sibling <code> per line, whereas the shared
+ // Markdown converter expects a single code element inside each <pre>.
+ for(const pre of Array.from(body.querySelectorAll("pre.code-snippet__js"))) {
+ const lines=Array.from(pre.children);
+ if(lines.length < 2 || lines.some(line=>line.tagName !== "CODE") || Array.from(pre.childNodes).some(node=>node.nodeType === 3 && node.textContent?.trim())) continue;
+ const code=lines[0].cloneNode(false);
+ code.textContent=lines.map(line=>line.textContent || "").join("\n");
+ pre.textContent="";pre.appendChild(code);
+ }
+ const followPrompt = (node: Element) => !node.closest("pre,code,blockquote") && !node.querySelector("pre,code,blockquote")
+ && /^(?:请)?(?:点击|轻点)(?:上方|下方)?的?(?:蓝字|蓝色文字)(?:(?:关注|关于|订阅)(?:我们|公众号|本公众号|本号))?$/.test(platformText(node).replace(/[\s,,::。!!~~]+/g,""));
+ for(const node of Array.from(body.querySelectorAll("p,section,div"))) {
+ if(!followPrompt(node)) continue;
+ let banner=node;
+ // Include the banner's decorative arrow, but stop before article prose.
+ while(banner.parentElement && banner.parentElement !== body && followPrompt(banner.parentElement)) banner=banner.parentElement;
+ banner.remove();
+ }
+ for(const image of Array.from(body.querySelectorAll("img.__bg_gif[alt]"))) {
+ if(!image.closest("pre,code,blockquote") && /^(?:分割线|分隔线|divider|separator)$/i.test(image.getAttribute("alt")?.trim() || "")) image.remove();
+ }
+ // Only trailing standalone native article cards are recommendations. Keep
+ // inline citations, linked illustrations and cards followed by more prose.
+ for(const block of Array.from(body.children).reverse()) {
+ if(!platformText(block) && !block.querySelector("img,pre,table")) continue;
+ const links=Array.from(block.querySelectorAll("a[href]"));
+ const link=block.matches("a[href]") ? block : links.length === 1 ? links[0] : null;
+ const href=link && safePlatformUrl(link.getAttribute("href") || "",pageUrl);
+ if(!link || !href || !link.querySelector(".h5_image_link") || platformText(link) !== platformText(block)) break;
+ const url=new URL(href);
+ if(url.hostname !== "mp.weixin.qq.com" || !/^\/s(?:\/|$)/.test(url.pathname)) break;
+ link.remove();
+ }
+ restoreWechatHeadings(body);
+};
+
+/** Preserve source date precision and clock values; do not infer a timezone. */
+export const articlePublishedTime = (node: Element | null): PublishedTime | undefined => {
+ if (!node) return;
+ const visible=node.tagName === "META" || !platformElementHidden(node), clean=platformReadableCopy(node);
+ if (!visible) for(const attr of ["datetime","title","content"]) clean.removeAttribute(attr);
+ const value = (visible ? node.getAttribute("datetime") || (node.tagName === "META" ? node.getAttribute("content") : "") : "") || platformText(clean) || (visible ? node.getAttribute("content") : "") || "";
+ if (!value) return;
+ const chinese = /^(\d{4})年\s*(\d{1,2})月\s*(\d{1,2})日(?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?/.exec(value.trim());
+ const date = /^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?))?$/.exec(value.trim());
+ if (chinese) {
+ const day = `${chinese[1]}-${chinese[2].padStart(2,"0")}-${chinese[3].padStart(2,"0")}`;
+ return chinese[4] ? { value:`${day}T${chinese[4].padStart(2,"0")}:${chinese[5]}:${chinese[6] || "00"}`,precision:"datetime" } : {value:day,precision:"date"};
+ }
+ if (date) return date[2] ? {value:`${date[1]}T${date[2]}`,precision:"datetime"} : {value:date[1],precision:"date"};
+ return publishedTime(clean);
+};
+
+export const readArticle = (doc: Document, pageUrl: string, accountLabel: string): PlatformRead => {
+ const target = platformTarget(pageUrl);
+ if (!target || !["wechat","sspai","juejin"].includes(target.platform)) return {ok:false,reason:"not-target"};
+ const declared = doc.querySelector('link[rel="canonical"]')?.getAttribute("href") || doc.querySelector('meta[property="og:url"]')?.getAttribute("content");
+ if (declared) {
+ const identity = platformTarget(safePlatformUrl(declared, target.url));
+ // WeChat short and query links are aliases that cannot be resolved solely
+ // from their spelling. Compare identities only within the same URL form.
+ const alias = target.platform === "wechat" && identity?.platform === "wechat" && identity.id.includes("/") !== target.id.includes("/");
+ if (!alias && (identity?.platform !== target.platform || identity.id !== target.id)) return {ok:false,reason:"changed"};
+ }
+ let titleNode: Element | null, body: Element | null, authorNode: Element | null, timeNode: Element | null;
+ let account = "";
+ if (target.platform === "wechat") {
+ titleNode=doc.querySelector("#activity-name"); body=doc.querySelector("#js_content");
+ authorNode=doc.querySelector("#js_author_name"); timeNode=doc.querySelector("#publish_time");
+ account=readableText(doc.querySelector("#js_name"));
+ } else if (target.platform === "sspai") {
+ const article=doc.querySelector("article.normal-article");
+ titleNode=article?.querySelector("#article-title") || null;
+ body=article?.querySelector(".article__main__content") || null;
+ authorNode=article?.querySelector(".article__header__author .ss__user__nickname > span") || null;
+ timeNode=article?.querySelector(".article__header__date") || null;
+ } else {
+ const article=doc.querySelector("article.article");
+ const id=article?.getAttribute("data-entry-id");
+ if (id && id !== target.id) return {ok:false,reason:"changed"};
+ titleNode=article?.querySelector("h1.article-title") || null;
+ body=article?.querySelector(".article-viewer.markdown-body") || null;
+ authorNode=article?.querySelector(".author-name .name") || null;
+ timeNode=article?.querySelector('meta[itemprop="datePublished"],time') || null;
+ }
+ const title=readableText(titleNode);
+ if (!title || !body) return {ok:false,reason:"unreadable"};
+ const clean=platformReadableCopy(body);
+ if(target.platform === "wechat") cleanWechatContent(clean,target.url);
+ // These are article controls, not text/code authored into the article.
+ Array.from(clean.querySelectorAll('.code-block-extension-header, .code-block-extension-copyCodeBtn')).forEach(n=>n.remove());
+ const markdown=platformHtmlMarkdown(clean,target.url);
+ if (!markdown) return {ok:false,reason:"unreadable"};
+ let author=readableText(authorNode);
+ if (target.platform === "sspai") author=[...new Set(Array.from(body.closest("article.normal-article")?.querySelectorAll(".article__header__author .ss__user__nickname > span") || []).map(readableText).filter(Boolean))].join(", ");
+ // Juejin publishes the author in its article-scoped schema metadata, even
+ // when the visual author header is collapsed by the current desktop layout.
+ if (!author && target.platform === "juejin") author=doc.querySelector('article.article [itemprop="author"] meta[itemprop="name"]')?.getAttribute("content")?.trim() || "";
+ const parts: string[]=[];
+ if (account) parts.push(`${markdownText(accountLabel)}: ${markdownText(account)}`);
+ if (target.platform === "wechat") {
+ const cover=safePlatformUrl(doc.querySelector('meta[property="og:image"]')?.getAttribute("content") || "",target.url);
+ if (cover && !Array.from(clean.querySelectorAll("img")).some(img=>["data-src","data-original","src"].some(a=>safePlatformUrl(img.getAttribute(a)||"",target.url)===cover))) parts.push(`![${markdownText(title)}](${markdownUrl(cover)})`);
+ }
+ parts.push(markdown);
+ if(target.platform === "sspai") parts.push(...sspaiUpdateMarkdown(body,target.url));
+ return {ok:true,clip:{...target,title,author:author || undefined,publishedAt:articlePublishedTime(timeNode),markdown:parts.join("\n\n"),tags:["web-clip",target.platform],completeness:"complete"}};
+};
diff --git a/apps/extension/src/article-metadata.ts b/apps/extension/src/article-metadata.ts
new file mode 100644
index 00000000..6417e735
--- /dev/null
+++ b/apps/extension/src/article-metadata.ts
@@ -0,0 +1,40 @@
+import { platformText, publishedTime, safePlatformUrl, type PublishedTime } from "./platform-clip";
+
+export type ArticleContent = { title: string; body: Element; author?: string; publishedAt?: PublishedTime };
+/** Read only metadata declared for this article, excluding recommendations and
+ * comment authors. Missing author/time never makes a readable article fail. */
+export const articleMetadata = (doc: Document, pageUrl: string, title: string, article: Element) => {
+ const identity=(value: unknown) => {
+ if(typeof value !== "string") return "";
+ const safe=safePlatformUrl(value,pageUrl);
+ if(!safe) return "";
+ const url=new URL(safe);return url.origin+url.pathname.replace(/\/$/,"");
+ };
+ const own=identity(pageUrl);
+ let author: string | undefined, time: PublishedTime | undefined;
+ for(const script of Array.from(doc.querySelectorAll('script[type="application/ld+json"]'))) {
+ try {
+ const parsed=JSON.parse(script.textContent || "");
+ const entries=Array.isArray(parsed) ? parsed : Array.isArray(parsed?.["@graph"]) ? parsed["@graph"] : [parsed];
+ for(const item of entries) {
+ if(!item || !["SocialMediaPosting","NewsArticle","Article","BlogPosting"].includes(item["@type"]) || identity(item.url || item.mainEntityOfPage || item["@id"]) !== own || (typeof item.headline !== "string" || item.headline.replace(/\s+/g," ").trim() !== title)) continue;
+ const authors=Array.isArray(item.author) ? item.author : [item.author];
+ author=authors.map((value: unknown)=>typeof value === "string" ? value : value && typeof value === "object" && "name" in value && typeof value.name === "string" ? value.name : "").filter(Boolean).join(", ") || undefined;
+ if(typeof item.datePublished === "string") {
+ const node=doc.createElement("time");node.setAttribute("datetime",item.datePublished);
+ time=publishedTime(node);
+ }
+ }
+ } catch { /* Malformed or unrelated metadata is optional. */ }
+ }
+ const clean=article;
+ author ||= platformText(clean.querySelector('[data-testid="authorName"],.byline a[href*="substack.com/profile/"]')) || undefined;
+ const timeNode=clean.querySelector('[data-testid="storyPublishDate"],.byline time[datetime]');
+ const displayed=publishedTime(timeNode);
+ if (!time && timeNode) {
+ const date=/^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\w* (\d{1,2}), (\d{4})$/.exec(platformText(timeNode));
+ if(date) time={value:`${date[3]}-${String(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(date[1])+1).padStart(2,"0")}-${date[2].padStart(2,"0")}`,precision:"date"};
+ }
+ time ||= displayed;
+ return {author,publishedAt:time};
+};
diff --git a/apps/extension/src/article-platform.ts b/apps/extension/src/article-platform.ts
index 783796e7..7ddfc2fb 100644
--- a/apps/extension/src/article-platform.ts
+++ b/apps/extension/src/article-platform.ts
@@ -4,10 +4,27 @@ export const articlePlatform = (doc: Document = document, pageUrl: string = loca
try { url = new URL(pageUrl); } catch { return null; }
if (url.protocol !== "https:") return null;
if ((url.hostname === "medium.com" || url.hostname.endsWith(".medium.com") || doc.querySelector('meta[property="og:site_name"][content="Medium"]'))
- && doc.querySelector('article h1[data-selectable-paragraph]')?.textContent?.trim()) return "Medium";
+ && doc.querySelector('article')) return "Medium";
if (/^\/p\/[^/]+\/?$/.test(url.pathname)
&& (url.hostname === "substack.com" || url.hostname.endsWith(".substack.com") || doc.querySelector('link[rel="stylesheet"][href^="https://substackcdn.com/bundle/"]'))
- && doc.querySelector('article.newsletter-post h1.post-title')?.textContent?.trim()
- && doc.querySelector('article.newsletter-post .body.markup')) return "Substack";
+ && doc.querySelector('article.newsletter-post')) return "Substack";
return null;
};
+
+/** Real Substack preview gate; closure-free for the popup's DOM probe. */
+export const substackPaywall = (doc: Document = document): boolean => Array.from(doc.querySelectorAll('article.newsletter-post .paywall')).some(node=>{
+ const walker=doc.createTreeWalker(node,4 /* SHOW_TEXT */);
+ for(let text=walker.nextNode();text;text=walker.nextNode()) {
+ const parent=text.parentElement;
+ if (!parent || !text.textContent?.trim()) continue;
+ let visibility=doc.defaultView?.getComputedStyle?.(parent).visibility, hidden=false;
+ for(let current: Element | null=parent;current;current=current.parentElement) {
+ if(current.matches('[hidden],[aria-hidden="true"],script,style,template')) {hidden=true;break;}
+ const style=doc.defaultView?.getComputedStyle?.(current) || (current as HTMLElement).style;
+ if(style?.display === "none") {hidden=true;break;}
+ if(!visibility && style?.visibility && style.visibility !== "inherit") visibility=style.visibility;
+ }
+ if(!hidden && visibility !== "hidden" && visibility !== "collapse") return true;
+ }
+ return false;
+});
diff --git a/apps/extension/src/background.ts b/apps/extension/src/background.ts
index d24d3eb6..693d2141 100644
--- a/apps/extension/src/background.ts
+++ b/apps/extension/src/background.ts
@@ -1,4 +1,5 @@
-import { articlePlatform } from "./article-platform";
+import { articlePlatform, substackPaywall } from "./article-platform";
+import { configurePlatformImageRequests, isPlatformImageUrl } from "./platform-image-requests";
import {
clipNotebookId,
edgeEverFormRequest,
@@ -43,6 +44,7 @@ import {
} from "./github-repo";
import {
selectionNoteMarkdown,
+ selectionTextMarkdown,
selectionNoteTitle,
} from "./selection-clip";
import {
@@ -91,6 +93,8 @@ import type { OutlineAttempt, VideoNoteToast } from "./video/types";
import { youtubeCaptureFromRead, youtubeTargetFromUrl } from "./video/youtube";
import { t } from "./i18n";
import { readXiaoyuzhouStateInPage } from "./xiaoyuzhou-clip";
+import { jikeLoginPost } from "./jike-clip";
+import { bossLoginRequired } from "./boss-clip";
import {
isPlatformClip,
markdownText,
@@ -101,6 +105,7 @@ import {
publishedTimeText,
clipDateTimeText,
type PlatformTarget,
+ type PublishedTime,
} from "./platform-clip";
type CapturedPage = {
@@ -109,6 +114,9 @@ type CapturedPage = {
markdown: string;
plainText?: string;
kind?: "page" | "selection";
+ platform?: "medium" | "substack";
+ author?: string;
+ publishedAt?: PublishedTime;
};
type PendingImageSave = {
@@ -170,7 +178,11 @@ const REDDIT_DOCUMENT_PATTERNS = [
const toMarkdown = (page: CapturedPage) => {
const capturedAt = clipDateTimeText(new Date().toISOString());
- return `# ${page.title.replace(/\n/g, " ")}\n\n${t("sourceLabel")}: [${page.url}](${page.url})\n\n${t("capturedAtLabel")}: ${capturedAt}\n\n---\n\n${page.markdown}`;
+ const metadata=page.platform ? [
+ page.author ? `${t("platformAuthorLabel")}: ${markdownText(page.author)}` : "",
+ page.publishedAt ? `${t("platformPublishedAtLabel")}: ${markdownText(publishedTimeText(page.publishedAt,t("platformRelativeTimeLabel")))}` : "",
+ ].filter(Boolean).map(value=>`${value}\n\n`).join("") : "";
+ return `# ${markdownText(page.title)}\n\n${t("sourceLabel")}: [${markdownText(page.url)}](${markdownUrl(page.url)})\n\n${metadata}${t("capturedAtLabel")}: ${capturedAt}\n\n---\n\n${page.markdown}`;
};
const compactError = (error: unknown) => {
@@ -207,18 +219,26 @@ const notebookForClip = async (settings: ExtensionSettings) => {
return notebookId;
};
-const createMemo = async (settings: ExtensionSettings, page: CapturedPage, tabId: number | null) => {
+const clipImageFeedback = (images: { embedded: number; total: number }) =>
+ images.embedded < images.total ? t("platformImagesPartial")
+ : images.total > 0 ? t("platformSavedWithImages") : t("savedToEdgeEver");
+
+const createMemo = async (settings: ExtensionSettings, page: CapturedPage, tabId: number | null, expectedUrl?: string) => {
const contentMarkdown = toMarkdown(page);
+ const notebookId = await notebookForClip(settings);
+ if (expectedUrl && (tabId === null || (await chrome.tabs.get(tabId)).url !== expectedUrl)) {
+ throw new Error(t("platformPageChanged"));
+ }
const created = await edgeEverRequest<{ memo?: CreatedClipMemo }>(settings, "/api/v1/memos", {
method: "POST",
body: JSON.stringify({
- notebookId: await notebookForClip(settings),
+ notebookId,
title: page.title,
contentMarkdown,
- tags: ["web-clip"],
+ tags: page.platform ? ["web-clip",page.platform] : ["web-clip"],
}),
});
- await embedClipImages(settings, created.memo, contentMarkdown, page.url, tabId, null);
+ return embedClipImages(settings, created.memo, contentMarkdown, page.url, tabId, null);
};
const createGithubRepoMemo = async (settings: ExtensionSettings, facts: GithubRepoFacts) => {
@@ -260,7 +280,7 @@ const imageNoteClient = (settings: ExtensionSettings): ImageNoteClient => ({
createEditSession: (memoId) => edgeEverRequest(
settings,
`/api/v1/memos/${encodeURIComponent(memoId)}/edit-sessions`,
- { method: "POST", body: JSON.stringify({}) },
+ { method: "POST" },
),
saveMemo: (memoId, body) => edgeEverRequest(
settings,
@@ -401,6 +421,7 @@ const requestSignal = (timeoutMs: number, signal?: AbortSignal) => {
return controller.signal;
};
+let platformImageRulesReady: Promise<void> | undefined;
const downloadImage = async (
urls: string[],
{ maxBytes = MAX_IMAGE_BYTES, timeoutMs = 15000, signal }: { maxBytes?: number; timeoutMs?: number; signal?: AbortSignal } = {},
@@ -409,6 +430,10 @@ const downloadImage = async (
let matchError: StoredImageFailure["error"] | "" = "";
for (const url of urls) {
if (!/^https?:/i.test(url)) continue;
+ if (isPlatformImageUrl(url)) {
+ platformImageRulesReady ??= configurePlatformImageRequests().catch(() => undefined);
+ await platformImageRulesReady;
+ }
for (const credentials of ["omit", "include"] as const) {
if (signal?.aborted) return { error: "unreadable" };
try {
@@ -556,7 +581,7 @@ const openZhihuPermissionWindow = async (tabId: number | null) => {
await focusExtensionWindow("zhihu-save.html", ZHIHU_WINDOW_KEY, 560);
};
-let pendingCapture: ((page: unknown) => void) | null = null;
+let pendingCapture: { requestId: string; resolve: (page: unknown) => void } | null = null;
const pendingImageReads = new Map<string, (result: unknown) => void>();
const pendingTweetReads = new Map<string, (result: unknown) => void>();
const pendingGithubReads = new Map<string, (result: unknown) => void>();
@@ -1297,7 +1322,7 @@ const describePlatformError = (error: unknown) => {
return describeGithubError(error);
};
-const readPlatformFromPage = async (tabId: number, target: PlatformTarget, selectionFirst: boolean, sourceUrl: string) => {
+const readPlatformFromPage = async (tabId: number, target: PlatformTarget, selectionFirst: boolean, sourceUrl: string, selectionText?: string) => {
const requestId = crypto.randomUUID();
return new Promise<unknown>((resolve, reject) => {
const timeout = setTimeout(() => {
@@ -1318,7 +1343,7 @@ const readPlatformFromPage = async (tabId: number, target: PlatformTarget, selec
func: (payload: unknown) => {
(globalThis as { __edgeeverPlatformClipPayload?: unknown }).__edgeeverPlatformClipPayload = payload;
},
- args: [{ requestId, url: target.url, sourceUrl, selectionFirst, xiaoyuzhouState }],
+ args: [{ requestId, url: target.url, sourceUrl, selectionFirst, selectionText, xiaoyuzhouState }],
});
await chrome.scripting.executeScript({ target: { tabId, frameIds: [0] }, files: ["assets/capture-platform.js"] });
};
@@ -1330,11 +1355,11 @@ const readPlatformFromPage = async (tabId: number, target: PlatformTarget, selec
});
};
-const performPlatformSave = async (tabId: number, pageUrl: string, selectionFirst: boolean, selectedUrl = pageUrl) => {
+const performPlatformSave = async (tabId: number, pageUrl: string, selectionFirst: boolean, selectedUrl = pageUrl, selectionText?: string) => {
const target = platformTarget(selectedUrl);
if (!target) throw new Error(t("platformNotDetail"));
const settings = await ensureClipperReady();
- const result = await readPlatformFromPage(tabId, target, selectionFirst, pageUrl);
+ const result = await readPlatformFromPage(tabId, target, selectionFirst, pageUrl, selectionText);
if (!result || typeof result !== "object") throw new Error(t("platformUnreadable"));
const record = result as { ok?: unknown; reason?: unknown; clip?: unknown; selection?: unknown };
if (record.ok !== true) {
@@ -1349,7 +1374,7 @@ const performPlatformSave = async (tabId: number, pageUrl: string, selectionFirs
const capturedAt = clipDateTimeText(new Date().toISOString());
const contentMarkdown = clip ? [
`# ${markdownText(clip.title)}`,
- clip.author ? `${t("platformAuthorLabel")}: ${markdownText(clip.author)}` : "",
+ clip.author ? `${t("platformAuthorLabel")}: ${[clip.author, clip.authorHeadline].filter(Boolean).map(value => markdownText(value!)).join(" · ")}` : "",
clip.publishedAt ? `${t("platformPublishedAtLabel")}: ${markdownText(publishedTimeText(clip.publishedAt, t("platformRelativeTimeLabel")))}` : "",
`${t("sourceLabel")}: [${markdownText(clip.url)}](${markdownUrl(clip.url)})`,
`${t("capturedAtLabel")}: ${capturedAt}`,
@@ -1365,8 +1390,7 @@ const performPlatformSave = async (tabId: number, pageUrl: string, selectionFirs
body: JSON.stringify({ notebookId, title: (clip?.title || selection!.title).slice(0, 120), contentMarkdown, tags: clip?.tags || ["web-clip"] }),
});
const images = await embedClipImages(settings, created.memo, contentMarkdown, target.url, tabId, 0);
- const message = images.embedded < images.total ? t("platformImagesPartial")
- : images.total > 0 ? t("platformSavedWithImages") : t("savedToEdgeEver");
+ const message = clipImageFeedback(images);
return { ok: true, message: clip?.completeness === "no-shownotes" ? `${message} ${t("platformNoShowNotes")}` : message };
};
@@ -1374,7 +1398,6 @@ const savePlatformFromMenu = async (info: { pageUrl?: string; frameId?: number }
const tabId = typeof tab?.id === "number" ? tab.id : null;
try {
if (tabId === null || (info.frameId ?? 0) !== 0) throw new Error(t("platformNotDetail"));
- await showFeedback(tabId, 0, t("savingPlatformClip"), "normal");
const pageUrl = info.pageUrl || tab?.url || "";
let selectedUrl = pageUrl;
if (socialPlatform(pageUrl)) {
@@ -1384,9 +1407,10 @@ const savePlatformFromMenu = async (info: { pageUrl?: string; frameId?: number }
if (typeof located === "string" && platformTarget(located)?.platform === socialPlatform(pageUrl)) selectedUrl = located;
if (!platformTarget(selectedUrl)) {
await chrome.scripting.executeScript({target:{tabId,frameIds:[0]},files:["assets/social-target.js"]});
- throw new Error(t("socialSelectPost"));
+ throw new Error(t(socialPlatform(pageUrl) === "douban" ? "doubanSelectComment" : "socialSelectPost"));
}
}
+ await showFeedback(tabId, 0, t("savingPlatformClip"), "normal");
const result = await enqueueClip(() => performPlatformSave(tabId, pageUrl, false, selectedUrl));
await showFeedback(tabId, 0, result.message, "success");
} catch (error) {
@@ -1401,19 +1425,23 @@ const isCapturedPage = (value: unknown): value is CapturedPage => {
const record = value as Partial<CapturedPage>;
return typeof record.title === "string"
&& typeof record.url === "string"
- && typeof record.markdown === "string";
+ && typeof record.markdown === "string"
+ && (record.platform === undefined || record.platform === "medium" || record.platform === "substack")
+ && (record.author === undefined || typeof record.author === "string")
+ && (record.publishedAt === undefined || (!!record.publishedAt && typeof record.publishedAt.value === "string" && ["datetime","date","relative"].includes(record.publishedAt.precision)));
};
-const readCapturedPage = async (tabId: number, frameId: number | null, mode: "page" | "selection") => {
+const readCapturedPage = async (tabId: number, frameId: number | null, mode: "page" | "selection", selectionText?: string) => {
+ const requestId = crypto.randomUUID();
const result = await new Promise<unknown>((resolve, reject) => {
const timeout = setTimeout(() => {
- pendingCapture = null;
+ if (pendingCapture?.requestId === requestId) pendingCapture = null;
reject(new Error(t("captureTimeout")));
}, 15_000);
- pendingCapture = (page) => {
+ pendingCapture = { requestId, resolve: (page) => {
clearTimeout(timeout);
resolve(page);
- };
+ } };
const target = scriptTarget(tabId, frameId);
const inject = async () => {
await chrome.scripting.executeScript({
@@ -1421,7 +1449,7 @@ const readCapturedPage = async (tabId: number, frameId: number | null, mode: "pa
func: (value: unknown) => {
(globalThis as { __edgeeverPageClipPayload?: unknown }).__edgeeverPageClipPayload = value;
},
- args: [{ mode }],
+ args: [{ mode, requestId, selectionText }],
});
await chrome.scripting.executeScript({
target,
@@ -1430,11 +1458,12 @@ const readCapturedPage = async (tabId: number, frameId: number | null, mode: "pa
};
void inject().catch((error: unknown) => {
clearTimeout(timeout);
- pendingCapture = null;
+ if (pendingCapture?.requestId === requestId) pendingCapture = null;
reject(new Error(describeCaptureError(error)));
});
});
if (result && typeof result === "object" && "error" in result && result.error === "unreadable") throw new Error(t("platformUnreadable"));
+ if (result && typeof result === "object" && "error" in result && result.error === "restricted") throw new Error(t("pageCaptureRestrictedHint"));
if (!isCapturedPage(result)) throw new Error(t("captureScriptFailed", t("captureUnknownError")));
return result;
};
@@ -1457,29 +1486,38 @@ const describeSelectionError = (error: unknown) => {
};
const saveSelectionFromMenu = async (
- info: { pageUrl?: string; frameId?: number; selectionText?: string },
+ info: { pageUrl?: string; frameUrl?: string; frameId?: number; selectionText?: string },
tab?: { id?: number; url?: string; title?: string },
) => {
const tabId = typeof tab?.id === "number" ? tab.id : null;
const frameId = typeof info.frameId === "number" ? info.frameId : null;
const pageUrl = tab?.url || info.pageUrl || "";
+ const frameUrl = frameId && frameId > 0 ? info.frameUrl : pageUrl;
const pageTitle = tab?.title || "";
const browserSelection = (info.selectionText || "").replace(/\u00a0/g, " ").trim();
try {
const settings = await ensureClipperReady();
if (!tabId) throw new Error(t("selectionEmpty"));
+ const checkPage = async () => {
+ if (pageUrl && (await chrome.tabs.get(tabId)).url !== pageUrl) throw new Error(t("platformPageChanged"));
+ };
+ await checkPage();
await showFeedback(tabId, frameId, t("savingSelection"), "normal");
+
let captured: CapturedPage | null = null;
try {
- captured = await readCapturedPage(tabId, frameId, "selection");
+ captured = await readCapturedPage(tabId, frameId, "selection", browserSelection || undefined);
} catch (error) {
if (!browserSelection) throw error;
}
- const fromSelection = captured?.kind === "selection" ? captured : null;
- const markdown = fromSelection?.markdown.trim() || browserSelection;
+ await checkPage();
+ if (captured && frameUrl && captured.url !== frameUrl) throw new Error(t("platformPageChanged"));
+ const fromSelection = captured?.kind === "selection"
+ && (!browserSelection || captured.plainText?.replace(/\u00a0/g, " ").trim() === browserSelection) ? captured : null;
+ const markdown = fromSelection?.markdown.trim() || selectionTextMarkdown(browserSelection);
const plain = fromSelection?.plainText?.trim() || browserSelection || markdown;
if (!markdown.trim()) throw new Error(t("selectionEmpty"));
- const sourceUrl = fromSelection?.url || pageUrl;
+ const sourceUrl = fromSelection?.url || frameUrl || pageUrl;
const contentMarkdown = selectionNoteMarkdown({
markdown,
pageUrl: sourceUrl,
@@ -1487,17 +1525,19 @@ const saveSelectionFromMenu = async (
sourceLabel: t("sourceLabel"),
capturedAtLabel: t("capturedAtLabel"),
});
+ const notebookId = await notebookForClip(settings);
+ await checkPage();
const created = await edgeEverRequest<{ memo?: CreatedClipMemo }>(settings, "/api/v1/memos", {
method: "POST",
body: JSON.stringify({
- notebookId: await notebookForClip(settings),
+ notebookId,
title: selectionNoteTitle(plain, pageTitle, t("selectionNoteFallbackTitle")),
contentMarkdown,
tags: ["web-clip"],
}),
});
- await embedClipImages(settings, created.memo, contentMarkdown, sourceUrl, tabId, frameId);
- await showFeedback(tabId, frameId, t("selectionSaved"), "success");
+ const images=await embedClipImages(settings, created.memo, contentMarkdown, sourceUrl, tabId, frameId);
+ await showFeedback(tabId, frameId, images.total ? clipImageFeedback(images) : t("selectionSaved"), "success");
} catch (error) {
const message = describeSelectionError(error);
if (message === t("completePluginConfiguration") || message === t("instancePermissionRequired")) {
@@ -1739,7 +1779,7 @@ const createClipMenus = () => {
chrome.runtime.onInstalled.addListener(registerClipMenus);
-chrome.contextMenus.onClicked.addListener((info: { menuItemId?: string | number; srcUrl?: string; pageUrl?: string; linkUrl?: string; frameId?: number; selectionText?: string }, tab?: { id?: number; url?: string; title?: string }) => {
+chrome.contextMenus.onClicked.addListener((info: { menuItemId?: string | number; srcUrl?: string; pageUrl?: string; frameUrl?: string; linkUrl?: string; frameId?: number; selectionText?: string }, tab?: { id?: number; url?: string; title?: string }) => {
if (PLATFORM_MENUS.some((menu) => menu.id === info.menuItemId)) {
void savePlatformFromMenu(info, tab);
return;
@@ -1795,8 +1835,9 @@ chrome.windows.onRemoved.addListener((windowId: number) => {
});
const currentPageCaptureRoute = (pageUrl: string) => {
+ if (jikeLoginPost(pageUrl)) return {kind:'login-required',platform:t('platformJike'),access:'login-required'};
const platform = platformTarget(pageUrl);
- if (platform) return { kind:'platform', platform:({ 'hacker-news':'Hacker News', v2ex:'V2EX', xiaoyuzhou:t('platformXiaoyuzhou'), facebook:'Facebook', instagram:'Instagram', linkedin:'LinkedIn', threads:'Threads', bluesky:'Bluesky', 'substack-note':'Substack' })[platform.platform] };
+ if (platform) return { kind:'platform', platform:({ 'hacker-news':'Hacker News', v2ex:'V2EX', xiaoyuzhou:t('platformXiaoyuzhou'), boss:t('platformBoss'), xueqiu:t('platformXueqiu'), wechat:t('platformWechat'), jike:t('platformJike'), sspai:t('platformSspai'), juejin:t('platformJuejin'), douban:t('platformDouban'), facebook:'Facebook', instagram:'Instagram', linkedin:'LinkedIn', threads:'Threads', bluesky:'Bluesky', 'substack-note':'Substack' })[platform.platform] };
if (socialPlatform(pageUrl)) return { kind:'social-feed' };
if (youtubeTargetFromUrl(pageUrl)) return { kind:'video',platform:'YouTube' };
if (bilibiliTargetFromUrl(pageUrl)) return { kind:'video',platform:'Bilibili' };
@@ -1810,10 +1851,28 @@ chrome.runtime.onMessage.addListener((message: { type?: string; page?: unknown;
void (async()=>{
const [tab]=await chrome.tabs.query({active:true,currentWindow:true});
const route=currentPageCaptureRoute(tab?.url || '');
+ if (tab?.id && platformTarget(tab.url || '')?.platform === 'boss') {
+ try {
+ const [read] = await chrome.scripting.executeScript({ target: { tabId: tab.id, frameIds: [0] }, func: bossLoginRequired });
+ if ((await chrome.tabs.get(tab.id)).url !== tab.url || typeof read?.result !== 'boolean') {
+ sendResponse({kind:'unknown'}); return;
+ }
+ sendResponse(read.result ? {...route,access:'login-required'} : route); return;
+ } catch { sendResponse({kind:'unknown'}); return; }
+ }
if (route.kind === 'page' && tab?.id) {
try {
const [read]=await chrome.scripting.executeScript({target:{tabId:tab.id,frameIds:[0]},func:articlePlatform});
- if (read?.result) { sendResponse({kind:'page',platform:read.result});return; }
+ if (read?.result) {
+ let restricted=false;
+ if (read.result === 'Substack') {
+ const [gate]=await chrome.scripting.executeScript({target:{tabId:tab.id,frameIds:[0]},func:substackPaywall});
+ if(typeof gate?.result !== 'boolean') {sendResponse({kind:'unknown'});return;}
+ restricted=gate.result;
+ }
+ if ((await chrome.tabs.get(tab.id)).url !== tab.url) {sendResponse({kind:'unknown'});return;}
+ sendResponse({kind:'page',platform:read.result,...(restricted ? {access:'content-restricted'} : {})});return;
+ }
} catch { /* The URL still uses the generic page capture route. */ }
}
sendResponse(route);
@@ -1829,8 +1888,11 @@ chrome.runtime.onMessage.addListener((message: { type?: string; page?: unknown;
return false;
}
if (message.type === "capturedPage" && message.page) {
- pendingCapture?.(message.page);
- pendingCapture = null;
+ if (pendingCapture && pendingCapture.requestId === message.requestId) {
+ const pending = pendingCapture;
+ pendingCapture = null;
+ pending.resolve(message.page);
+ }
return false;
}
@@ -1979,58 +2041,86 @@ chrome.runtime.onMessage.addListener((message: { type?: string; page?: unknown;
throw new Error(t("currentPageNotFound"));
}
+ const tabId = tab.id;
const pageUrl = tab.url || "";
const route = currentPageCaptureRoute(pageUrl);
- if (route.kind === 'platform') {
+ // Read the selection before queueing. Later edits to the source page
+ // must not change this click from whole-page to selection or A to B.
+ let selectionText: string | undefined;
+ if (["platform", "page", "social-feed", "login-required"].includes(route.kind)) {
try {
- sendResponse(await enqueueClip(() => performPlatformSave(tab.id, pageUrl, true)));
+ const [read] = await chrome.scripting.executeScript({target:{tabId,frameIds:[0]},func:()=>({url:location.href,text:window.getSelection()?.toString().replace(/\u00a0/g," ").trim() || ""})});
+ if (read?.result?.url !== pageUrl) throw new Error(t("platformPageChanged"));
+ selectionText = read.result.text;
} catch (error) {
- sendResponse({ ok: false, message: describePlatformError(error) });
+ if (error instanceof Error && error.message === t("platformPageChanged")) throw error;
+ throw new Error(describeCaptureError(error));
}
- return;
- }
- if (route.kind === 'social-feed') {
- // Feed capture requires an explicit card. A text selection still uses
- // the normal selected-text path further below.
- const selection = (await chrome.scripting.executeScript({target:{tabId:tab.id,frameIds:[0]},func:()=>window.getSelection()?.toString().trim() || ""}))[0]?.result;
- if (!selection) { sendResponse({ok:false,message:t("socialSelectPost")}); return; }
- }
- if (route.kind === 'video') {
- const result = await enqueueClip(() => performVideoSave(settings, tab.id, null, pageUrl));
- sendResponse(result.created ? { ok: true, message: result.message } : { ok: false, message: result.message });
- return;
}
+ await enqueueClip(async () => {
+ if ((await chrome.tabs.get(tabId)).url !== pageUrl) throw new Error(t("platformPageChanged"));
+ if (route.kind === 'login-required' || route.kind === 'social-feed') {
+ try {
+ const emptyMessage = route.kind === 'login-required' ? t('platformUnreadable')
+ : t(socialPlatform(pageUrl) === "douban" ? "doubanSelectComment" : "socialSelectPost");
+ const selection = selectionText;
+ if (!selection) {sendResponse({ok:false,message:emptyMessage});return;}
+ const page = await readCapturedPage(tabId, null, "selection", selectionText);
+ if (page.url !== pageUrl) throw new Error(t("platformPageChanged"));
+ if (page.kind !== "selection" || !page.markdown.trim()) {sendResponse({ok:false,message:emptyMessage});return;}
+ const images=await createMemo(settings, page, tabId, pageUrl);
+ sendResponse({ok:true,message:clipImageFeedback(images)});
+ } catch (error) {
+ sendResponse({ok:false,message:describePlatformError(error)});
+ }
+ return;
+ }
+ if (route.kind === 'platform') {
+ try {
+ sendResponse(await performPlatformSave(tabId, pageUrl, true, pageUrl, selectionText));
+ } catch (error) {
+ sendResponse({ ok: false, message: describePlatformError(error) });
+ }
+ return;
+ }
+ if (route.kind === 'video') {
+ const result = await performVideoSave(settings, tabId, null, pageUrl);
+ sendResponse(result.created ? { ok: true, message: result.message } : { ok: false, message: result.message });
+ return;
+ }
- if (route.kind === 'github') {
- let facts: GithubRepoFacts | null = null;
- try {
- facts = await readGithubRepoFromPage(tab.id, null);
- } catch {
- // The repository card is unavailable. Save the page as an article.
+ if (route.kind === 'github') {
+ let facts: GithubRepoFacts | null = null;
+ try {
+ facts = await readGithubRepoFromPage(tabId, null);
+ } catch {
+ // The repository card is unavailable. Save the page as an article.
+ }
+ if (facts) {
+ await createGithubRepoMemo(settings, facts);
+ sendResponse({ ok: true });
+ return;
+ }
}
- if (facts) {
- await createGithubRepoMemo(settings, facts);
+
+ if (route.kind === 'zhihu') {
+ const located = await readZhihuLocate(tabId, null);
+ if (!located.ok) throw new Error(t("zhihuNotFound"));
+ await saveLocatedZhihu(settings, tabId, null, located);
sendResponse({ ok: true });
return;
}
- }
- if (route.kind === 'zhihu') {
- const located = await readZhihuLocate(tab.id, null);
- if (!located.ok) throw new Error(t("zhihuNotFound"));
- await saveLocatedZhihu(settings, tab.id, null, located);
- sendResponse({ ok: true });
- return;
- }
-
- const page = await readCapturedPage(tab.id, null, "page");
- await createMemo(settings, page, tab.id);
- sendResponse({ ok: true });
+ const page = await readCapturedPage(tabId, null, "page", selectionText);
+ if (page.url !== pageUrl) throw new Error(t("platformPageChanged"));
+ const images = await createMemo(settings, page, tabId, pageUrl);
+ sendResponse({ ok: true, message: clipImageFeedback(images) });
+ });
} catch (error) {
const message = error instanceof Error ? error.message : "";
sendResponse({
ok: false,
- message: message === t("zhihuNotFound") || message === t("zhihuUnreadable")
+ message: message === t("zhihuNotFound") || message === t("zhihuUnreadable") || message === t("pageAccessDenied") || message === t("platformPageChanged") || message === t("pageCaptureRestrictedHint")
? message
: message === t("captureTimeout") || message.startsWith(t("captureScriptFailed", ""))
? describeCaptureError(error)
diff --git a/apps/extension/src/boss-clip.ts b/apps/extension/src/boss-clip.ts
new file mode 100644
index 00000000..f8995723
--- /dev/null
+++ b/apps/extension/src/boss-clip.ts
@@ -0,0 +1,60 @@
+import { markdownText, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, type PlatformRead } from "./platform-clip";
+
+/** Closure-free, read-only probe shared with the popup's executeScript call. */
+export function bossLoginRequired(doc: Document = document): boolean {
+ return Array.from(doc.querySelectorAll(".job-detail-section .job-sec-text .zp-more-info-layer-wrapper .zp-more-info-layer-text")).some((node) => {
+ let visibleText = "";
+ const walker = doc.createTreeWalker(node, 4 /* SHOW_TEXT */);
+ for (let text = walker.nextNode(); text; text = walker.nextNode()) {
+ const parent = text.parentElement;
+ if (!parent) continue;
+ let visibility = doc.defaultView?.getComputedStyle?.(parent).visibility, hidden = false;
+ for (let current: Element | null = parent; current; current = current.parentElement) {
+ if (current.matches('[hidden], [aria-hidden="true"], script, style, template')) { hidden = true; break; }
+ const style = doc.defaultView?.getComputedStyle?.(current) || (current as HTMLElement).style;
+ if (style?.display === "none") { hidden = true; break; }
+ if (!visibility && style?.visibility && style.visibility !== "inherit") visibility = style.visibility;
+ }
+ if (!hidden && visibility !== "hidden" && visibility !== "collapse") visibleText += text.textContent || "";
+ }
+ return visibleText.replace(/\s+/g, "").includes("登录查看完整内容");
+ });
+}
+
+export const readBoss = (doc: Document, pageUrl: string): PlatformRead => {
+ const target = platformTarget(pageUrl);
+ if (target?.platform !== "boss") return { ok: false, reason: "not-target" };
+ const canonical = doc.querySelector('link[rel="canonical"]')?.getAttribute("href") || "";
+ if (canonical && platformTarget(canonical)?.url !== target.url) return { ok: false, reason: "changed" };
+ const banner = doc.querySelector(".job-banner .info-primary");
+ const body = doc.querySelector(".job-detail-section:not(.job-detail-company) .job-sec-text");
+ const company = doc.querySelector(".job-detail-company .job-sec-text");
+ if (!banner || !body) return { ok: false, reason: "unreadable" };
+ // The public preview cuts the requirements mid-sentence. Never save it as a
+ // complete job, or recover the protected remainder from scripts or APIs.
+ if (bossLoginRequired(doc)) return { ok: false, reason: "unreadable" };
+ const cleanBanner = platformReadableCopy(banner);
+ const title = platformText(cleanBanner.querySelector("h1"));
+ const salary = platformText(cleanBanner.querySelector(".salary"));
+ const requirements = platformText(cleanBanner.querySelector("p"));
+ const companyName = Array.from(doc.querySelectorAll(".sider-company .company-info a[href]"))
+ .map((node) => platformText(platformReadableCopy(node))).find(Boolean) || "";
+ const bodyMarkdown = platformHtmlMarkdown(platformReadableCopy(body), target.url);
+ const companyMarkdown = company ? platformHtmlMarkdown(platformReadableCopy(company), target.url) : "";
+ if (!title || !bodyMarkdown) return { ok: false, reason: "unreadable" };
+ // Keep the site's headings instead of inventing a second classification of
+ // responsibilities and requirements. Only the relevant text blocks enter.
+ const info = [salary, requirements].filter(Boolean).map(markdownText).join(" · ");
+ const address = doc.querySelector(".job-detail-company .location-address");
+ const companyHeading = doc.querySelector(".job-detail-company h3");
+ const bodyHeading = body.parentElement?.querySelector("h3,.detail-content-header");
+ const heading = (node: Element | null | undefined) => node ? platformText(platformReadableCopy(node)) : "";
+ const companyLabel = heading(companyHeading) || companyName;
+ const benefits = Array.from(doc.querySelectorAll(".job-banner .job-tags"))
+ .map((node) => platformText(platformReadableCopy(node))).find(Boolean);
+ return { ok: true, clip: { ...target, title, author: companyName || undefined,
+ markdown: [info, companyName ? markdownText(companyName) : "", benefits ? markdownText(benefits) : "", `## ${markdownText(heading(bodyHeading) || title)}`, bodyMarkdown,
+ companyMarkdown && companyLabel ? `## ${markdownText(companyLabel)}` : "", companyMarkdown,
+ address ? markdownText(platformText(platformReadableCopy(address))) : ""].filter(Boolean).join("\n\n"),
+ tags: ["web-clip", "boss"], completeness: "complete" } };
+};
diff --git a/apps/extension/src/capture-platform.ts b/apps/extension/src/capture-platform.ts
index cecb50a2..45167b7c 100644
--- a/apps/extension/src/capture-platform.ts
+++ b/apps/extension/src/capture-platform.ts
@@ -1,13 +1,20 @@
+import { selectionTextMarkdown } from "./selection-clip";
import { facebookExpandButton, linkedinExpandButton, readSocial, socialPostCard } from "./social-clip";
import { readHackerNews } from "./hacker-news-clip";
import { readV2ex } from "./v2ex-clip";
import { readXiaoyuzhou } from "./xiaoyuzhou-clip";
-import { markdownText, platformHtmlMarkdown, platformTarget, type PlatformLabels, type PlatformRead } from "./platform-clip";
+import { readBoss } from "./boss-clip";
+import { readXueqiu } from "./xueqiu-clip";
+import { readXueqiuFeedPost } from "./xueqiu-feed";
+import { readArticle } from "./article-clip";
+import { readJike, jikeExpandButton, jikePostCard } from "./jike-clip";
+import { readDouban } from "./douban-clip";
+import { platformHtmlMarkdown, platformTarget, type PlatformLabels, type PlatformRead } from "./platform-clip";
// Built as a standalone IIFE and injected only after a user action.
(() => {
const root = globalThis as typeof globalThis & {
- __edgeeverPlatformClipPayload?: { requestId?: string; url?: string; selectionFirst?: boolean; sourceUrl?: string; xiaoyuzhouState?: unknown };
+ __edgeeverPlatformClipPayload?: { requestId?: string; url?: string; selectionFirst?: boolean; selectionText?: string; sourceUrl?: string; xiaoyuzhouState?: unknown };
};
const payload = root.__edgeeverPlatformClipPayload;
delete root.__edgeeverPlatformClipPayload;
@@ -29,6 +36,11 @@ import { markdownText, platformHtmlMarkdown, platformTarget, type PlatformLabels
case "hacker-news": return readHackerNews(document, location.href, labels);
case "v2ex": return readV2ex(document, location.href, labels);
case "xiaoyuzhou": return readXiaoyuzhou(document, location.href, labels, payload.xiaoyuzhouState);
+ case "boss": return readBoss(document, location.href);
+ case "xueqiu": return readXueqiu(document, expected, location.href);
+ case "wechat": case "sspai": case "juejin": return readArticle(document, location.href, t("platformOfficialAccountLabel"));
+ case "jike": return readJike(document, location.href, expected);
+ case "douban": return readDouban(document, expected, location.href, t("platformListSourceLabel"));
default: return readSocial(document, expected);
}
};
@@ -39,17 +51,22 @@ import { markdownText, platformHtmlMarkdown, platformTarget, type PlatformLabels
const capture = async () => {
if (!samePage()) return { ok: false, reason: "changed" };
const selection = payload.selectionFirst ? window.getSelection() : null;
- if (selection?.rangeCount && selection.toString().trim()) {
+ const liveText = selection?.toString().replace(/\u00a0/g, " ").trim() || "";
+ const selectedText = payload.selectionFirst ? payload.selectionText ?? liveText : "";
+ if (selectedText) {
const selected = document.createElement("div");
- for (let index = 0; index < selection.rangeCount; index += 1) selected.appendChild(selection.getRangeAt(index).cloneContents());
+ if (selection?.rangeCount && liveText === selectedText) {
+ for (let index = 0; index < selection.rangeCount; index += 1) selected.appendChild(selection.getRangeAt(index).cloneContents());
+ }
const markdown = platformHtmlMarkdown(selected, expected.url)
- || selection.toString().trim().split(/\r?\n/).map(markdownText).join("\n");
+ || selectionTextMarkdown(selectedText);
return { ok: true, selection: { title: document.title.trim() || expected.platform, url: expected.url, markdown, kind: "selection" } };
}
+ if(expected.platform === "xueqiu" && !platformTarget(location.href)) return readXueqiuFeedPost(document,expected,sourceUrl);
const initial = read();
- if (!initial.ok && initial.reason === "incomplete" && ["facebook", "linkedin"].includes(expected.platform)) {
- const card = socialPostCard(document,expected);
- const expand = expected.platform === "facebook" ? facebookExpandButton(card) : linkedinExpandButton(card);
+ if (!initial.ok && initial.reason === "incomplete" && ["facebook", "linkedin", "jike"].includes(expected.platform)) {
+ const card = expected.platform === "jike" ? jikePostCard(document,expected,location.href) : socialPostCard(document,expected);
+ const expand = expected.platform === "jike" ? jikeExpandButton(document,card) : expected.platform === "facebook" ? facebookExpandButton(card) : linkedinExpandButton(card);
if (!expand) return initial;
return new Promise<PlatformRead>((resolve) => {
let settled=false;
diff --git a/apps/extension/src/capture.ts b/apps/extension/src/capture.ts
index 6f19f69d..3f2ed044 100644
--- a/apps/extension/src/capture.ts
+++ b/apps/extension/src/capture.ts
@@ -1,7 +1,8 @@
-import { articlePlatform } from "./article-platform";
-import { platformHtmlMarkdown } from "./platform-clip";
+import { selectionTextMarkdown } from "./selection-clip";
+import { articlePlatform, substackPaywall } from "./article-platform";
+import { platformHtmlMarkdown, type PublishedTime } from "./platform-clip";
import { Readability } from "@mozilla/readability";
-import TurndownService from "turndown";
+import { createDocument } from "@mixmark-io/domino";
import { mediumContent } from "./medium-content";
import { substackContent } from "./substack-content";
@@ -11,11 +12,12 @@ import { substackContent } from "./substack-content";
const t = (key: string) => chrome.i18n.getMessage(key) || key;
const root = globalThis as typeof globalThis & {
- __edgeeverPageClipPayload?: { mode?: string };
+ __edgeeverPageClipPayload?: { mode?: string; requestId?: string; selectionText?: string };
};
const clipPayload = root.__edgeeverPageClipPayload;
delete root.__edgeeverPageClipPayload;
-const selectionOnly = clipPayload?.mode === "selection";
+const frozenSelection = clipPayload?.selectionText;
+const selectionOnly = clipPayload?.mode === "selection" || !!frozenSelection;
type CapturedPage = {
title: string;
@@ -23,11 +25,15 @@ type CapturedPage = {
markdown: string;
plainText?: string;
kind?: "page" | "selection";
+ platform?: "medium" | "substack";
+ author?: string;
+ publishedAt?: PublishedTime;
};
const getSelectionHtml = () => {
const selection = window.getSelection();
- if (!selection || selection.rangeCount === 0 || !selection.toString().trim()) {
+ if (!selection || selection.rangeCount === 0 || !selection.toString().trim()
+ || (frozenSelection !== undefined && selection.toString().replace(/\u00a0/g, " ").trim() !== frozenSelection)) {
return "";
}
@@ -39,26 +45,20 @@ const getSelectionHtml = () => {
return container.innerHTML.trim();
};
-const normalizeMarkdown = (value: string) => value.replace(/\n{3,}/g, "\n\n").trim();
-
const markdownFromHtml = (html: string) => {
if (!html) return "";
- const turndown = new TurndownService({
- bulletListMarker: "-",
- codeBlockStyle: "fenced",
- headingStyle: "atx",
- linkStyle: "inlined",
- });
- return normalizeMarkdown(turndown.turndown(html));
+ // Parse in Domino's inert document, sharing article/table conversion without
+ // activating page scripts or media through a browser HTML assignment.
+ return platformHtmlMarkdown(createDocument(html).body, location.href);
};
const captureSelection = (): CapturedPage => {
- const plain = window.getSelection()?.toString().replace(/\u00a0/g, " ").trim() ?? "";
+ const plain = frozenSelection ?? window.getSelection()?.toString().replace(/\u00a0/g, " ").trim() ?? "";
const html = getSelectionHtml();
return {
title: document.title.trim() || location.hostname,
url: location.href,
- markdown: markdownFromHtml(html) || plain,
+ markdown: markdownFromHtml(html) || selectionTextMarkdown(plain),
plainText: plain,
kind: "selection",
};
@@ -87,17 +87,18 @@ const textFallback = () => {
};
let readingAdaptedArticle = false;
-type CaptureReply = CapturedPage | { error: "unreadable" };
+type CaptureReply = CapturedPage | { error: "unreadable" | "restricted" };
const capturePage = (): CaptureReply => {
const selectionHtml = getSelectionHtml();
const platform = !selectionHtml ? articlePlatform(document,location.href) : null;
if (platform) {
readingAdaptedArticle = true;
+ if(platform === "Substack" && substackPaywall(document)) return {error:"restricted"};
const adapted = platform === "Medium" ? mediumContent(document,location.href) : substackContent(document,location.href);
- const markdown = adapted ? normalizeMarkdown(platformHtmlMarkdown(adapted.body,location.href)) : "";
+ const markdown = adapted ? platformHtmlMarkdown(adapted.body,location.href) : "";
if (!adapted || !markdown) return {error:"unreadable"};
- return {title:adapted.title,url:location.href,markdown,kind:"page"};
+ return {title:adapted.title,url:location.href,markdown,kind:"page",platform:platform === "Medium" ? "medium" : "substack",author:adapted.author,publishedAt:adapted.publishedAt};
}
let article: ReturnType<Readability["parse"]> = null;
let sourceHtml = selectionHtml;
@@ -121,7 +122,7 @@ const capturePage = (): CaptureReply => {
};
const sendCapturedPage = (page: CaptureReply) => {
- void chrome.runtime.sendMessage({ type: "capturedPage", page });
+ void chrome.runtime.sendMessage({ type: "capturedPage", requestId: clipPayload?.requestId, page });
};
try {
diff --git a/apps/extension/src/douban-clip.ts b/apps/extension/src/douban-clip.ts
new file mode 100644
index 00000000..86a0903f
--- /dev/null
+++ b/apps/extension/src/douban-clip.ts
@@ -0,0 +1,101 @@
+import { articlePublishedTime } from "./article-clip";
+import { markdownText, markdownUrl, platformElementHidden, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, safePlatformUrl, type PlatformRead, type PlatformTarget } from "./platform-clip";
+
+const text = (node: Element | null) => node ? platformText(platformReadableCopy(node)) : "";
+
+/** Douban renders review text with white-space: pre-wrap. */
+const restoreReviewParagraphs = (body: Element) => {
+ const doc=body.ownerDocument;
+ const split=(node: Node): Node[] => {
+ if(node.nodeType === 3) return (node.textContent || "").split(/\r?\n[\t ]*\r?\n(?:[\t ]*\r?\n)*/).map(text=>{
+ const fragment=doc.createDocumentFragment();
+ text.split(/\r?\n/).forEach((line,index)=>{
+ if(index) fragment.appendChild(doc.createElement("br"));
+ fragment.appendChild(doc.createTextNode(line));
+ });
+ return fragment;
+ });
+ if(node.nodeType !== 1 || /^(PRE|CODE)$/.test((node as Element).tagName)) return [node.cloneNode(true)];
+ const groups: Node[][]=[[]];
+ for(const child of Array.from(node.childNodes)) {
+ const parts=split(child);
+ groups[groups.length-1].push(parts[0]);
+ for(const part of parts.slice(1)) groups.push([part]);
+ }
+ return groups.map(children=>{
+ const copy=node.cloneNode(false);
+ children.forEach(child=>copy.appendChild(child));
+ return copy;
+ });
+ };
+ for(const paragraph of Array.from(body.querySelectorAll("p"))) {
+ if(paragraph.closest("pre,code") || !/\r?\n/.test(paragraph.textContent || "")) continue;
+ for(const part of split(paragraph)) paragraph.parentNode!.insertBefore(part,paragraph);
+ paragraph.remove();
+ }
+};
+
+/** Use the short comment's own time link, never a link from its body. */
+export const doubanCommentTarget = (card: Element, pageUrl: string): PlatformTarget | null => {
+ const link=card.querySelector(".comment-info .comment-time[href]");
+ const id=card.getAttribute("data-cid");
+ let source: URL; try {source=new URL(pageUrl);} catch {return null;}
+ if (!id || !/^[1-9]\d*$/.test(id) || !["book.douban.com","movie.douban.com","music.douban.com"].includes(source.hostname)) return null;
+ const target=platformTarget(`https://${source.hostname}/comment/${id}/`);
+ const own=link ? platformTarget(safePlatformUrl(link.getAttribute("href") || "",pageUrl)) : null;
+ return own && own.url !== target?.url ? null : target;
+};
+
+export const readDouban = (doc: Document, target: PlatformTarget, sourceUrl: string, listLabel="Douban"): PlatformRead => {
+ if (target.platform !== "douban") return {ok:false,reason:"not-target"};
+ const source=platformTarget(sourceUrl), parts=target.id.split("/");
+ if (parts[1] !== "comment" && source?.url !== target.url) return {ok:false,reason:"changed"};
+ const declared=doc.querySelector('meta[property="og:url"]')?.getAttribute("content");
+ if (declared && parts[1] !== "comment" && platformTarget(safePlatformUrl(declared,target.url))?.url !== target.url) return {ok:false,reason:"changed"};
+ let body: Element | null, author: Element | null, time: Element | null, subject: Element | null, rating: Element | null;
+ let title=text(doc.querySelector("#content h1"));
+ if (parts[1] === "review") {
+ body=doc.querySelector(`#review-${parts[2]}-content .review-content`);
+ author=doc.querySelector('.main-hd > a[href*="/people/"]');
+ const header=doc.querySelector(".main-hd");
+ time=header?.querySelector(".main-meta span[content],.main-meta time") || null;
+ if (/已编辑/.test(text(header?.querySelector(".main-meta") || null))) time=null;
+ subject=header?.querySelector('a[href*="/subject/"]') || null;
+ rating=header?.querySelector(".main-title-rating[title]") || null;
+ } else if (parts[1] === "comment") {
+ const card=doc.querySelector(`.comment-item[data-cid="${parts[2]}"]`);
+ if (!card || doubanCommentTarget(card,sourceUrl)?.url !== target.url) return {ok:false,reason:"unreadable"};
+ // Lists need an explicitly chosen own card. Never archive every short
+ // comment as one post, and never read an unrelated page with a copied card.
+ if (source?.url !== target.url) {
+ let page: URL; try {page=new URL(sourceUrl);} catch {return {ok:false,reason:"not-target"};}
+ if (page.hostname !== new URL(target.url).hostname || !/^\/subject\/[1-9]\d*\/comments\/?$/.test(page.pathname)) return {ok:false,reason:"not-target"};
+ }
+ body=card.querySelector(".comment-content"); author=card.querySelector('.comment-info a[href*="/people/"]');
+ time=card.querySelector(".comment-time"); subject=doc.querySelector('h1 a[href*="/subject/"],.subject-title a[href]');
+ rating=card.querySelector(".rating[title]");
+ title=[text(subject) || title.replace(/\s*短评$/, ""),text(author)].filter(Boolean).join(" · ") || title;
+ } else {
+ body=doc.querySelector(`#link-report .note`);
+ author=doc.querySelector('.note-header a.note-author[href*="/people/"]');
+ time=doc.querySelector(".note-header .pub-date,.note-header .pubtime");
+ subject=null; rating=null;
+ }
+ if (!body) return {ok:false,reason:"unreadable"};
+ const clean=platformReadableCopy(body);
+ if(parts[1] === "review") restoreReviewParagraphs(clean);
+ const markdown=platformHtmlMarkdown(clean,target.url);
+ if (!markdown || !title) return {ok:false,reason:"unreadable"};
+ const subjectName=text(subject), subjectUrl=subject ? safePlatformUrl(subject.getAttribute("href") || "",sourceUrl) : "";
+ const ratingText=rating && !platformElementHidden(rating) ? rating.getAttribute("title")?.trim() : "";
+ const metadata=[subjectName && subjectUrl ? `[${markdownText(subjectName)}](${markdownUrl(subjectUrl)})` : "",ratingText ? markdownText(ratingText) : ""].filter(Boolean).join(" · ");
+ let list="";
+ if (parts[1] === "comment" && source?.url !== target.url) {
+ const url=new URL(sourceUrl); url.searchParams.delete("_i");url.searchParams.delete("_spm_id");
+ const card=doc.querySelector(`.comment-item[data-cid="${parts[2]}"]`);
+ url.hash=card?.id || card?.querySelector(`[id="c-${parts[2]}"]`)?.id || "";
+ const safe=safePlatformUrl(url.href,target.url);
+ if (safe) list=`${markdownText(listLabel)}: [${markdownText(safe)}](${markdownUrl(safe)})`;
+ }
+ return {ok:true,clip:{...target,title,author:text(author) || undefined,publishedAt:articlePublishedTime(time),markdown:[metadata,list,markdown].filter(Boolean).join("\n\n"),tags:["web-clip","douban"],completeness:"complete"}};
+};
diff --git a/apps/extension/src/jike-clip.ts b/apps/extension/src/jike-clip.ts
new file mode 100644
index 00000000..fc9829d7
--- /dev/null
+++ b/apps/extension/src/jike-clip.ts
@@ -0,0 +1,113 @@
+import { platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, safePlatformUrl, socialPlatform, type PlatformRead, type PlatformTarget } from "./platform-clip";
+
+type JikePicture = { picUrl?: unknown; middlePicUrl?: unknown; thumbnailUrl?: unknown };
+type JikePost = { id?: unknown; content?: unknown; createdAt?: unknown; pictures?: JikePicture[]; user?: { username?: unknown } };
+export const JIKE_CARD_SELECTOR = ".post-list .post-item-li";
+
+/** The Web site redirects signed-out post/feed requests to this login URL. */
+export const jikeLoginPost = (pageUrl: string): boolean => {
+ try {
+ const url=new URL(pageUrl);
+ if (url.origin !== "https://web.okjike.com" || url.pathname !== "/login" || url.searchParams.getAll("redirectURL").length !== 1) return false;
+ const redirect=new URL(url.searchParams.get("redirectURL")!,url.origin);
+ return redirect.origin === url.origin && (platformTarget(redirect.href)?.platform === "jike" || socialPlatform(redirect.href) === "jike");
+ } catch {return false;}
+};
+const pageData = (doc: Document): { post?: JikePost; posts?: JikePost[]; id?: string } => {
+ try {
+ const state=JSON.parse(doc.querySelector("#__NEXT_DATA__")?.textContent || "");
+ return {post:state.props?.pageProps?.post,posts:state.props?.pageProps?.posts,id:state.query?.id};
+ } catch {return {};}
+};
+const bodyInCard = (card: Element) => Array.from(card.querySelectorAll(".text,.image-item,.is-article"))
+ .map(node=>node.parentElement).find(Boolean) || null;
+const comparisonText = (body: Element, base: string) => {
+ const comparison=body.cloneNode(true) as Element;
+ for (const n of Array.from(comparison.querySelectorAll('button,[role="button"]'))) n.remove();
+ // Share pages shorten URL labels to hostnames. Mentions remain source text.
+ for (const link of Array.from(comparison.querySelectorAll("a[href]"))) {
+ const href=safePlatformUrl(link.getAttribute("href") || "",base);
+ if (href && platformText(link) === new URL(href).hostname) link.textContent=href;
+ }
+ for (const n of Array.from(comparison.querySelectorAll("br"))) n.replaceWith(comparison.ownerDocument.createTextNode("\n"));
+ return comparison.textContent || "";
+};
+const normalizedText = (value: string, base: string) => value.replace(/https?:\/\/\S+/g,href=>{
+ const own=platformTarget(href);
+ return own?.platform === "jike" ? own.url : safePlatformUrl(href,base) || href;
+}).replace(/\s+/g,"");
+const pictureUrls = (picture: JikePicture | undefined, base: string) => picture ? [picture.picUrl,picture.middlePicUrl,picture.thumbnailUrl]
+ .filter((value): value is string=>typeof value === "string").map(value=>safePlatformUrl(value,base)).filter(Boolean) : [];
+
+/** H5 topic cards have no post link. Bind public data by own author and text,
+ * never by array position, a mentioned post, or another card's permalink. */
+export const jikeCardTarget = (card: Element, pageUrl: string): PlatformTarget | null => {
+ if (!card.matches(JIKE_CARD_SELECTOR) || socialPlatform(pageUrl) !== "jike") return null;
+ const clean=platformReadableCopy(card), body=clean.querySelector(".text");
+ const avatar=clean.querySelector('a.avatar[href]');
+ const profile=safePlatformUrl(avatar?.getAttribute("href") || "",pageUrl);
+ if (!profile || new URL(profile).protocol !== "https:" || !["m.okjike.com","web.okjike.com"].includes(new URL(profile).hostname)) return null;
+ const username=profile && /^\/users\/([^/]+)\/?$/.exec(new URL(profile).pathname)?.[1].toLowerCase();
+ if (!username) return null;
+ const content=body ? normalizedText(comparisonText(body,pageUrl),pageUrl) : "";
+ const images=Array.from(clean.querySelectorAll(".image-item img")).map(img=>safePlatformUrl(img.getAttribute("src") || "",pageUrl));
+ const expand=!!jikeExpandButton(card.ownerDocument,card);
+ const posts=pageData(card.ownerDocument).posts;
+ const matches=Array.isArray(posts) ? posts.filter(post=>{
+ if (typeof post.user?.username !== "string" || post.user.username.toLowerCase() !== username || typeof post.content !== "string") return false;
+ const full=normalizedText(post.content,pageUrl);
+ if (full !== content && !(expand && content && full.startsWith(content.replace(/[.…]+$/,"")))) return false;
+ const pictures=Array.isArray(post.pictures) ? post.pictures : [];
+ return images.length === pictures.length && images.every((image,index)=>image && pictureUrls(pictures[index],pageUrl).includes(image));
+ }) : [];
+ return matches.length === 1 && typeof matches[0].id === "string" ? platformTarget(`https://m.okjike.com/originalPosts/${matches[0].id}`) : null;
+};
+export const jikePostCard = (doc: Document, target: PlatformTarget, pageUrl: string): Element | null => {
+ const detail=platformTarget(pageUrl);
+ if (detail?.platform === "jike" && detail.id === target.id) return doc.querySelector(".post-page .post-wrap");
+ return Array.from(doc.querySelectorAll(JIKE_CARD_SELECTOR)).find(card=>jikeCardTarget(card,pageUrl)?.id === target.id) || null;
+};
+
+/** Public share-page/card reader. It never fetches authenticated Jike APIs. */
+export const readJike = (doc: Document, pageUrl: string, target: PlatformTarget | null = platformTarget(pageUrl)): PlatformRead => {
+ if (target?.platform !== "jike") return {ok:false,reason:"not-target"};
+ const card=jikePostCard(doc,target,pageUrl);
+ const body=card && bodyInCard(card);
+ if (!card || !body) return {ok:false,reason:"unreadable"};
+ const state=pageData(doc), detail=platformTarget(pageUrl)?.platform === "jike";
+ const post=detail ? state.post : state.posts?.find(post=>post.id === target.id);
+ if (detail && ((post?.id && post.id !== target.id) || (state.id && state.id !== target.id))) return {ok:false,reason:"changed"};
+ const clean=platformReadableCopy(body), text=clean.matches(".text") ? clean : clean.querySelector(".text");
+ if (jikeExpandButton(doc,card)) return {ok:false,reason:"incomplete"};
+ if (typeof post?.content === "string" && !text && post.content.trim()) return {ok:false,reason:"incomplete"};
+ if (typeof post?.content === "string" && text && normalizedText(post.content,target.url) !== normalizedText(comparisonText(text,target.url),target.url)) return {ok:false,reason:"incomplete"};
+ const pictures=Array.isArray(post?.pictures) ? post.pictures : undefined;
+ if (pictures && !pictures.every(p=>pictureUrls(p,target.url).length)) return {ok:false,reason:"incomplete"};
+ const images=Array.from(clean.querySelectorAll(".image-item img"));
+ if (pictures && images.length !== pictures.length) return {ok:false,reason:"incomplete"};
+ for (const [index,image] of images.entries()) {
+ const shown=safePlatformUrl(image.getAttribute("src") || "",target.url),picture=pictures?.[index];
+ if (picture && !pictureUrls(picture,target.url).includes(shown)) return {ok:false,reason:"incomplete"};
+ const original=typeof picture?.picUrl === "string" ? safePlatformUrl(picture.picUrl,target.url) : "";
+ if (original) image.setAttribute("data-original",original);
+ }
+ // Preserve the audio/link preview text and cover, excluding player controls.
+ clean.querySelectorAll('button,[role="button"],audio').forEach(node=>{
+ if (images.includes(node)) node.removeAttribute("role");
+ else if (node.tagName.toLowerCase() !== "audio" && images.some(image=>node.contains(image))) node.replaceWith(...Array.from(node.childNodes));
+ else node.remove();
+ });
+ for (const link of Array.from(clean.querySelectorAll("a[href]"))) {
+ const own=platformTarget(safePlatformUrl(link.getAttribute("href") || "",target.url));
+ if (own?.platform === "jike") link.setAttribute("href",own.url);
+ }
+ const readableCard=platformReadableCopy(card);
+ const author=platformText(readableCard.querySelector(".info .title")),time=platformText(readableCard.querySelector(".info .subtitle"));
+ const markdown=platformHtmlMarkdown(clean,target.url);
+ if (!markdown) return {ok:false,reason:"unreadable"};
+ const title=platformText(text).slice(0,120) || author || "Jike";
+ const created=typeof post?.createdAt === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(post.createdAt) ? post.createdAt : "";
+ return {ok:true,clip:{...target,title,author:author || undefined,publishedAt:created ? {value:created,precision:"datetime"} : time ? {value:time,precision:"relative"} : undefined,markdown,tags:["web-clip","jike"],completeness:"complete"}};
+};
+export const jikeExpandButton = (doc: Document, card: Element | null = doc.querySelector(".post-page .post-wrap")): HTMLElement | null => Array.from(card?.querySelectorAll<HTMLElement>('.text button,.text [role="button"]') || [])
+ .find(n=>/^(展开|展开全文|展开全部|显示全文)$/.test(platformText(platformReadableCopy(n)))) || null;
diff --git a/apps/extension/src/medium-content.ts b/apps/extension/src/medium-content.ts
index ec8d9490..02a7efa2 100644
--- a/apps/extension/src/medium-content.ts
+++ b/apps/extension/src/medium-content.ts
@@ -1,15 +1,18 @@
import { articlePlatform } from "./article-platform";
+import { articleMetadata, type ArticleContent } from "./article-metadata";
+import { platformReadableCopy, platformText } from "./platform-clip";
/** Extract only rendered Medium story blocks; never fetch paywalled content. */
-export const mediumContent = (doc: Document, pageUrl: string): { title: string; body: Element } | null => {
+export const mediumContent = (doc: Document, pageUrl: string): ArticleContent | null => {
if (articlePlatform(doc,pageUrl) !== "Medium") return null;
- const article = doc.querySelector('article');
+ const liveArticle = doc.querySelector('article');
+ const article = liveArticle ? platformReadableCopy(liveArticle) : null;
const title = article?.querySelector('h1[data-selectable-paragraph]');
if (!article || !title?.textContent?.trim()) return null;
const body = doc.createElement('div');
const chosen = new Set<Element>();
- for (const block of Array.from(article.querySelectorAll('[data-selectable-paragraph], figure, pre'))) {
+ for (const block of Array.from(article.querySelectorAll('[data-selectable-paragraph], figure, pre, table'))) {
if (block === title || block.closest('[hidden], [aria-hidden="true"]')) continue;
- const container = block.closest('figure, pre, ul, ol, blockquote');
+ const container = block.closest('figure, pre, ul, ol, blockquote, table');
const source = container && article.contains(container) ? container : block;
if (chosen.has(source) || Array.from(chosen).some((parent)=>parent.contains(source))) continue;
chosen.add(source);
@@ -19,5 +22,6 @@ export const mediumContent = (doc: Document, pageUrl: string): { title: string;
copy.querySelectorAll('figure [role="button"] > span, [role="button"] > span').forEach((node)=>node.remove());
body.appendChild(copy);
}
- return body.textContent?.trim() || body.querySelector('img') ? { title:title.textContent.trim(),body } : null;
+ const name=platformText(title);
+ return body.textContent?.trim() || body.querySelector('img') ? {title:name,body,...articleMetadata(doc,pageUrl,name,article!)} : null;
};
diff --git a/apps/extension/src/page-images.ts b/apps/extension/src/page-images.ts
index b10de878..7280fe75 100644
--- a/apps/extension/src/page-images.ts
+++ b/apps/extension/src/page-images.ts
@@ -1,4 +1,6 @@
-import { Lexer, marked, type Token } from "marked";
+import { fromMarkdown } from "mdast-util-from-markdown";
+import { gfmFromMarkdown } from "mdast-util-gfm";
+import { gfm } from "micromark-extension-gfm";
import { filenameForImage, MAX_IMAGE_BYTES, type ImageNoteClient, type StoredImage } from "./image-clip";
// A long article can reference hundreds of images. Keep the extra uploads after
@@ -28,62 +30,35 @@ type LocatedImage = {
end: number;
};
-// Code blocks, code spans and raw HTML can contain text that looks like an
-// image; they are located only so the search below steps over them.
-const STEPPED_OVER_TOKENS = new Set(["code", "codespan", "html"]);
-
-const escapeRegExp = (value: string) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-
-// Tokens nested in list items and block quotes are lexed without their
-// indentation or `>` markers, so their raw text may not appear verbatim.
-const findRaw = (markdown: string, raw: string, from: number) => {
- const exact = markdown.indexOf(raw, from);
- if (exact !== -1) return { start: exact, end: exact + raw.length };
- const pattern = new RegExp(raw.split("\n").map(escapeRegExp).join("\\n[ \\t>]*"), "g");
- pattern.lastIndex = from;
- const match = pattern.exec(markdown);
- return match ? { start: match.index, end: match.index + match[0].length } : null;
-};
-
-const imageLabelEnd = (source: string) => {
- let depth = 0;
- for (let index = 1; index < source.length; index += 1) {
- const char = source[index];
- if (char === "\\") {
- index += 1;
- } else if (char === "[") {
- depth += 1;
- } else if (char === "]") {
- depth -= 1;
- if (depth === 0) return index + 1;
- }
- }
- return -1;
-};
-
const locatePageImages = (markdown: string): LocatedImage[] => {
+ const labelEnds=new Map<number,number>();
+ const tree=fromMarkdown(markdown,{extensions:[gfm()],mdastExtensions:[gfmFromMarkdown(),{
+ exit:{labelMarker(token){
+ const node=this.stack[this.stack.length-2];
+ if(node?.type === "image" && node.position?.start.offset !== undefined) labelEnds.set(node.position.start.offset,token.end.offset);
+ }},
+ }]});
+ type Node = {type: string; children?: Node[]; identifier?: string; url?: string; title?: string | null; position?: {start: {offset?: number}; end: {offset?: number}}};
+ const definitions=new Map<string,{url: string; title?: string | null}>();
+ // Definitions are document-scoped; CommonMark uses the first occurrence.
+ const collect=(node: Node)=>{
+ if(node.type === "definition" && node.identifier && node.url && !definitions.has(node.identifier)) definitions.set(node.identifier,{url:node.url,title:node.title});
+ for(const child of node.children || []) collect(child);
+ };
+ collect(tree);
const located: LocatedImage[] = [];
- let cursor = 0;
- let lost = false;
- marked.walkTokens(new Lexer().lex(markdown), (token: Token) => {
- if (lost || (token.type !== "image" && !STEPPED_OVER_TOKENS.has(token.type))) return;
- const range = findRaw(markdown, token.raw, cursor);
- if (!range) {
- // Stop rather than guess: images after this point keep their addresses.
- lost = true;
- return;
+ const visit=(node: Node)=>{
+ if(node.type === "image" || node.type === "imageReference") {
+ const image=node.type === "image" ? node : definitions.get(node.identifier || "");
+ const start=node.position?.start.offset,end=node.position?.end.offset;
+ if(image?.url && start !== undefined && end !== undefined) {
+ const labelEnd=labelEnds.get(start);
+ if(labelEnd !== undefined) located.push({href:image.url,title:image.title ?? null,labelEnd,end});
+ }
}
- cursor = range.end;
- if (token.type !== "image") return;
- const labelEnd = imageLabelEnd(markdown.slice(range.start, range.end));
- if (labelEnd < 0) return;
- located.push({
- href: token.href,
- title: token.title ?? null,
- labelEnd: range.start + labelEnd,
- end: range.end,
- });
- });
+ for(const child of node.children || []) visit(child);
+ };
+ visit(tree);
return located;
};
@@ -120,7 +95,7 @@ export const replacePageImageUrls = (
for (const image of locatePageImages(markdown).reverse()) {
const resourceId = resources.get(image.href);
if (!resourceId) continue;
- const title = image.title ? ` "${image.title.replace(/["\\]/g, "\\$&")}"` : "";
+ const title = image.title ? ` "${image.title.replace(/&/g, "&amp;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\|/g, "&#124;").replace(/["\\]/g, "\\$&")}"` : "";
result = `${result.slice(0, image.labelEnd)}(/api/v1/resources/${encodeURIComponent(resourceId)}/blob${title})${result.slice(image.end)}`;
}
return result;
diff --git a/apps/extension/src/platform-clip.ts b/apps/extension/src/platform-clip.ts
index f74b2ab6..48a0b01c 100644
--- a/apps/extension/src/platform-clip.ts
+++ b/apps/extension/src/platform-clip.ts
@@ -1,14 +1,16 @@
import { clipDateTimeText } from "./clip-time";
export { clipDateTimeText } from "./clip-time";
import TurndownService from "turndown";
+import { tables } from "@joplin/turndown-plugin-gfm";
-export type ClipPlatform = "hacker-news" | "v2ex" | "xiaoyuzhou" | "facebook" | "instagram" | "linkedin" | "threads" | "bluesky" | "substack-note";
+export type ClipPlatform = "hacker-news" | "v2ex" | "xiaoyuzhou" | "boss" | "xueqiu" | "wechat" | "jike" | "sspai" | "juejin" | "douban" | "facebook" | "instagram" | "linkedin" | "threads" | "bluesky" | "substack-note";
export type PlatformTarget = { platform: ClipPlatform; id: string; url: string };
export type PublishedTime = { value: string; precision: "datetime" | "date" | "relative" };
export type PlatformClip = PlatformTarget & {
title: string;
markdown: string;
author?: string;
+ authorHeadline?: string;
publishedAt?: PublishedTime;
tags: string[];
completeness: "complete" | "no-shownotes";
@@ -30,6 +32,13 @@ export const PLATFORM_MENUS = [
{ id: "save-hacker-news", title: "saveHackerNewsToEdgeEver", patterns: ["https://news.ycombinator.com/item?*"] },
{ id: "save-v2ex", title: "saveV2exToEdgeEver", patterns: ["https://www.v2ex.com/t/*", "https://v2ex.com/t/*"] },
{ id: "save-xiaoyuzhou", title: "saveXiaoyuzhouToEdgeEver", patterns: ["https://www.xiaoyuzhoufm.com/episode/*"] },
+ { id: "save-boss", title: "saveBossToEdgeEver", patterns: ["https://www.zhipin.com/job_detail/*", "https://zhipin.com/job_detail/*"] },
+ { id: "save-xueqiu", title: "saveXueqiuToEdgeEver", patterns: ["https://xueqiu.com/*", "https://www.xueqiu.com/*"] },
+ { id: "save-wechat", title: "saveWechatToEdgeEver", patterns: ["https://mp.weixin.qq.com/s", "https://mp.weixin.qq.com/s?*", "https://mp.weixin.qq.com/s/*"] },
+ { id: "save-jike", title: "saveJikeToEdgeEver", patterns: ["https://m.okjike.com/originalPosts/*", "https://m.okjike.com/topics/*", "https://web.okjike.com/*"] },
+ { id: "save-sspai", title: "saveSspaiToEdgeEver", patterns: ["https://sspai.com/post/*", "https://www.sspai.com/post/*"] },
+ { id: "save-juejin", title: "saveJuejinToEdgeEver", patterns: ["https://juejin.cn/post/*"] },
+ { id: "save-douban", title: "saveDoubanToEdgeEver", patterns: ["https://book.douban.com/review/*", "https://movie.douban.com/review/*", "https://music.douban.com/review/*", "https://book.douban.com/comment/*", "https://movie.douban.com/comment/*", "https://music.douban.com/comment/*", "https://www.douban.com/note/*", "https://book.douban.com/subject/*/comments*", "https://movie.douban.com/subject/*/comments*", "https://music.douban.com/subject/*/comments*"] },
{ id: "save-facebook", title: "saveFacebookToEdgeEver", patterns: ["https://www.facebook.com/*", "https://facebook.com/*", "https://m.facebook.com/*"] },
{ id: "save-instagram", title: "saveInstagramToEdgeEver", patterns: ["https://www.instagram.com/*", "https://instagram.com/*"] },
{ id: "save-linkedin", title: "saveLinkedinToEdgeEver", patterns: ["https://www.linkedin.com/*", "https://linkedin.com/*"] },
@@ -55,6 +64,48 @@ export const platformTarget = (pageUrl: string): PlatformTarget | null => {
const id = /^\/episode\/([a-f0-9]{24})\/?$/.exec(url.pathname)?.[1];
return id ? { platform: "xiaoyuzhou", id, url: `https://www.xiaoyuzhoufm.com/episode/${id}` } : null;
}
+ if (url.hostname === "www.zhipin.com" || url.hostname === "zhipin.com") {
+ const id = /^\/job_detail\/([a-zA-Z0-9_~\-]+)\.html$/.exec(url.pathname)?.[1];
+ return id ? { platform: "boss", id, url: `https://www.zhipin.com/job_detail/${id}.html` } : null;
+ }
+ if (url.hostname === "xueqiu.com" || url.hostname === "www.xueqiu.com") {
+ const match = /^\/([1-9]\d*)\/([1-9]\d*)\/?$/.exec(url.pathname);
+ return match ? { platform: "xueqiu", id: `${match[1]}/${match[2]}`, url: `https://xueqiu.com/${match[1]}/${match[2]}` } : null;
+ }
+ if (url.hostname === "mp.weixin.qq.com") {
+ const shortId = /^\/s\/([a-zA-Z0-9_-]+)\/?$/.exec(url.pathname)?.[1];
+ if (shortId) return { platform: "wechat", id: shortId, url: `https://mp.weixin.qq.com/s/${shortId}` };
+ if (url.pathname === "/s") {
+ const names = ["__biz", "mid", "idx"], values = names.map((name) => url.searchParams.get(name));
+ if (names.some((name) => url.searchParams.getAll(name).length !== 1) || values.some((v) => !v)
+ || !/^[1-9]\d*$/.test(values[1]!) || !/^[1-9]\d*$/.test(values[2]!)) return null;
+ const canonical = new URL("https://mp.weixin.qq.com/s");
+ names.forEach((name, i) => canonical.searchParams.set(name, values[i]!));
+ const signatures = url.searchParams.getAll("sn");
+ if (signatures.length > 1) return null;
+ if (signatures[0]) canonical.searchParams.set("sn", signatures[0]);
+ return { platform: "wechat", id: `${values[0]}/${values[1]}/${values[2]}`, url: canonical.href };
+ }
+ }
+ if (url.hostname === "m.okjike.com" || url.hostname === "web.okjike.com") {
+ const id = (url.hostname === "m.okjike.com" ? /^\/originalPosts\/([a-f0-9]{24})\/?$/ : /^\/originalPost\/([a-f0-9]{24})\/?$/).exec(url.pathname)?.[1];
+ if (id) return { platform: "jike", id, url: `https://m.okjike.com/originalPosts/${id}` };
+ }
+ if (url.hostname === "sspai.com" || url.hostname === "www.sspai.com" || url.hostname === "juejin.cn") {
+ const id = /^\/post\/([1-9]\d*)\/?$/.exec(url.pathname)?.[1];
+ if (id) {
+ const platform = url.hostname === "juejin.cn" ? "juejin" : "sspai";
+ return { platform, id, url: `https://${platform === "juejin" ? "juejin.cn" : "sspai.com"}/post/${id}` };
+ }
+ }
+ if (["book.douban.com", "movie.douban.com", "music.douban.com"].includes(url.hostname)) {
+ const detail = /^\/(review|comment)\/([1-9]\d*)\/?$/.exec(url.pathname);
+ if (detail) return { platform: "douban", id: `${url.hostname.split(".")[0]}/${detail[1]}/${detail[2]}`, url: `https://${url.hostname}/${detail[1]}/${detail[2]}/` };
+ }
+ if (url.hostname === "www.douban.com") {
+ const note = /^\/note\/([1-9]\d*)\/?$/.exec(url.pathname)?.[1];
+ if (note) return { platform: "douban", id: `note/${note}`, url: `https://www.douban.com/note/${note}/` };
+ }
if (url.hostname === "substack.com" || url.hostname === "www.substack.com") {
const match = /^\/@([a-zA-Z0-9_-]+)\/note\/(c-[1-9]\d*)\/?$/.exec(url.pathname);
if (match) return { platform: "substack-note", id: `${match[1].toLowerCase()}/${match[2]}`, url: `https://substack.com/@${match[1].toLowerCase()}/note/${match[2]}` };
@@ -83,9 +134,9 @@ export const platformTarget = (pageUrl: string): PlatformTarget | null => {
}
}
if (["linkedin.com", "www.linkedin.com"].includes(url.hostname)) {
- const match = /^\/feed\/update\/urn:li:(activity|ugcPost):([1-9]\d*)\/?$/.exec(url.pathname)
- || /^\/posts\/[a-zA-Z0-9_-]+-(activity|ugcPost)-([1-9]\d*)-[a-zA-Z0-9_-]+\/?$/.exec(url.pathname);
- if (match) return { platform: "linkedin", id: match[1] === "activity" ? match[2] : `ugcPost:${match[2]}`,
+ const match = /^\/feed\/update\/urn:li:(activity|ugcPost|share):([1-9]\d*)\/?$/.exec(url.pathname)
+ || /^\/posts\/[a-zA-Z0-9_-]+-(activity|ugcPost|share)-([1-9]\d*)-[a-zA-Z0-9_-]+\/?$/.exec(url.pathname);
+ if (match) return { platform: "linkedin", id: match[1] === "activity" ? match[2] : `${match[1]}:${match[2]}`,
url: `https://www.linkedin.com/feed/update/urn:li:${match[1]}:${match[2]}/` };
}
return null;
@@ -100,10 +151,46 @@ export const socialPlatform = (pageUrl: string): ClipPlatform | null => {
if (["www.linkedin.com", "linkedin.com"].includes(url.hostname)) return "linkedin";
if (["www.threads.com", "threads.com", "www.threads.net", "threads.net"].includes(url.hostname)) return "threads";
if (url.hostname === "bsky.app") return "bluesky";
+ if (url.hostname === "xueqiu.com" || url.hostname === "www.xueqiu.com") return "xueqiu";
+ if (url.hostname === "web.okjike.com" || (url.hostname === "m.okjike.com" && /^\/topics\/[a-f0-9]{24}\/?$/.test(url.pathname))) return "jike";
+ if (["book.douban.com","movie.douban.com","music.douban.com"].includes(url.hostname) && /^\/subject\/[1-9]\d*\/comments\/?$/.test(url.pathname)) return "douban";
return null;
};
export const platformText = (node: Node | null | undefined) => (node?.textContent ?? "").replace(/\s+/g, " ").trim();
+/** New vertical readers must not restore content hidden by a site's CSS. */
+export const platformElementHidden = (node: Element): boolean => {
+ // Unlike display:none, visibility can be restored by a descendant. The
+ // browser's computed value already includes inheritance and overrides.
+ let visibility = node.ownerDocument.defaultView?.getComputedStyle?.(node).visibility;
+ for (let current: Element | null = node; current; current = current.parentElement) {
+ if (current.matches('[hidden], [aria-hidden="true"]')) return true;
+ const style = current.ownerDocument.defaultView?.getComputedStyle?.(current)
+ || (current as HTMLElement).style;
+ if (style?.display === "none") return true;
+ // Domino has no computed styles; use the closest explicit inline value.
+ if (!visibility && style?.visibility && style.visibility !== "inherit") visibility = style.visibility;
+ }
+ return visibility === "hidden" || visibility === "collapse";
+};
+export const platformReadableCopy = (node: Element): Element => {
+ const copy = node.cloneNode(true) as Element;
+ const prune = (original: Element, cloned: Element): boolean => {
+ const visible = !platformElementHidden(original);
+ const children = Array.from(original.childNodes), clones = Array.from(cloned.childNodes);
+ let visibleDescendant = false;
+ children.forEach((child, index) => {
+ if (child.nodeType === 1) {
+ const retained = prune(child as Element, clones[index] as Element);
+ if (retained) visibleDescendant = true;
+ else cloned.removeChild(clones[index]);
+ } else if (!visible) cloned.removeChild(clones[index]);
+ });
+ return visible || visibleDescendant;
+ };
+ prune(node, copy);
+ return copy;
+};
export const markdownText = (value: string) => value.replace(/[\r\n]+/g, " ").replace(/([\\`*_{}[\]<>])/g, "\\$1");
export const markdownUrl = (value: string) => value.replace(/[\\ ()<>]/g, (char) => encodeURIComponent(char).replace("(", "%28").replace(")", "%29"));
@@ -135,8 +222,8 @@ export const publishedTimeText = (time: PublishedTime, relativeLabel: string) =>
time.precision === "relative" ? `${time.value} (${relativeLabel})`
: time.precision === "datetime" ? clipDateTimeText(time.value) : time.value;
-/** Converts a detached copy only. Links and images never keep active protocols. */
-export const platformHtmlMarkdown = (body: Element | DocumentFragment, baseUrl: string): string => {
+/** Sanitizes a detached copy. Links and images never keep active protocols. */
+export const platformHtmlCopy = (body: Element | DocumentFragment, baseUrl: string): Element | DocumentFragment => {
const copy = body.cloneNode(true) as Element | DocumentFragment;
Array.from(copy.querySelectorAll("script, style, noscript, template, iframe, object, embed, canvas, svg, video, audio, source, link, meta, form, input, button, textarea, select, [hidden], [aria-hidden='true']"))
.forEach((node) => node.remove());
@@ -156,7 +243,76 @@ export const platformHtmlMarkdown = (body: Element | DocumentFragment, baseUrl:
else img.remove();
img.removeAttribute("srcset");
}
- const turndown = new TurndownService({ bulletListMarker: "-", codeBlockStyle: "fenced", headingStyle: "atx", linkStyle: "inlined" });
+ return copy;
+};
+
+export const platformHtmlMarkdown = (body: Element | DocumentFragment, baseUrl: string): string => {
+ const copy = body.ownerDocument.createElement("div");
+ copy.appendChild(platformHtmlCopy(body, baseUrl));
+ for(const table of Array.from(copy.querySelectorAll("table"))) {
+ const head=Array.from(table.children).find(node=>node.tagName === "THEAD");
+ // Expand spans on the detached copy so cells keep their columns. Vertical
+ // spans repeat their value within the original HTML row group; horizontal
+ // spans retain the value followed by empty cells, as GFM has no merges.
+ if(table.querySelector("[rowspan],[colspan]")) {
+ const rows=Array.from(table.querySelectorAll("tr")).filter(row=>row.closest("table") === table);
+ const grid: Element[][]=rows.map(()=>[]);
+ rows.forEach((row,index)=>{
+ let column=0;
+ let groupEnd=index+1;
+ while(groupEnd<rows.length && rows[groupEnd].parentElement === row.parentElement) groupEnd++;
+ for(const cell of Array.from(row.children).filter(node=>/^(TD|TH)$/.test(node.tagName))) {
+ while(grid[index][column] !== undefined) column++;
+ const width=(cell as HTMLTableCellElement).colSpan || 1;
+ const height=cell.getAttribute("rowspan") === "0" ? groupEnd-index : (cell as HTMLTableCellElement).rowSpan || 1;
+ for(let next=index;next<Math.min(groupEnd,index+height);next++) {
+ grid[next][column]=next===index ? cell : cell.cloneNode(true) as Element;
+ grid[next][column].removeAttribute("rowspan");grid[next][column].removeAttribute("colspan");
+ for(let offset=1;offset<width;offset++) grid[next][column+offset]=body.ownerDocument.createElement(cell.tagName.toLowerCase());
+ }
+ column+=width;
+ }
+ });
+ rows.forEach((row,index)=>{
+ while(row.firstChild) row.removeChild(row.firstChild);
+ for(let column=0;column<grid[index].length;column++) {
+ row.appendChild(grid[index][column] || body.ownerDocument.createElement("td"));
+ }
+ });
+ }
+ // GFM has one header row; additional HTML header rows remain data.
+ if(head) {
+ let previous: Element=head;
+ for(const row of Array.from(head.children).slice(1)) {table.insertBefore(row,previous.nextSibling);previous=row;}
+ }
+ }
+ // The table plugin reads captions as raw text. Convert them as normal rich
+ // paragraphs so literal HTML stays escaped and links/formatting survive.
+ for (const caption of Array.from(copy.querySelectorAll("table > caption"))) {
+ const paragraph=body.ownerDocument.createElement("p");
+ while(caption.firstChild) paragraph.appendChild(caption.firstChild);
+ const table=caption.parentElement!;
+ table.parentNode!.insertBefore(paragraph,table);
+ caption.remove();
+ }
+ // EdgeEver stores Markdown, so Joplin's HTML fallback would display source
+ // text. Keep the grid and use inline Markdown for rich cell contents.
+ const options: TurndownService.Options & {preserveTableHtml: boolean} = { bulletListMarker: "-", codeBlockStyle: "fenced", headingStyle: "atx", linkStyle: "inlined", preserveTableHtml:false };
+ const turndown = new TurndownService(options);
+ turndown.use(tables);
+ // Escape literal text at Turndown's text boundary. Code blocks keep their
+ // exact bytes, and a pasted HTML tag cannot become a note element.
+ const escape=turndown.escape.bind(turndown);
+ turndown.escape=(value)=>escape(value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"));
+ const oddPipeBackslashes = (value: string) => Array.from(value.matchAll(/(\\+)\|/g)).some(match => match[1].length % 2 === 1);
+ // GFM code spans cannot encode an odd backslash run before a pipe without
+ // changing bytes or columns. Keep that fragment as escaped text instead.
+ const tableCodeText = (value: string) => turndown.escape(value).replace(/^[ \t]+|[ \t]+$/g, space =>
+ space.replace(/ /g, "&#32;").replace(/\t/g, "&#9;"));
+ turndown.addRule("platformTableCode", {
+ filter: node => node.nodeName === "CODE" && !!(node as HTMLElement).closest("td,th") && oddPipeBackslashes(node.textContent || ""),
+ replacement: (_content, node) => tableCodeText(node.textContent || ""),
+ });
turndown.addRule("platformCode", {
filter: "pre",
replacement: (_content, node) => {
@@ -164,6 +320,13 @@ export const platformHtmlMarkdown = (body: Element | DocumentFragment, baseUrl:
const code = element.querySelector("code");
const language = /(?:^|\s)(?:language|lang)-([a-zA-Z0-9_+-]+)(?=\s|$)/.exec(`${code?.className ?? ""} ${element.className}`)?.[1] || "";
const text = (code ?? element).textContent?.replace(/\n$/, "") || "";
+ if(element.closest("td,th")) return text.split("\n").map(line=>{
+ if(!line) return "";
+ if(oddPipeBackslashes(line)) return tableCodeText(line);
+ const fence="`".repeat(Math.max(1,...[...line.matchAll(/`+/g)].map(match=>match[0].length+1)));
+ const pad=/^`|`$|^ .*?[^ ].* $/.test(line) ? " " : "";
+ return `${fence}${pad}${line}${pad}${fence}`;
+ }).join("\n");
const fence = "`".repeat(Math.max(3, ...[...text.matchAll(/`+/g)].map((match) => match[0].length + 1)));
return `\n\n${fence}${language}\n${text}\n${fence}\n\n`;
},
@@ -179,7 +342,13 @@ export const isPlatformClip = (value: unknown, expected: PlatformTarget): value
&& typeof clip.title === "string" && !!clip.title.trim() && clip.title.length <= 10_000
&& typeof clip.markdown === "string" && !!clip.markdown.trim() && clip.markdown.length <= 2_000_000
&& (clip.author === undefined || typeof clip.author === "string")
+ && (clip.authorHeadline === undefined || typeof clip.authorHeadline === "string")
&& (!time || (typeof time.value === "string" && ["datetime", "date", "relative"].includes(time.precision)))
- && Array.isArray(clip.tags) && clip.tags.length === 2 && clip.tags[0] === "web-clip" && clip.tags[1] === expected.platform
+ && Array.isArray(clip.tags) && clip.tags[0] === "web-clip" && clip.tags[1] === expected.platform
+ && (expected.platform === "xueqiu"
+ ? clip.tags.length >= 3 && clip.tags.length <= 24 && clip.tags[2] === "投资"
+ && clip.tags.slice(3).every((tag) => typeof tag === "string" && /^(?:[A-Z][A-Z0-9.-]*|\d{5})$/.test(tag))
+ && new Set(clip.tags).size === clip.tags.length
+ : clip.tags.length === 2)
&& (clip.completeness === "complete" || (clip.platform === "xiaoyuzhou" && clip.completeness === "no-shownotes"));
};
diff --git a/apps/extension/src/platform-image-requests.ts b/apps/extension/src/platform-image-requests.ts
new file mode 100644
index 00000000..5fa65935
--- /dev/null
+++ b/apps/extension/src/platform-image-requests.ts
@@ -0,0 +1,25 @@
+const IMAGE_SOURCES = [
+ { id: 1, pattern: "^https://img[0-9]\\.doubanio\\.com/view/", referer: "https://www.douban.com/" },
+ { id: 2, pattern: "^https://cdnfile\\.sspai\\.com/", referer: "https://sspai.com/" },
+];
+
+export const isPlatformImageUrl = (url: string) => IMAGE_SOURCES.some(source => new RegExp(source.pattern).test(url));
+
+/** Affect only this extension's own image GETs. Session rules disappear when
+ * the browser closes and are installed again as needed. */
+export const configurePlatformImageRequests = async () => {
+ const initiator = new URL(chrome.runtime.getURL("/")).hostname;
+ await chrome.declarativeNetRequest.updateSessionRules({
+ removeRuleIds: IMAGE_SOURCES.map(source => source.id),
+ addRules: IMAGE_SOURCES.map(source => ({
+ id: source.id, priority: 1,
+ action: { type: "modifyHeaders", requestHeaders: [{ header: "Referer", operation: "set", value: source.referer }] },
+ condition: {
+ regexFilter: source.pattern,
+ initiatorDomains: [initiator],
+ resourceTypes: ["xmlhttprequest"],
+ requestMethods: ["get"],
+ },
+ })),
+ });
+};
diff --git a/apps/extension/src/selection-clip.ts b/apps/extension/src/selection-clip.ts
index a847b8a8..3d705279 100644
--- a/apps/extension/src/selection-clip.ts
+++ b/apps/extension/src/selection-clip.ts
@@ -1,3 +1,9 @@
+/** Plain-text fallback when the clicked selection no longer has matching DOM. */
+export const selectionTextMarkdown = (value: string) => value
+ // Entities keep Markdown, HTML and automatic links from reinterpreting literal text.
+ .replace(/[!-/:-@\[-`{-~]/g, (character) => `&#${character.charCodeAt(0)};`)
+ .replace(/^[ \t]+/gm, (indent) => indent.replace(/ /g, "&#32;").replace(/\t/g, "&#9;"));
+
const escapeMarkdownLabel = (value: string) =>
value.replace(/[\r\n]+/g, " ").replace(/\\/g, "\\\\").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
@@ -17,7 +23,7 @@ export const selectionNoteMarkdown = (input: {
sourceLabel: string;
capturedAtLabel: string;
}) => {
- const body = input.markdown.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
+ const body = input.markdown.replace(/\r\n/g, "\n").trim();
const footer = [
`${input.sourceLabel}: [${escapeMarkdownLabel(input.pageUrl)}](${markdownDestination(input.pageUrl)})`,
`${input.capturedAtLabel}: ${input.capturedAt}`,
diff --git a/apps/extension/src/social-clip.ts b/apps/extension/src/social-clip.ts
index a67ce884..87e20745 100644
--- a/apps/extension/src/social-clip.ts
+++ b/apps/extension/src/social-clip.ts
@@ -1,5 +1,5 @@
import {
- markdownText, markdownUrl, platformHtmlMarkdown, platformTarget, platformText,
+ markdownText, markdownUrl, platformHtmlMarkdown, platformReadableCopy, platformElementHidden, platformTarget, platformText,
publishedTime, safePlatformUrl, socialPlatform, type PlatformRead, type PlatformTarget, type PublishedTime,
} from "./platform-clip";
@@ -42,7 +42,7 @@ const paragraphs = (doc: Document, value: string) => {
return body;
};
const plainSocialMarkdown = (doc: Document, value: string, base: string) =>
- platformHtmlMarkdown(paragraphs(doc,value),base).replace(/[<>]/g,(char)=>`\\${char}`);
+ platformHtmlMarkdown(paragraphs(doc,value),base);
/** Normalize text newlines in a detached body before shared Markdown conversion. */
const socialBodyMarkdown = (doc: Document, body: Element, base: string) => {
const visit = (node: Node) => {
@@ -88,6 +88,7 @@ const result = (target: PlatformTarget, markdown: string, author?: string, time?
};
export const ownPostLinks = (card: Element, platform: string) => Array.from(card.querySelectorAll("a[href]")).filter((link) => {
+ if (platformElementHidden(link)) return false;
if (platform === "facebook") return link.closest('[role="article"], article') === card
&& !link.closest('[data-ad-preview="message"], [data-ad-comet-preview="message"]');
if (platform === "bluesky") return link.closest('[data-testid^="postThreadItem-by-"], [data-testid^="feedItem-by-"]') === card
@@ -101,7 +102,7 @@ export const linkedinCardTarget = (card: Element): PlatformTarget | null => {
const target = platformTarget(`https://www.linkedin.com/feed/update/${card.getAttribute(key) || ""}/`);
if (target) return target;
}
- // The signed-in SDUI card exposes its UGC identity in the main commentary,
+ // The signed-in SDUI card exposes its post identity in the main commentary,
// not an activity data attribute. Never use comment or nested card IDs.
for (const commentary of Array.from(card.querySelectorAll('[id^="translatable-commentary-"]'))) {
if (commentary.closest(LINKEDIN_CARD_SELECTOR) !== card) continue;
@@ -109,6 +110,8 @@ export const linkedinCardTarget = (card: Element): PlatformTarget | null => {
if (!identity.includes("contentUrnCommentUrn=null")) continue;
const id = /userGeneratedContentId=([1-9]\d*)\)/.exec(identity)?.[1];
if (id) return platformTarget(`https://www.linkedin.com/feed/update/urn:li:ugcPost:${id}/`);
+ const shareId = /shareId=([1-9]\d*)\)/.exec(identity)?.[1];
+ if (shareId) return platformTarget(`https://www.linkedin.com/feed/update/urn:li:share:${shareId}/`);
}
return null;
};
@@ -153,32 +156,37 @@ const blueskyImages = (card: Element, base: string) => Array.from(card.querySele
export const readBluesky = (doc: Document, target: PlatformTarget): PlatformRead => {
const entry = pageRecords(doc, target.id.split("/").pop()!, "application/ld+json")
.find((value) => value["@type"] === "DiscussionForumPosting" && sameTarget(value.url, target));
- const card = socialPostCard(doc, target);
- if (!card || card.closest('[hidden], [aria-hidden="true"]')) return { ok: false, reason: "unreadable" };
- const post = card.querySelector('[data-testid="contentHider-post"]') || card;
- const body = post.querySelector('[data-testid="postText"], [data-word-wrap="1"]');
+ const liveCard = socialPostCard(doc, target);
+ if (!liveCard) return { ok: false, reason: "unreadable" };
+ const card = platformReadableCopy(liveCard);
+ const owns = (node: Element) => node.closest('[data-testid^="postThreadItem-by-"], [data-testid^="feedItem-by-"]') === card;
+ const post = Array.from(card.querySelectorAll('[data-testid="contentHider-post"]')).find(owns) || card;
+ const body = Array.from(post.querySelectorAll('[data-testid="postText"], [data-word-wrap="1"]'))
+ .find((node)=>owns(node) && !node.closest(BLUESKY_QUOTE_SELECTOR));
if (post.closest('[hidden], [aria-hidden="true"]') || body?.closest('[hidden], [aria-hidden="true"]')) return {ok:false,reason:"unreadable"};
const bodyCopy = body?.cloneNode(true) as Element | undefined;
bodyCopy?.querySelectorAll('script, style, noscript, template, [hidden], [aria-hidden="true"]')
.forEach((node)=>node.remove());
// Rendered text owns the links and readability; SEO text must not restore
// descendants hidden by the current page, including in the note title.
- const content = bodyCopy ? bodyCopy.textContent || "" : text(entry?.text);
+ const content = bodyCopy?.textContent || "";
+ if (!content.trim() && text(entry?.text).trim()) return {ok:false,reason:"unreadable"};
const copy = post.cloneNode(true) as Element;
copy.querySelectorAll('button, [data-testid="userAvatarImage"], svg').forEach((node)=> {
if(node.tagName.toLowerCase() === "button" && node.querySelector('img[src*="/img/feed_"]')) node.replaceWith(...Array.from(node.childNodes));
else node.remove();
});
- const parts = [bodyCopy ? socialBodyMarkdown(doc,bodyCopy,target.url).replace(/[<>]/g,(char)=>`\\${char}`)
+ const parts = [bodyCopy ? socialBodyMarkdown(doc,bodyCopy,target.url)
: content ? plainSocialMarkdown(doc,content,target.url) : ""];
// Feed cards have no post SEO data; their exact timestamp permalink and
// visible body are sufficient. A collection count still guards hidden images.
const visibleImages=blueskyImages(post,target.url);
const images = Array.isArray(entry?.image) ? entry.image : [];
if (images.length) for(const url of images) {
- const img=Array.from(post.querySelectorAll("img")).find((item)=>item.getAttribute("src")===url);
- parts.push(imageMarkdown(blueskyFullsizeUrl(text(url)),img?.getAttribute("alt"),target.url));
- } else parts.push(...visibleImages);
+ const img=Array.from(post.querySelectorAll("img")).find((item)=>blueskyFullsizeUrl(item.getAttribute("src") || "")===blueskyFullsizeUrl(text(url)) && !item.closest(BLUESKY_QUOTE_SELECTOR));
+ if (!img || !imageMarkdown(url,"",target.url)) return {ok:false,reason:"incomplete"};
+ }
+ parts.push(...visibleImages);
for (const quote of Array.from(copy.querySelectorAll(BLUESKY_QUOTE_SELECTOR))) {
for (const img of Array.from(quote.querySelectorAll("img[src]"))) img.setAttribute("src",blueskyFullsizeUrl(img.getAttribute("src") || ""));
parts.push(platformHtmlMarkdown(quote,target.url));
@@ -225,7 +233,7 @@ const readableMetaCard = (doc: Document, target: PlatformTarget, captions: strin
if (!sameTarget(postLinkUrl(link,target.url),target)) continue;
const card = metaPostCard(link,target.platform,target.url);
if (!card) continue;
- const copy=card.cloneNode(true) as Element;
+ const copy=platformReadableCopy(card);
copy.querySelectorAll("script, style, template, article, [role='article'], [hidden], [aria-hidden='true']").forEach((node)=>node.remove());
// Threads shortens visible URL labels; its card's href retains the destination.
if (target.platform === 'threads') for (const a of Array.from(copy.querySelectorAll('a[href]'))) {
@@ -242,7 +250,6 @@ const readableMetaCard = (doc: Document, target: PlatformTarget, captions: strin
const metaMedia = (doc: Document, target: PlatformTarget) => {
const code = target.id.split("/").pop()!;
return pageRecords(doc, code).find((item) => item.code === code
- && record(item.user)?.username && (item.taken_at !== undefined)
&& (item.caption !== undefined || item.image_versions2 !== undefined || item.carousel_media !== undefined));
};
const mediaImages = (item: RecordValue, base: string): string[] | null => {
@@ -268,7 +275,7 @@ export const readMetaSocial = (doc: Document, target: PlatformTarget): PlatformR
const media = metaMedia(doc, target);
if (!media) return { ok: false, reason: "unreadable" };
const username = text(record(media.user)?.username);
- if (target.platform === "threads" && username.toLowerCase() !== target.id.split("/")[0]) return { ok:false, reason:"changed" };
+ if (target.platform === "threads" && username && username.toLowerCase() !== target.id.split("/")[0]) return { ok:false, reason:"changed" };
let caption = text(record(media.caption)?.text);
// A visible slide establishes readability; preserve all loaded slide captions.
const captions = [caption];
@@ -308,19 +315,26 @@ export const readMetaSocial = (doc: Document, target: PlatformTarget): PlatformR
export const facebookExpandButton = (card: Element | null) => card
? Array.from(card.querySelectorAll<HTMLElement>('[data-ad-preview="message"] [role="button"], [data-ad-preview="message"] button, [data-ad-comet-preview="message"] [role="button"]'))
- .find((button) => /^(?:See more|展开|查看更多|もっと見る|Zobacz więcej)$/i.test(platformText(button))) : undefined;
+ .find((button) => !platformElementHidden(button) && /^(?:See more|展开|查看更多|もっと見る|Zobacz więcej)$/i.test(platformText(button))) : undefined;
export const readFacebook = (doc: Document, target: PlatformTarget): PlatformRead => {
- const card = socialPostCard(doc, target);
- if (!card || card.closest('[hidden], [aria-hidden="true"]')) return {ok:false, reason:"unreadable"};
- if (facebookExpandButton(card)) return {ok:false, reason:"incomplete"};
- const body = card.querySelector('[data-ad-preview="message"], [data-ad-comet-preview="message"]');
+ const liveCard = socialPostCard(doc, target);
+ if (!liveCard) return {ok:false, reason:"unreadable"};
+ if (facebookExpandButton(liveCard)) return {ok:false, reason:"incomplete"};
+ const card = platformReadableCopy(liveCard);
+ const ownBody=(root: Element)=>Array.from(root.querySelectorAll('[data-ad-preview="message"], [data-ad-comet-preview="message"]'))
+ .find((node)=>node.closest('[role="article"], article') === root);
+ const body = ownBody(card);
+ const liveBody=ownBody(liveCard);
+ if (platformText(liveBody) && !platformText(body)) return {ok:false,reason:"unreadable"};
if (body?.closest('[hidden], [aria-hidden="true"]')) return {ok:false,reason:"unreadable"};
const records = pageRecords(doc, target.id);
- const story = records.find((item) => item.__typename === "Story" && (sameTarget(item.permalink_url || item.url, target) || text(item.post_id) === target.id) && item.creation_time !== undefined);
+ const story = records.find((item) => item.__typename === "Story" && (sameTarget(item.permalink_url || item.url, target) || text(item.post_id) === target.id));
+ const contentStory=record(record(record(story?.comet_sections)?.content)?.story);
+ if (!platformText(body) && text(record(contentStory?.message)?.text).trim()) return {ok:false,reason:"unreadable"};
const cleanBody = body?.cloneNode(true) as Element | undefined;
for (const emoji of Array.from(cleanBody?.querySelectorAll('img[src*="/images/emoji.php"]') || [])) emoji.replaceWith(doc.createTextNode(emoji.getAttribute("alt") || ""));
- const parts = [cleanBody ? platformHtmlMarkdown(cleanBody,target.url) : ""];
+ const parts = [cleanBody ? socialBodyMarkdown(doc,cleanBody,target.url) : ""];
const copy = card.cloneNode(true) as Element;
copy.querySelectorAll('[role="article"], article, [role="toolbar"], [data-ad-preview="message"], [data-ad-comet-preview="message"]').forEach((node)=>node.remove());
const seen = new Set<string>();
@@ -329,11 +343,27 @@ export const readFacebook = (doc: Document, target: PlatformTarget): PlatformRea
if (!url || !/\.fbcdn\.net\//.test(url) || !/\/v\//.test(url) || seen.has(url)) continue;
seen.add(url); parts.push(imageMarkdown(url, img.getAttribute("alt"), target.url));
}
+ // Page-declared photos verify the rendered attachment; they cannot restore
+ // a missing or hidden image. CDN resize/signature queries do not change it.
+ const photos = new Set<string>();
+ const photoIdentity = (value: string) => {
+ const safe=safePlatformUrl(value,target.url);
+ return safe ? new URL(safe).pathname : "";
+ };
+ const collectPhotos = (value: unknown) => {
+ const obj=record(value);
+ if (!obj) { if(Array.isArray(value)) value.forEach(collectPhotos); return; }
+ const uri=text(record(obj.photo_image)?.uri);
+ if (uri) photos.add(photoIdentity(uri));
+ Object.values(obj).forEach(collectPhotos);
+ };
+ collectPhotos(story?.attachments);
+ if (Array.from(photos).some(photo=>!Array.from(seen).some(url=>photoIdentity(url)===photo))) return {ok:false,reason:"incomplete"};
// A hidden remainder of a photo collection must not be called complete.
if (Array.from(copy.querySelectorAll("a, [role='button']")).some((node)=>/^\+\d+$/.test(platformText(node)))) return {ok:false, reason:"incomplete"};
const actor = Array.isArray(story?.actors) ? record(story.actors[0]) : undefined;
const author = text(actor?.name) || platformText(card.querySelector('h2 a, h3 a, strong a'));
- const saved = result(target,parts.filter(Boolean).join("\n\n"),author,epochTime(story?.creation_time),platformText(body).slice(0,100) || author);
+ const saved = result(target,parts.filter(Boolean).join("\n\n"),author,epochTime(story?.creation_time),platformText(cleanBody).slice(0,100) || author);
if (saved.ok && !saved.clip.publishedAt) {
const link = ownPostLinks(card,target.platform).find((a)=>sameTarget(postLinkUrl(a,target.url),target));
saved.clip.publishedAt = publishedTime(link?.querySelector("time, abbr") || link || null);
@@ -343,7 +373,7 @@ export const readFacebook = (doc: Document, target: PlatformTarget): PlatformRea
export const linkedinExpandButton = (card: Element | null) => card
? Array.from(card.querySelectorAll<HTMLElement>('button.see-more, .feed-shared-inline-show-more-text__see-more-less-toggle, [data-test-id="show-more-less-text__button"]'))
- .find((button)=>!button.hidden && button.getAttribute("aria-expanded") !== "true"
+ .find((button)=>!platformElementHidden(button) && button.getAttribute("aria-expanded") !== "true"
&& !/^(?:See less|Show less|收起|折りたたむ|Zobacz mniej)$/i.test(platformText(button))) : undefined;
const linkedinBodyMarkdown = (doc: Document, body: Element, base: string) => {
const clean = body.cloneNode(true) as Element;
@@ -370,8 +400,9 @@ const linkedinBodyMarkdown = (doc: Document, body: Element, base: string) => {
return socialBodyMarkdown(doc,clean,base);
};
export const readLinkedin = (doc: Document, target: PlatformTarget): PlatformRead => {
- const card = socialPostCard(doc,target);
- if (!card || card.closest('[hidden], [aria-hidden="true"]')) return {ok:false,reason:"unreadable"};
+ const liveCard = socialPostCard(doc,target);
+ if (!liveCard) return {ok:false,reason:"unreadable"};
+ const card = platformReadableCopy(liveCard);
// A guest card declares both the UGC attribution and its public activity URN.
// Its JSON-LD uses the activity ID even when the requested URL uses the UGC ID.
const cardTarget = linkedinCardTarget(card) || target;
@@ -379,19 +410,28 @@ export const readLinkedin = (doc: Document, target: PlatformTarget): PlatformRea
&& (sameTarget(item["@id"] || item.url,target) || sameTarget(item["@id"] || item.url,cardTarget)));
const sduiBody = Array.from(card.querySelectorAll('[id^="translatable-commentary-"] [data-testid="expandable-text-box"]'))
.find((node) => node.closest(LINKEDIN_CARD_SELECTOR) === card);
- const body = card.querySelector('[data-test-id="main-feed-activity-card__commentary"], .feed-shared-update-v2__description .update-components-text, .feed-shared-text') || sduiBody;
+ const ownBody=(root: Element)=>Array.from(root.querySelectorAll('[data-test-id="main-feed-activity-card__commentary"], .feed-shared-update-v2__description .update-components-text, .feed-shared-text, [id^="translatable-commentary-"] [data-testid="expandable-text-box"]'))
+ .find((node)=>node.closest(LINKEDIN_CARD_SELECTOR) === root);
+ const body = ownBody(card);
if (body?.closest('[hidden], [aria-hidden="true"]')) return {ok:false,reason:"unreadable"};
if (!schema && linkedinExpandButton(card)) return {ok:false,reason:"incomplete"};
const fullText = text(schema?.articleBody);
+ if (fullText.trim() && !platformText(body)) return {ok:false,reason:"unreadable"};
+ const liveBody = ownBody(liveCard);
const domMarkdown = body ? linkedinBodyMarkdown(doc,body,target.url) : '';
const normalize = (value: string) => value.replace(/\s+/g,' ').trim();
const completeBody = body && (!fullText || normalize(body.textContent || '') === normalize(fullText));
+ if (!completeBody && fullText && body && platformText(liveBody) !== platformText(body)) return {ok:false,reason:"incomplete"};
const parts = [completeBody ? domMarkdown : (fullText ? linkedinBodyMarkdown(doc,paragraphs(doc,fullText),target.url) : domMarkdown)];
if (schema && Array.isArray(schema.image)) {
const visibleImages=card.querySelectorAll('[data-test-id="feed-images-content__list-item"] img');
const remainder=Number(platformText(card.querySelector('[data-test-id="feed-images-content__overlay"]')).replace(/^\+/,"")) || 0;
if (schema.image.length < visibleImages.length + remainder) return {ok:false,reason:"incomplete"};
- for (const img of schema.image) parts.push(imageMarkdown(record(img)?.url || img,"",target.url));
+ for (const img of schema.image) {
+ const markdown=imageMarkdown(record(img)?.url || img,"",target.url);
+ if (!markdown) return {ok:false,reason:"incomplete"};
+ parts.push(markdown);
+ }
} else {
const media = card.querySelector('[data-testid="carousel-container"]');
const sduiImages = media?.querySelectorAll('[data-testid="carousel-child-container"] img') || [];
@@ -402,16 +442,37 @@ export const readLinkedin = (doc: Document, target: PlatformTarget): PlatformRea
}
if (count && sduiImages.length < Number(count[1])) return {ok:false,reason:"incomplete"};
for (const img of Array.from(card.querySelectorAll('.update-components-image img, [data-test-id="feed-images-content"] img, [data-testid="carousel-child-container"] img'))) {
- parts.push(imageMarkdown(img.getAttribute("src") || img.getAttribute("data-delayed-url"),img.getAttribute("alt"),target.url));
+ const markdown=imageMarkdown(img.getAttribute("src") || img.getAttribute("data-delayed-url"),img.getAttribute("alt"),target.url);
+ if (!markdown) return {ok:false,reason:"incomplete"};
+ parts.push(markdown);
}
if (card.querySelector('[data-test-id="feed-images-content__overlay"]')) return {ok:false,reason:"incomplete"};
}
const sduiHeader = sduiBody?.closest('[id^="translatable-commentary-"]')?.parentElement?.previousElementSibling;
- const author = text(record(schema?.author)?.name) || platformText(card.querySelector('.update-components-actor__title, [data-tracking-control-name="public_post_feed-actor-name"]'))
- || Array.from(sduiHeader?.querySelectorAll('a[href]') || []).map(platformText).find(Boolean);
+ const own = (selector: string) => Array.from(card.querySelectorAll(selector)).find(node => node.closest(LINKEDIN_CARD_SELECTOR) === card);
+ const actor = sduiHeader || own('.update-components-actor, [data-test-id="main-feed-activity-card__entity-lockup"]');
+ const actorLinks = Array.from(actor?.querySelectorAll('a[href]') || []).filter(link =>
+ link.closest(LINKEDIN_CARD_SELECTOR) === card && platformText(link));
+ const person = actorLinks.find(link => {
+ const url = safePlatformUrl(link.getAttribute('href') || '', target.url);
+ return url && /(^|\.)linkedin\.com$/.test(new URL(url).hostname) && /^\/in\//.test(new URL(url).pathname);
+ });
+ const author = text(record(schema?.author)?.name) || platformText(own('.update-components-actor__title, [data-tracking-control-name="public_post_feed-actor-name"]'))
+ || platformText(person?.querySelector('p') || person) || actorLinks.map(platformText).find(Boolean);
+ const metadata = Array.from(sduiHeader?.querySelectorAll('p') || []).filter(node =>
+ !node.closest('a, button') && node.closest(LINKEDIN_CARD_SELECTOR) === card);
+ // SDUI inserts connection degree and professional headline before the time.
+ // Recognize the complete time label, rather than taking a paragraph by index.
+ const isTime = (node: Element) => /^(?:\d+\s*(?:s|m|h|d|w|mo|yr|seconds?|minutes?|hours?|days?|weeks?|months?|years?)(?:\s+ago)?|\d+\s*(?:秒|分钟|分鐘|小时|小時|天|周|週|个月|個月|年|時間|日|週間|か月|ヶ月|カ月)前|\d+\s*(?:sek\.|min|godz\.|dni|tyg\.|mies\.|lat)(?:\s+temu)?)(?:\s*[•·].*)?$/i.test(platformText(node));
+ const timeNode = metadata.find(isTime);
+ const headline = person ? platformText(Array.from(actor?.querySelectorAll('.update-components-actor__description, .feed-shared-actor__description') || []).find(node => node.closest(LINKEDIN_CARD_SELECTOR) === card)
+ || metadata.find(node => node !== timeNode && !/followers|关注者|關注者|フォロワー|obserwuj/i.test(platformText(node)))) : '';
if (!parts.some((part)=>part.trim())) return {ok:false,reason:"unreadable"};
const saved = result(target,parts.filter(Boolean).join("\n\n"),author,dateTime(schema?.datePublished),text(schema?.headline) || fullText.split("\n")[0] || (sduiBody ? parts[0].split("\n")[0].slice(0,100) : platformText(body).slice(0,100)) || author);
- if (saved.ok && !saved.clip.publishedAt) saved.clip.publishedAt = publishedTime(card.querySelector('time, .update-components-actor__sub-description') || sduiHeader?.querySelectorAll('p')[1] || null);
+ if (saved.ok) {
+ if (headline) saved.clip.authorHeadline = headline;
+ saved.clip.publishedAt ||= publishedTime(own('time, .update-components-actor__sub-description') || timeNode || null);
+ }
return saved;
};
@@ -421,16 +482,19 @@ export const readSubstackNote = (doc: Document, target: PlatformTarget): Platfor
const selector = '[class*="feedPermalinkUnit-"], [data-entity-key]';
const candidates = [...Array.from(doc.querySelectorAll('[class*="feedPermalinkUnit-"]')),
...Array.from(doc.querySelectorAll(`[data-entity-key="${noteId}"]`))];
- const card = candidates.find((candidate)=>
- !candidate.closest('[hidden], [aria-hidden="true"]') && Array.from(candidate.querySelectorAll('a[href]')).some((link)=>
- !link.closest('.ProseMirror') && link.closest(selector) === candidate && sameTarget(postLinkUrl(link,target.url),target)));
- if (card?.hasAttribute('data-entity-key') && card.getAttribute('data-entity-key') !== noteId) return {ok:false,reason:'unreadable'};
- if (!card || card.closest('[hidden], [aria-hidden="true"]')) return { ok:false, reason:"unreadable" };
- const body = Array.from(card.querySelectorAll('.ProseMirror')).find((node)=>
- node.closest(selector) === card && !node.closest('[hidden], [aria-hidden="true"]'));
+ let card: Element | undefined, body: Element | undefined;
+ for(const candidate of candidates) {
+ if(candidate.hasAttribute('data-entity-key') && candidate.getAttribute('data-entity-key') !== noteId) continue;
+ const copy=platformReadableCopy(candidate);
+ const ownBody=Array.from(copy.querySelectorAll('.ProseMirror')).find(node=>node.closest(selector) === copy && platformText(node));
+ if(!ownBody) continue;
+ if(Array.from(copy.querySelectorAll('a[href]')).some(link=>
+ !link.closest('.ProseMirror') && link.closest(selector) === copy && sameTarget(postLinkUrl(link,target.url),target))) {card=copy;body=ownBody;break;}
+ }
+ if(!card || !body) return {ok:false,reason:'unreadable'};
const headerLink = Array.from(card.querySelectorAll('a[href]')).find((link)=>
!link.closest('.ProseMirror') && link.closest(selector) === card && sameTarget(postLinkUrl(link,target.url),target));
- if (!body || !headerLink || !platformText(body)) return { ok:false, reason:"unreadable" };
+ if (!headerLink) return { ok:false, reason:"unreadable" };
if (card.querySelector('[class*="seeMore"], [class*="readMore"], [data-testid="read-more"]')) return { ok:false, reason:"incomplete" };
const entry = pageRecords(doc,noteId,"application/ld+json").find((item)=>
item["@type"] === "SocialMediaPosting" && item.identifier === noteId && sameTarget(item.url,target));
diff --git a/apps/extension/src/social-target.ts b/apps/extension/src/social-target.ts
index d1bae5a2..d6ae0508 100644
--- a/apps/extension/src/social-target.ts
+++ b/apps/extension/src/social-target.ts
@@ -1,5 +1,8 @@
import { platformTarget, socialPlatform } from "./platform-clip";
import { ownPostLinks, metaPostCard, linkedinCardTarget, LINKEDIN_CARD_SELECTOR } from "./social-clip";
+import { xueqiuCardTarget, XUEQIU_CARD_SELECTOR } from "./xueqiu-clip";
+import { doubanCommentTarget } from "./douban-clip";
+import { jikeCardTarget, JIKE_CARD_SELECTOR } from "./jike-clip";
// Only remembers the card under the pointer. No network or automatic capture.
(() => {
@@ -14,9 +17,27 @@ import { ownPostLinks, metaPostCard, linkedinCardTarget, LINKEDIN_CARD_SELECTOR
const selector = platform === "facebook" ? '[role="article"], article'
: platform === "bluesky" ? '[data-testid^="postThreadItem-by-"], [data-testid^="feedItem-by-"]'
: platform === "linkedin" ? LINKEDIN_CARD_SELECTOR
+ : platform === "xueqiu" ? XUEQIU_CARD_SELECTOR
+ : platform === "douban" ? ".comment-item[data-cid]"
+ : platform === "jike" ? JIKE_CARD_SELECTOR
: platform === "instagram" ? "article" : "";
const card = selector ? element.closest(selector) : null;
const mark = (node: Element) => {
+ if (platform === "jike") {
+ const target=jikeCardTarget(node,location.href);
+ if (target) {node.setAttribute("data-edgeever-social-target",target.url);return true;}
+ return false;
+ }
+ if (platform === "douban") {
+ const target=doubanCommentTarget(node,location.href);
+ if (target) {node.setAttribute("data-edgeever-social-target",target.url);return true;}
+ return false;
+ }
+ if (platform === "xueqiu") {
+ const target = xueqiuCardTarget(node);
+ if (target) { node.setAttribute("data-edgeever-social-target", target.url); return true; }
+ return false;
+ }
if (platform === "linkedin") {
const target = linkedinCardTarget(node);
if (target) { node.setAttribute("data-edgeever-social-target", target.url); return true; }
diff --git a/apps/extension/src/substack-content.ts b/apps/extension/src/substack-content.ts
index 31f14c78..2b2e7bfe 100644
--- a/apps/extension/src/substack-content.ts
+++ b/apps/extension/src/substack-content.ts
@@ -1,8 +1,12 @@
-import { articlePlatform } from "./article-platform";
+import { articlePlatform, substackPaywall } from "./article-platform";
+import { articleMetadata, type ArticleContent } from "./article-metadata";
+import { platformReadableCopy, platformText } from "./platform-clip";
/** Read the displayed newsletter article, excluding subscription and sharing UI. */
-export const substackContent = (doc: Document, pageUrl: string): { title: string; body: Element } | null => {
+export const substackContent = (doc: Document, pageUrl: string): ArticleContent | null => {
if (articlePlatform(doc,pageUrl) !== "Substack") return null;
- const article = doc.querySelector('article.newsletter-post');
+ if (substackPaywall(doc)) return null;
+ const liveArticle = doc.querySelector('article.newsletter-post');
+ const article = liveArticle ? platformReadableCopy(liveArticle) : null;
const title = article?.querySelector('h1.post-title');
const content = article?.querySelector('.body.markup');
if (!title?.textContent?.trim() || !content || content.closest('[hidden], [aria-hidden="true"]')) return null;
@@ -14,5 +18,6 @@ export const substackContent = (doc: Document, pageUrl: string): { title: string
paragraph.textContent = subtitle.textContent.trim();
body.insertBefore(paragraph,body.firstChild);
}
- return body.textContent?.trim() || body.querySelector('img[src]') ? {title:title.textContent.trim(),body} : null;
+ const name=platformText(title);
+ return body.textContent?.trim() || body.querySelector('img[src]') ? {title:name,body,...articleMetadata(doc,pageUrl,name,article!)} : null;
};
diff --git a/apps/extension/src/turndown-plugin-gfm.d.ts b/apps/extension/src/turndown-plugin-gfm.d.ts
new file mode 100644
index 00000000..9828e4b2
--- /dev/null
+++ b/apps/extension/src/turndown-plugin-gfm.d.ts
@@ -0,0 +1,4 @@
+declare module "@joplin/turndown-plugin-gfm" {
+ import type TurndownService from "turndown";
+ export const tables: TurndownService.Plugin;
+}
diff --git a/apps/extension/src/ui/popup.tsx b/apps/extension/src/ui/popup.tsx
index 3f35dae6..0528b472 100644
--- a/apps/extension/src/ui/popup.tsx
+++ b/apps/extension/src/ui/popup.tsx
@@ -1,11 +1,11 @@
import { useEffect, useState } from "react";
-import { Check, Save, Settings } from "lucide-react";
+import { Check, LockKeyhole, Save, Settings } from "lucide-react";
import { getSettings, type ExtensionSettings } from "../extension";
import { captureCurrentPage } from "../popup";
import { t } from "../i18n";
import { Button, Status, type Feedback } from "./primitives";
-type CaptureMode = { kind?: string; platform?: string };
+type CaptureMode = { kind?: string; platform?: string; access?: "login-required" | "content-restricted" };
export function Popup() {
const [settings, setSettings] = useState<ExtensionSettings | null>(null);
const [mode, setMode] = useState<CaptureMode | null>(null);
@@ -17,9 +17,14 @@ export function Popup() {
void chrome.runtime.sendMessage({ type: "getCurrentPageCaptureMode" }).then((value: CaptureMode | undefined) => { if (active) setMode(value ?? { kind: "unknown" }); }).catch(() => { if (active) setMode({ kind: "unknown" }); });
return () => { active = false; };
}, []);
+ const access = mode && !["unknown", "unavailable"].includes(mode.kind || "") ? mode.access : undefined;
+ const adapted = !!mode?.platform && !["unknown", "unavailable"].includes(mode.kind || "");
const label = !mode ? t("checkingPageCapture") : mode.kind === "unknown" ? t("pageCaptureUnknown")
- : mode.kind === "unavailable" ? t("pageCaptureUnavailable") : mode.kind === "social-feed" ? t("pageCaptureSelectPost")
+ : mode.kind === "unavailable" ? t("pageCaptureUnavailable")
+ : access === "login-required" ? t("pageCaptureLoginRequired") : access === "content-restricted" ? t("pageCaptureRestricted")
+ : mode.kind === "social-feed" ? t("pageCaptureSelectPost")
: mode.platform ? t("pageCaptureAdapted", mode.platform) : t("pageCaptureGeneric");
+ const hint = access === "login-required" ? t("pageCaptureLoginHint") : access === "content-restricted" ? t("pageCaptureRestrictedHint") : "";
async function save() {
if (!settings || busy || mode?.kind === "unavailable") return;
setBusy(true);
@@ -32,12 +37,12 @@ export function Popup() {
<header className="flex items-center gap-2.5">
<img src="/icons/icon-32.png" width={32} height={32} alt="" className="rounded-lg" />
<div><h1 className="text-lg font-semibold leading-tight">EdgeEver</h1><p className="text-xs text-muted-foreground">{t("webClipper")}</p></div>
- <div id="capture-context" data-kind={mode?.platform ? "adapted" : "generic"} aria-live="polite" aria-label={mode?.platform ? `${mode.platform} · ${label}` : undefined} className="ms-auto flex max-w-28 items-center gap-1 rounded-md bg-neutral-100 px-2 py-1 text-[11px] text-neutral-600">
- {mode?.platform && <Check aria-hidden="true" className="size-3 shrink-0" />}<span id="capture-mode">{label}</span>
+ <div id="capture-context" data-kind={access || (adapted ? "adapted" : "generic")} aria-live="polite" aria-label={mode?.platform ? `${mode.platform} · ${label}` : undefined} className="ms-auto flex max-w-28 items-center gap-1 rounded-md bg-neutral-100 px-2 py-1 text-[11px] text-neutral-600">
+ {access ? <LockKeyhole aria-hidden="true" className="size-3 shrink-0 text-amber-600" /> : adapted && <Check aria-hidden="true" className="size-3 shrink-0" />}<span id="capture-mode">{label}</span>
</div>
</header>
<Button id="save" className="mt-6 h-11 w-full gap-2 rounded-lg" disabled={!settings || !mode || busy || mode.kind === "unavailable"} onClick={() => void save()}><Save aria-hidden="true" className="size-4" />{t("saveCurrentPage")}</Button>
- <Status {...feedback} busy={busy} />
+ <Status {...feedback} message={feedback.message || hint} busy={busy} />
<Button id="settings" variant="ghost" className="mt-3 w-full gap-2 text-xs" onClick={() => void chrome.runtime.openOptionsPage()}><Settings aria-hidden="true" className="size-4" />{t("pluginSettings")}</Button>
</main>;
}
diff --git a/apps/extension/src/v2ex-clip.ts b/apps/extension/src/v2ex-clip.ts
index a3949634..bebcdaad 100644
--- a/apps/extension/src/v2ex-clip.ts
+++ b/apps/extension/src/v2ex-clip.ts
@@ -1,35 +1,40 @@
-import { markdownText, platformHtmlMarkdown, platformTarget, platformText, publishedTime, publishedTimeText, type PlatformLabels, type PlatformRead } from "./platform-clip";
+import { markdownText, platformElementHidden, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, publishedTime, publishedTimeText, type PlatformLabels, type PlatformRead } from "./platform-clip";
export const readV2ex = (doc: Document, pageUrl: string, labels: PlatformLabels): PlatformRead => {
const target = platformTarget(pageUrl);
if (target?.platform !== "v2ex") return { ok: false, reason: "not-target" };
const header = doc.querySelector("#Main .header");
const root = header?.closest(".box");
- const title = platformText(header?.querySelector("h1"));
+ const titleNode=header?.querySelector("h1");
+ const title = titleNode ? platformText(platformReadableCopy(titleNode)) : "";
if (!root || !header || !title) return { ok: false, reason: "unreadable" };
const canonical = doc.querySelector('link[rel="canonical"]')?.getAttribute("href") || "";
if (platformTarget(canonical)?.url !== target.url || !header.querySelector(`#topic_${target.id}_votes`)) {
return { ok: false, reason: "changed" };
}
const body = Array.from(root.querySelectorAll(".topic_content")).find((node) => !node.closest(".subtle"));
- const parts = [body ? platformHtmlMarkdown(body, target.url) : ""];
+ const parts = [body ? platformHtmlMarkdown(platformReadableCopy(body), target.url) : ""];
for (const supplement of Array.from(root.children).filter((node) => node.classList.contains("subtle"))) {
- const content = supplement.querySelector(".topic_content");
+ const clean=platformReadableCopy(supplement);
+ const content = clean.querySelector(".topic_content");
const markdown = content ? platformHtmlMarkdown(content, target.url) : "";
- if (!markdown) return { ok: false, reason: "unreadable" };
- const heading = supplement.querySelector(".fade");
+ if (!markdown) {
+ if(platformElementHidden(supplement)) continue;
+ return { ok: false, reason: "unreadable" };
+ }
+ const heading = clean.querySelector(".fade");
const number = /(?:Supplement\s*|第\s*)(\d+)/i.exec(platformText(heading))?.[1];
const label = number ? `${labels.supplement} ${number}` : platformText(heading);
const time = publishedTime(heading?.querySelector("time, span[title]") ?? null);
parts.push([
- `### ${markdownText(label)}`,
+ label ? `### ${markdownText(label)}` : "",
time ? markdownText(publishedTimeText(time, labels.relativeTime)) : "",
markdown,
].filter(Boolean).join("\n\n"));
}
const markdown = parts.filter(Boolean).join("\n\n");
if (!markdown) return { ok: false, reason: "unreadable" };
- const metadata = header.querySelector("small.gray");
+ const metadata = platformReadableCopy(header).querySelector("small.gray");
return {
ok: true,
clip: {
diff --git a/apps/extension/src/wechat-headings.ts b/apps/extension/src/wechat-headings.ts
new file mode 100644
index 00000000..e1e8a4b4
--- /dev/null
+++ b/apps/extension/src/wechat-headings.ts
@@ -0,0 +1,58 @@
+import { platformText } from "./platform-clip";
+
+const excluded = "pre,code,blockquote,li,td,th,figcaption,h1,h2,h3,h4,h5,h6";
+const inlineFontSize = (node: Element | null): number => {
+ for(let current=node;current;current=current.parentElement) {
+ const value=(current as HTMLElement).style?.fontSize;
+ if(!value) continue;
+ const match=/^(\d+(?:\.\d+)?)(px|pt)$/.exec(value.trim());
+ // Unknown relative units are not enough evidence to infer a heading.
+ return match ? Number(match[1]) * (match[2] === "pt" ? 4/3 : 1) : 0;
+ }
+ return 0;
+};
+
+/** Restore headings encoded as publisher typography, before styles are stripped.
+ * Operates only on the readable, detached WeChat article copy. */
+export const restoreWechatHeadings = (body: Element) => {
+ const paragraphs=Array.from(body.querySelectorAll("p")).filter(node=>
+ !node.closest(excluded) && !node.querySelector("img,video,audio,iframe,table") && platformText(node));
+ const sizes=new Map<Element,number[]>(), weights=new Map<number,number>();
+ for(const paragraph of paragraphs) {
+ const runs: number[]=[];
+ const walker=body.ownerDocument.createTreeWalker(paragraph,4 /* SHOW_TEXT */);
+ for(let text=walker.nextNode();text;text=walker.nextNode()) {
+ const parent=text.parentElement, value=platformText(text);
+ if(!parent || !value || parent.closest("script,style,template,button,code")) continue;
+ const size=inlineFontSize(parent);runs.push(size);
+ if(size) weights.set(size,(weights.get(size) || 0)+value.length);
+ }
+ sizes.set(paragraph,runs);
+ }
+ const bodySize=[...weights].sort((a,b)=>b[1]-a[1])[0]?.[0] || 0;
+ const stepPattern=/^第([一二三四五六七八九十百零〇两]+|\d+)步[::]\s*\S/;
+ const stepCandidates=paragraphs.filter(node=>stepPattern.test(platformText(node)) && !/[。!?!?;;]/.test(platformText(node)));
+ // A sequence of distinct step labels establishes section structure; a lone
+ // instruction mentioning a first step remains an ordinary paragraph.
+ const steps=new Set<Element>(new Set(stepCandidates.map(node=>stepPattern.exec(platformText(node))![1])).size > 1 ? stepCandidates : []);
+ const styled=new Map<Element,number>();
+ for(const paragraph of paragraphs) {
+ const runs=sizes.get(paragraph)!;
+ if(!steps.has(paragraph) && bodySize && runs.length && runs.every(size=>size >= bodySize*1.2)) styled.set(paragraph,Math.min(...runs));
+ }
+ const ranks=[...new Set(styled.values())].sort((a,b)=>b-a);
+ let sectionLevel=1;
+ for(const node of Array.from(body.querySelectorAll("h1,h2,h3,h4,h5,h6,p"))) {
+ if(node.matches("h1,h2,h3,h4,h5,h6")) {
+ if(!node.parentElement?.closest(excluded)) sectionLevel=Number(node.tagName[1]);
+ continue;
+ }
+ const size=styled.get(node);
+ const level=size ? Math.min(6,ranks.indexOf(size)+2) : steps.has(node) ? Math.min(6,sectionLevel+1) : 0;
+ if(!level) continue;
+ const heading=body.ownerDocument.createElement(`h${level}`);
+ while(node.firstChild) heading.appendChild(node.firstChild);
+ node.replaceWith(heading);
+ if(size) sectionLevel=level;
+ }
+};
diff --git a/apps/extension/src/xiaoyuzhou-clip.ts b/apps/extension/src/xiaoyuzhou-clip.ts
index 380047e9..13464d41 100644
--- a/apps/extension/src/xiaoyuzhou-clip.ts
+++ b/apps/extension/src/xiaoyuzhou-clip.ts
@@ -1,5 +1,5 @@
import { createDocument } from "@mixmark-io/domino";
-import { markdownText, markdownUrl, platformHtmlMarkdown, platformTarget, platformText, publishedTime, safePlatformUrl, type PlatformLabels, type PlatformRead } from "./platform-clip";
+import { markdownText, markdownUrl, platformElementHidden, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, publishedTime, safePlatformUrl, type PlatformLabels, type PlatformRead } from "./platform-clip";
/** Runs in MAIN because Next's current route props are not in the isolated DOM. */
export function readXiaoyuzhouStateInPage() {
@@ -20,10 +20,12 @@ export const readXiaoyuzhou = (doc: Document, pageUrl: string, labels: PlatformL
const target = platformTarget(pageUrl);
if (target?.platform !== "xiaoyuzhou") return { ok: false, reason: "not-target" };
const header = doc.querySelector("main header");
- const title = platformText(header?.querySelector("h1"));
const notes = doc.querySelector('section[aria-label="节目show notes"] .sn-content article');
const canonical = doc.querySelector('link[rel="canonical"]')?.getAttribute("href") || "";
- if (!header || !title || !notes) return { ok: false, reason: "unreadable" };
+ if (!header || !notes) return { ok: false, reason: "unreadable" };
+ const cleanHeader = platformReadableCopy(header);
+ const title = platformText(cleanHeader.querySelector("h1"));
+ if (!title) return { ok: false, reason: "unreadable" };
if (platformTarget(canonical)?.url !== target.url) return { ok: false, reason: "changed" };
// The sampled page loads the full article before its visual expansion.
@@ -57,21 +59,23 @@ export const readXiaoyuzhou = (doc: Document, pageUrl: string, labels: PlatformL
// Parse only in Domino's in-memory DOM: validation must not give untrusted
// markup to a browser HTML sink that could activate scripts or resource loads.
const expected = createDocument(expectedHtml).body;
- const markdown = platformHtmlMarkdown(notes, target.url);
- const fullMarkdown = platformHtmlMarkdown(expected, target.url);
+ const cleanNotes = platformReadableCopy(notes);
+ if (platformElementHidden(notes) && !cleanNotes.hasChildNodes()) return { ok: false, reason: "unreadable" };
+ const markdown = platformHtmlMarkdown(cleanNotes, target.url);
+ const fullMarkdown = platformHtmlMarkdown(platformReadableCopy(expected), target.url);
if (markdown !== fullMarkdown) return { ok: false, reason: "incomplete" };
// Only an explicitly empty field establishes that the episode has no notes.
if (!markdown && expectedHtml.trim()) return { ok: false, reason: "unreadable" };
- const podcast = header.querySelector('.podcast-title a.name[href^="/podcast/"]');
+ const podcast = cleanHeader.querySelector('.podcast-title a.name[href^="/podcast/"]');
const podcastName = platformText(podcast);
const podcastUrl = safePlatformUrl(podcast?.getAttribute("href") || "", target.url);
- const cover = header.querySelector("img.avatar");
+ const cover = cleanHeader.querySelector("img.avatar");
const coverUrl = safePlatformUrl(cover?.getAttribute("src") || "", target.url);
return {
ok: true,
clip: {
...target, title,
- publishedAt: publishedTime(header.querySelector("time")),
+ publishedAt: publishedTime(cleanHeader.querySelector("time")),
markdown: [
podcastName && podcastUrl ? `${markdownText(labels.podcast)}: [${markdownText(podcastName)}](${markdownUrl(podcastUrl)})` : "",
coverUrl ? `![${markdownText(title)}](${markdownUrl(coverUrl)})` : "",
diff --git a/apps/extension/src/xueqiu-clip.ts b/apps/extension/src/xueqiu-clip.ts
new file mode 100644
index 00000000..7e02e582
--- /dev/null
+++ b/apps/extension/src/xueqiu-clip.ts
@@ -0,0 +1,77 @@
+import { platformHtmlCopy, platformHtmlMarkdown, platformReadableCopy, platformTarget, platformText, publishedTime, safePlatformUrl, type PlatformRead, type PlatformTarget } from "./platform-clip";
+
+export const XUEQIU_CARD_SELECTOR = '.article__container, [class*="timeline__item__main_"]';
+const headerSelector = '.article__author, [class*="timeline__item__info_"]';
+const ownHeader = (card: Element) => {
+ const header = card.querySelector(headerSelector);
+ return header?.closest(XUEQIU_CARD_SELECTOR) === card ? header : null;
+};
+const headerTargets = (card: Element): PlatformTarget[] => {
+ const header = ownHeader(card);
+ if (!header) return [];
+ const targets = new Map<string, PlatformTarget>();
+ for (const link of Array.from(header.querySelectorAll('a.time[href], a[class*="date-and-source_"][href]'))) {
+ if (!platformText(platformReadableCopy(link))) continue;
+ const target = platformTarget(safePlatformUrl(link.getAttribute("href") || "", "https://xueqiu.com/"));
+ if (target?.platform === "xueqiu") targets.set(target.url, target);
+ }
+ return [...targets.values()];
+};
+const profileOwner = (header: Element | null): string | undefined => {
+ const author = header?.querySelector('a.name[href], a[class*="user-name_"][href]');
+ if (!author || !platformText(platformReadableCopy(author))) return;
+ const href = safePlatformUrl(author.getAttribute("href") || "", "https://xueqiu.com/");
+ if (!href) return;
+ const url = new URL(href);
+ return ["xueqiu.com", "www.xueqiu.com"].includes(url.hostname) ? /^\/([1-9]\d*)\/?$/.exec(url.pathname)?.[1] : undefined;
+};
+
+/** Feed targeting requires an own permalink, never a link from post text. */
+export const xueqiuCardTarget = (card: Element): PlatformTarget | null => {
+ const targets = headerTargets(card);
+ if (targets.length !== 1) return null;
+ const target = targets[0], owner = profileOwner(ownHeader(card));
+ return owner && owner !== target.id.split("/")[0] ? null : target;
+};
+
+const xueqiuStocks = (body: Element, base: string): string[] => {
+ const symbols = new Set<string>();
+ for (const link of Array.from(body.querySelectorAll("a[href]"))) {
+ const href = safePlatformUrl(link.getAttribute("href") || "", base);
+ if (!href) continue;
+ const url = new URL(href);
+ const symbol = /^\/S\/([A-Z][A-Z0-9.-]*|\d{5})\/?$/.exec(url.pathname)?.[1];
+ if (symbol && ["xueqiu.com", "www.xueqiu.com"].includes(url.hostname)) symbols.add(symbol);
+ }
+ // The instance persists at most 24 tags, including the three fixed tags.
+ return [...symbols].slice(0, 21);
+};
+
+export const readXueqiu = (doc: Document, target: PlatformTarget, sourceUrl: string): PlatformRead => {
+ if (target.platform !== "xueqiu") return { ok: false, reason: "not-target" };
+ const source = platformTarget(sourceUrl);
+ // The sampled home/profile cards are truncated descriptions. Source-page
+ // identity, rather than optional metadata, binds a detail read to this post.
+ if (!source) return { ok: false, reason: "not-target" };
+ if (source.url !== target.url) return { ok: false, reason: "changed" };
+ const card = doc.querySelector(".article__container");
+ if (!card) return { ok: false, reason: "unreadable" };
+ const header = ownHeader(card), owner = profileOwner(header);
+ if (headerTargets(card).some((known) => known.url !== target.url)
+ || (owner && owner !== target.id.split("/")[0])) return { ok: false, reason: "changed" };
+ const body = card.querySelector(".article__bd__detail");
+ const titleNode = card.querySelector(".article__bd__title");
+ const author = header?.querySelector(".name");
+ const timeLink = header?.querySelector("a.time");
+ if (!body) return { ok: false, reason: "unreadable" };
+ // Stock tags and Markdown must consume the same sanitized body: controls,
+ // scripts and hidden references cannot contribute tags after being removed.
+ const clean = platformHtmlCopy(platformReadableCopy(body), target.url) as Element;
+ const markdown = platformHtmlMarkdown(clean, target.url);
+ const title = (titleNode ? platformText(platformReadableCopy(titleNode)) : "") || platformText(clean).slice(0, 120);
+ if (!markdown || !title) return { ok: false, reason: "unreadable" };
+ const cleanTime = timeLink ? platformReadableCopy(timeLink) : null;
+ const published = cleanTime && /^发布于/.test(platformText(cleanTime)) ? publishedTime(cleanTime.querySelector("time")) : undefined;
+ return { ok: true, clip: { ...target, title, author: author ? platformText(platformReadableCopy(author)) || undefined : undefined, publishedAt: published,
+ markdown, tags: ["web-clip", "xueqiu", "投资", ...xueqiuStocks(clean, target.url)], completeness: "complete" } };
+};
diff --git a/apps/extension/src/xueqiu-feed.ts b/apps/extension/src/xueqiu-feed.ts
new file mode 100644
index 00000000..9cc0c1f7
--- /dev/null
+++ b/apps/extension/src/xueqiu-feed.ts
@@ -0,0 +1,38 @@
+import { platformTarget, type PlatformRead, type PlatformTarget } from "./platform-clip";
+import { readXueqiu, xueqiuCardTarget, XUEQIU_CARD_SELECTOR } from "./xueqiu-clip";
+
+/** Render only the selected public detail, without scripts. Browser-computed
+ * CSS visibility must remain available to the existing detail reader. */
+export const readXueqiuFeedPost = async (doc: Document, target: PlatformTarget, sourceUrl: string): Promise<PlatformRead> => {
+ const source = new URL(sourceUrl);
+ if (target.platform !== "xueqiu" || source.protocol !== "https:"
+ || !["xueqiu.com", "www.xueqiu.com"].includes(source.hostname) || platformTarget(sourceUrl)) return { ok: false, reason: "not-target" };
+ const card = Array.from(doc.querySelectorAll(XUEQIU_CARD_SELECTOR)).find(node => xueqiuCardTarget(node)?.url === target.url);
+ if (!card) return { ok: false, reason: "unreadable" };
+ const frame = doc.createElement("iframe");
+ frame.setAttribute("sandbox", "allow-same-origin");
+ frame.setAttribute("aria-hidden", "true");
+ frame.tabIndex = -1;
+ frame.style.cssText = "position:fixed;left:-10000px;top:0;width:1280px;height:800px;pointer-events:none";
+ return new Promise(resolve => {
+ const finish = (result: PlatformRead) => {
+ clearTimeout(timer);
+ frame.onload = null;
+ frame.onerror = null;
+ frame.remove();
+ resolve(result);
+ };
+ const timer = setTimeout(() => finish({ ok: false, reason: "unreadable" }), 8000);
+ frame.onload = () => {
+ if (!doc.contains(card) || xueqiuCardTarget(card)?.url !== target.url) return finish({ ok: false, reason: "changed" });
+ try {
+ const detail = frame.contentDocument;
+ if (!detail || platformTarget(detail.URL)?.url !== target.url) return finish({ ok: false, reason: "changed" });
+ finish(readXueqiu(detail, target, detail.URL));
+ } catch { finish({ ok: false, reason: "unreadable" }); }
+ };
+ frame.onerror = () => finish({ ok: false, reason: "unreadable" });
+ frame.src = new URL(`/${target.id}`, source).href;
+ doc.body.appendChild(frame);
+ });
+};
diff --git a/apps/extension/vertical-clip.test.mjs b/apps/extension/vertical-clip.test.mjs
new file mode 100644
index 00000000..7c25db5b
--- /dev/null
+++ b/apps/extension/vertical-clip.test.mjs
@@ -0,0 +1,240 @@
+import { expect, test } from "bun:test";
+import { readFileSync } from "node:fs";
+import { createContext, runInContext } from "node:vm";
+import { createDocument, createWindow } from "@mixmark-io/domino";
+import { bundleTestScripts } from "./bundle-test-scripts.mjs";
+import { isPlatformClip, platformElementHidden, platformHtmlMarkdown, platformReadableCopy, platformTarget } from "./src/platform-clip.ts";
+import { bossLoginRequired, readBoss } from "./src/boss-clip.ts";
+import { readXueqiu, xueqiuCardTarget } from "./src/xueqiu-clip.ts";
+import { readXiaoyuzhou } from "./src/xiaoyuzhou-clip.ts";
+
+const bossUrl = "https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html";
+const xueqiuUrl = "https://xueqiu.com/5636485254/253443400";
+const fixtureText = (name) => readFileSync(new URL(`./fixtures/platforms/${name}.html`, import.meta.url), "utf8");
+const fixture = (name) => createDocument(fixtureText(name));
+
+test("vertical detail identities discard tracking but reject foreign hosts, duplicate paths and credentials", () => {
+ expect(platformTarget(bossUrl + "?lid=tracking#salary")).toEqual({ platform: "boss", id: "0d7e760b0a0e7c3a0nF939S0E1NU", url: bossUrl });
+ expect(platformTarget(xueqiuUrl.replace("xueqiu.com", "www.xueqiu.com") + "?from=share#comments")).toEqual({ platform: "xueqiu", id: "5636485254/253443400", url: xueqiuUrl });
+ for (const url of [bossUrl.replace("www.zhipin.com", "www.zhipin.com.evil.test"), bossUrl.replace("https:", "http:"), bossUrl.replace("https://", "https://u:p@"), bossUrl.replace(".html", "/extra.html"), "https://www.zhipin.com/web/geek/job", xueqiuUrl.replace("xueqiu.com", "xueqiu.com:444"), xueqiuUrl.replace("5636485254", "0"), xueqiuUrl + "/extra", "https://xueqiu.com/S/SH600438"]) {
+ expect(platformTarget(url)).toBeNull();
+ }
+});
+
+test("BOSS real readable job keeps complete requirements, salary, location and company; excludes hidden noise and controls", () => {
+ const result = readBoss(fixture("boss"), bossUrl);
+ expect(result.ok).toBe(true);
+ expect(result.clip).toMatchObject({ title: "AI平台开发工程师", author: "超聚变技术有限公司", tags: ["web-clip", "boss"] });
+ for (const text of ["25-50K·13薪", "深圳 5-10年 本科", "5、熟悉OCR技术", "130个国家和地区", "深圳福田区博今国际A座", "节日福利", "五险一金"]) expect(result.clip.markdown).toContain(text);
+ for (const text of ["立即沟通", "登录/注册", "竞争力分析", "点击查看地图", "boss", "BOSS直聘描述"]) expect(result.clip.markdown).not.toContain(text);
+ expect(result.clip.publishedAt).toBeUndefined(); // Page update date is not a publication date.
+ expect(isPlatformClip(result.clip, platformTarget(bossUrl))).toBe(true);
+});
+
+test("BOSS rejects the actual signed-out preview and mismatched canonical identity", () => {
+ expect(readBoss(fixture("boss-login-required"), bossUrl)).toEqual({ ok: false, reason: "unreadable" });
+ const doc = fixture("boss");
+ doc.querySelector('link[rel="canonical"]').setAttribute("href", bossUrl.replace("E1NU", "E1NV"));
+ expect(readBoss(doc, bossUrl)).toEqual({ ok: false, reason: "changed" });
+});
+
+test("BOSS optional metadata and company introduction do not gate an otherwise readable job", () => {
+ for (const selector of ['link[rel="canonical"]', '.sider-company', '.job-detail-company', '.info-primary p', '.salary']) {
+ const doc = fixture("boss"); doc.querySelector(selector).remove();
+ const result = readBoss(doc, bossUrl);
+ expect(result.ok).toBe(true);
+ expect(result.clip.markdown).toContain("5、熟悉OCR技术");
+ }
+ const doc = fixture("boss"); doc.querySelector('.salary').textContent = "薪资可谈";
+ expect(readBoss(doc, bossUrl).clip.markdown).toContain("薪资可谈");
+});
+
+test("BOSS hides optional company information instead of refusing the complete job", () => {
+ const doc = fixture("boss");
+ doc.querySelector('.sider-company').setAttribute('hidden', '');
+ doc.querySelector('.job-detail-company').setAttribute('hidden', '');
+ const result = readBoss(doc, bossUrl);
+ expect(result.ok).toBe(true); expect(result.clip.author).toBeUndefined();
+ expect(result.clip.markdown).not.toContain('超聚变');
+});
+
+test("visibility overrides retain readable descendants while hidden text and images stay excluded", () => {
+ const doc = createDocument('<div id="body"><div style="visibility:hidden">Hidden text<img src="https://example.test/hidden.png"><span style="visibility:visible">Visible child text</span></div></div>');
+ expect(platformElementHidden(doc.querySelector('span'))).toBe(false);
+ const markdown = platformHtmlMarkdown(platformReadableCopy(doc.querySelector('#body')), 'https://example.test/');
+ expect(markdown).toContain('Visible child text'); expect(markdown).not.toContain('Hidden text'); expect(markdown).not.toContain('hidden.png');
+ const restricted = fixture('boss-login-required');
+ const wrapper = restricted.querySelector('.zp-more-info-layer-wrapper'), label = restricted.querySelector('.zp-more-info-layer-text');
+ wrapper.style.visibility = 'hidden'; label.style.visibility = 'visible';
+ expect(bossLoginRequired(restricted)).toBe(true);
+ label.style.visibility = 'hidden'; label.innerHTML = '<span style="visibility:visible">登录查看完整内容</span>';
+ expect(bossLoginRequired(restricted)).toBe(true); expect(readBoss(restricted, bossUrl).ok).toBe(false);
+ label.style.visibility = 'visible'; label.innerHTML = '<span hidden>登录查看完整内容</span>';
+ expect(bossLoginRequired(restricted)).toBe(false);
+});
+
+test("the BOSS login hint uses only its visible job-preview layer, not unrelated login controls or hidden leftovers", () => {
+ const doc = fixture("boss-login-required");
+ expect(bossLoginRequired(doc)).toBe(true);
+ doc.querySelector(".zp-more-info-layer-wrapper").setAttribute("style", "display:none");
+ expect(bossLoginRequired(doc)).toBe(false);
+ doc.querySelector(".zp-more-info-layer-wrapper").removeAttribute("style");
+ doc.querySelector(".zp-more-info-layer-text").setAttribute("hidden", "");
+ expect(bossLoginRequired(doc)).toBe(false);
+ const readable = fixture("boss");
+ readable.body.innerHTML += '<aside class="zp-more-info-layer-wrapper">登录查看完整内容</aside>';
+ expect(bossLoginRequired(readable)).toBe(false);
+});
+
+for (const selector of [".job-banner", ".job-sec-text"]) test(`BOSS does not read a hidden ${selector}`, () => {
+ const doc = fixture("boss"); doc.querySelector(selector).setAttribute("hidden", "");
+ expect(readBoss(doc, bossUrl).ok).toBe(false);
+});
+
+test("Xueqiu real article keeps author, original post time, all images and only its explicitly linked stock tags", () => {
+ const result = readXueqiu(fixture("xueqiu"), platformTarget(xueqiuUrl), xueqiuUrl);
+ expect(result.ok).toBe(true);
+ expect(result.clip).toMatchObject({ author: "--大圣--", publishedAt: { value: "2023-06-16T23:54:12.000Z", precision: "datetime" }, tags: ["web-clip", "xueqiu", "投资", "SH600438", "SH601012", "SH688472"] });
+ expect(result.clip.markdown).toContain("及时高效响应全球客户和市场");
+ expect(result.clip.markdown.match(/!\[/g)).toHaveLength(3);
+ for (const text of ["用的陕汽的重卡送货", "来源:雪球App", "打赏作者", "热门话题"]) expect(result.clip.markdown).not.toContain(text);
+ expect(isPlatformClip(result.clip, platformTarget(xueqiuUrl))).toBe(true);
+ expect(isPlatformClip({ ...result.clip, tags: [...result.clip.tags, "invented ticker"] }, platformTarget(xueqiuUrl))).toBe(false);
+});
+
+test("stock tags ignore hidden references, plain mentions, comments and unrelated links", () => {
+ const doc = fixture("xueqiu"), body = doc.querySelector(".article__bd__detail");
+ body.innerHTML += '<p>Plain AAPL and SH999999</p><p hidden><a href="/S/AAPL">AAPL</a></p><p><a href="https://evil.test/S/MSFT">MSFT</a></p>';
+ expect(readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl).clip.tags).toEqual(["web-clip", "xueqiu", "投资", "SH600438", "SH601012", "SH688472"]);
+ body.querySelectorAll("a[href]").forEach((a) => a.removeAttribute("href"));
+ expect(readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl).clip.tags).toEqual(["web-clip", "xueqiu", "投资"]);
+});
+
+test("Xueqiu stocks cannot come from controls or scripts removed from the saved body", () => {
+ const doc = fixture("xueqiu"), body = doc.querySelector('.article__bd__detail');
+ body.innerHTML += '<button><a href="/S/AAPL">Removed AAPL</a></button><form><a href="/S/MSFT">Removed MSFT</a></form>';
+ const result = readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl);
+ expect(result.clip.tags).not.toContain('AAPL'); expect(result.clip.tags).not.toContain('MSFT');
+ expect(result.clip.markdown).not.toContain('Removed');
+});
+
+test("Xueqiu readable detail does not require author and time links; conflicts and source identity still bind it", () => {
+ const target = platformTarget(xueqiuUrl), doc = fixture('xueqiu');
+ const card = doc.querySelector('.article__container'), time = doc.querySelector('a.time');
+ time.parentElement.appendChild(time.cloneNode(true));
+ expect(xueqiuCardTarget(card)?.url).toBe(xueqiuUrl);
+ expect(readXueqiu(doc, target, xueqiuUrl).ok).toBe(true);
+ doc.querySelectorAll('a.time').forEach(n=>n.remove());
+ doc.querySelector('.article__author a.name').removeAttribute('href');
+ const result = readXueqiu(doc, target, xueqiuUrl);
+ expect(result.ok).toBe(true); expect(result.clip.author).toBe('--大圣--'); expect(result.clip.publishedAt).toBeUndefined();
+ expect(readXueqiu(doc, target, xueqiuUrl.replace('253443400','253443401'))).toEqual({ok:false,reason:'changed'});
+});
+
+test("unproven expand classes and hidden controls do not mark a complete Xueqiu detail as truncated", () => {
+ const doc = fixture('xueqiu');
+ doc.querySelector('.article__bd__detail').innerHTML += '<button class="read-more" hidden>Show more</button><p class="show-more-info">Ordinary visible paragraph</p>';
+ const result = readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl);
+ expect(result.ok).toBe(true); expect(result.clip.markdown).toContain('Ordinary visible paragraph');
+});
+
+test("the real feed's five-digit Hong Kong stock link keeps its leading zero when present in a readable post", () => {
+ const feed = fixture("xueqiu-feed"), doc = fixture("xueqiu");
+ const stock = feed.querySelector('a[href="https://xueqiu.com/S/09992"]');
+ expect(stock).toBeTruthy();
+ doc.querySelector(".article__bd__detail").appendChild(stock.cloneNode(true));
+ const result = readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl);
+ expect(result.clip.tags).toContain("09992");
+ expect(isPlatformClip(result.clip, platformTarget(xueqiuUrl))).toBe(true);
+});
+
+test("Xueqiu stays within the persisted tag limit while retaining all explicit stock links in the body", () => {
+ const doc = fixture("xueqiu"), target = platformTarget(xueqiuUrl);
+ doc.querySelector(".article__bd__detail").innerHTML = Array.from({ length: 30 }, (_, i) => `<p><a href="/S/SH${600000 + i}">Stock ${i}</a></p>`).join("");
+ const result = readXueqiu(doc, target, xueqiuUrl);
+ expect(result.clip.tags).toHaveLength(24);
+ expect(result.clip.tags.slice(3)).toHaveLength(21);
+ expect(result.clip.markdown).toContain("SH600029");
+ expect(isPlatformClip(result.clip, target)).toBe(true);
+ expect(isPlatformClip({ ...result.clip, tags: [...result.clip.tags, "SH600030"] }, target)).toBe(false);
+});
+
+test("body links and a mismatched author cannot prove Xueqiu parent identity; modified time is not publication time", () => {
+ const doc = fixture("xueqiu"), target = platformTarget(xueqiuUrl);
+ const time = doc.querySelector(".article__author a.time");
+ time.firstChild.textContent = "修改于";
+ expect(readXueqiu(doc, target, xueqiuUrl).clip.publishedAt).toBeUndefined();
+ time.href = xueqiuUrl.replace("253443400", "253443401");
+ doc.querySelector(".article__bd__detail").innerHTML += `<a href="${xueqiuUrl}">Referenced post</a>`;
+ expect(readXueqiu(doc, target, xueqiuUrl).ok).toBe(false);
+ time.href = xueqiuUrl;
+ doc.querySelector(".article__author a.name").href = "/999";
+ expect(readXueqiu(doc, target, xueqiuUrl).ok).toBe(false);
+});
+
+for (const selector of [".article__container", ".article__bd__detail"]) test(`Xueqiu rejects hidden ${selector}`, () => {
+ const doc = fixture("xueqiu"); doc.querySelector(selector).setAttribute("aria-hidden", "true");
+ expect(readXueqiu(doc, platformTarget(xueqiuUrl), xueqiuUrl).ok).toBe(false);
+});
+
+test("Xueqiu pointer targets the own header in a real truncated feed; preview requires opening its detail", () => {
+ const window = createWindow(fixtureText("xueqiu-feed"), "https://www.xueqiu.com/");
+ const [script] = bundleTestScripts(["social-target"]);
+ runInContext(script, createContext({ document: window.document, location: window.location, Element: window.Element, Node: window.Node, URL }));
+ const cards = [...window.document.querySelectorAll('[class*="timeline__item__main_"]')];
+ expect(cards).toHaveLength(2);
+ const target = xueqiuCardTarget(cards[0]);
+ expect(target.url).toBe("https://xueqiu.com/6114376649/411862401");
+ const body = cards[0].querySelector('[class*="timeline__item__content_"]');
+ body.innerHTML += `<a href="${xueqiuUrl}">Referenced article</a>`;
+ body.lastChild.dispatchEvent(new window.Event("contextmenu", { bubbles: true }));
+ expect(cards[0].getAttribute("data-edgeever-social-target")).toBe(target.url);
+ expect(readXueqiu(window.document, target, "https://www.xueqiu.com/")).toEqual({ ok: false, reason: "not-target" });
+ cards[1].querySelector('[class*="timeline__item__content_"]').dispatchEvent(new window.Event("contextmenu", { bubbles: true }));
+ expect(cards[0].hasAttribute("data-edgeever-social-target")).toBe(false);
+ expect(cards[1].hasAttribute("data-edgeever-social-target")).toBe(true);
+});
+
+test("Xiaoyuzhou rejects a hidden Show Notes body even with complete loaded state", () => {
+ const doc = fixture("xiaoyuzhou"); doc.querySelector(".sn-content article").setAttribute("hidden", "");
+ expect(readXiaoyuzhou(doc, "https://www.xiaoyuzhoufm.com/episode/62ad4ae5f9b62781ea058a02", {})).toEqual({ ok: false, reason: "unreadable" });
+});
+
+test("Xiaoyuzhou real explicit hosts stay with the complete episode timeline and podcast name", () => {
+ const doc = fixture("xiaoyuzhou-hosts");
+ const result = readXiaoyuzhou(doc, "https://www.xiaoyuzhoufm.com/episode/612375e57f89405077cbeb3b", { podcast: "Podcast" });
+ expect(result.ok).toBe(true);
+ for (const text of ["下课以后", "1:10", "5:16", "7:04", "11:08", "14:56", "16:42", "阿丁、毛毛", "蜻蜓FM等平台收听"]) expect(result.clip.markdown).toContain(text);
+ expect(result.clip.author).toBeUndefined(); // Episode hosts are the explicit Show Notes text, not podcast authors.
+});
+
+test("Xiaoyuzhou loaded state never restores hidden descendants or title", () => {
+ const url = "https://www.xiaoyuzhoufm.com/episode/62ad4ae5f9b62781ea058a02";
+ const doc = fixture("xiaoyuzhou"), body = doc.querySelector(".sn-content article");
+ body.innerHTML = `<div style="display:none">${body.innerHTML}</div>`;
+ expect(readXiaoyuzhou(doc, url, {}).ok).toBe(false);
+ const hiddenTitle = fixture("xiaoyuzhou"); hiddenTitle.querySelector("h1").setAttribute("hidden", "");
+ expect(readXiaoyuzhou(hiddenTitle, url, {}).ok).toBe(false);
+});
+
+test("Xiaoyuzhou accepts readable Show Notes restored inside a visibility-hidden container", () => {
+ const doc = fixture("xiaoyuzhou"), body = doc.querySelector(".sn-content article");
+ body.style.visibility = "hidden";
+ body.innerHTML = `<div style="visibility:visible">${body.innerHTML}</div>`;
+ expect(readXiaoyuzhou(doc, "https://www.xiaoyuzhoufm.com/episode/62ad4ae5f9b62781ea058a02", {podcast:"Podcast"}).ok).toBe(true);
+});
+
+test("hidden Xueqiu permalink cannot target a feed card; detail metadata remains optional", () => {
+ const doc = fixture("xueqiu"), target = platformTarget(xueqiuUrl);
+ doc.querySelector("a.time time").setAttribute("hidden", "");
+ expect(readXueqiu(doc, target, xueqiuUrl).clip.publishedAt).toBeUndefined();
+ doc.querySelector("a.time").setAttribute("hidden", "");
+ expect(xueqiuCardTarget(doc.querySelector(".article__container"))).toBeNull();
+ expect(readXueqiu(doc, target, xueqiuUrl).clip.publishedAt).toBeUndefined();
+});
+
+test("BOSS hidden section headings cannot leak into Markdown", () => {
+ const doc = fixture("boss"), heading = doc.querySelector(".job-detail-company h3");
+ heading.setAttribute("hidden", ""); heading.textContent = "Hidden heading sentinel";
+ expect(readBoss(doc, bossUrl).clip.markdown).not.toContain("Hidden heading sentinel");
+});
diff --git a/apps/extension/vite.config.ts b/apps/extension/vite.config.ts
index 0ce506af..6d0381b4 100644
--- a/apps/extension/vite.config.ts
+++ b/apps/extension/vite.config.ts
@@ -2,7 +2,7 @@ import { fileURLToPath, URL } from "node:url";
import { readFile } from "node:fs/promises";
import { createRequire } from "node:module";
import { build as buildStandaloneScript } from "esbuild";
-import { defineConfig } from "vite";
+import { defaultClientConditions, defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import extensionPackage from "./package.json";
@@ -15,7 +15,7 @@ const require = createRequire(import.meta.url);
export default defineConfig({
root: fileURLToPath(new URL(".", import.meta.url)),
- resolve: { alias: { "@": fileURLToPath(new URL("../web/src", import.meta.url)) }, dedupe: ["react", "react-dom"] },
+ resolve: { conditions: ["worker", ...defaultClientConditions], alias: { "@": fileURLToPath(new URL("../web/src", import.meta.url)) }, dedupe: ["react", "react-dom"] },
plugins: [
react(),
tailwindcss(),
diff --git a/apps/web/src/components/WorkspaceApp.tsx b/apps/web/src/components/WorkspaceApp.tsx
index 27110944..b47fa184 100644
--- a/apps/web/src/components/WorkspaceApp.tsx
+++ b/apps/web/src/components/WorkspaceApp.tsx
@@ -671,6 +671,7 @@ export const WorkspaceApp = ({
const notebooksQuery = useQuery({
queryKey: ["notebooks"],
queryFn: () => repository.listNotebooks(),
+ networkMode: "offlineFirst",
});
const templatesQuery = useQuery({
@@ -1069,6 +1070,8 @@ export const WorkspaceApp = ({
[notebooks, selectedNotebookId, selectedTag, showDescendantNotes]
);
const memosQuery = useInfiniteQuery({
+ // Repository reads can resolve from IndexedDB without a network request.
+ networkMode: "offlineFirst",
queryKey: ["memos", memoView, selectedNotebookId, search, memoFilterMode, memoSortMode, selectedNotebookScopeIds, selectedTag],
queryFn: ({ pageParam }) => repository.listMemos({
notebookId: memoView === "notebook" && !selectedTag ? selectedNotebookId : null,
@@ -1165,12 +1168,14 @@ export const WorkspaceApp = ({
}, [rendererRecoveryMode, selectedMemoId]);
const memoQuery = useQuery({
+ networkMode: "offlineFirst",
queryKey: detailMemoId ? memoDetailQueryKey(detailMemoId, memoView) : ["memo", detailMemoId, memoView],
queryFn: () => repository.getMemo(detailMemoId as string, memoView === "trash"),
enabled: Boolean(detailMemoId),
});
const prefetchMemoDetail = useCallback((memoId: string) => {
void queryClient.prefetchQuery({
+ networkMode: "offlineFirst",
queryKey: memoDetailQueryKey(memoId, memoView),
queryFn: () => repository.getMemo(memoId, memoView === "trash"),
});
diff --git a/apps/web/src/components/editor/editor-pane-helpers.test.mjs b/apps/web/src/components/editor/editor-pane-helpers.test.mjs
index 36f707b2..df60a17d 100644
--- a/apps/web/src/components/editor/editor-pane-helpers.test.mjs
+++ b/apps/web/src/components/editor/editor-pane-helpers.test.mjs
@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import {
+ resetEditorDocument,
shouldInsertDroppedResourceFiles,
shouldRetryCreatedMemoFocus,
} from "./editor-pane-helpers.ts";
@@ -48,18 +49,6 @@ describe("created memo focus retry", () => {
});
});
-describe("editor document reset", () => {
- test("rebuilds EditorState from JSON so undo history does not follow a memo switch", () => {
- const source = readFileSync(new URL("./editor-pane-helpers.ts", import.meta.url), "utf8");
-
- expect(source).toContain("export const resetEditorDocument");
- expect(source).toContain("releaseEditorMedia(editor)");
- expect(source).toContain("editor.view.updateState(EditorState.create({");
- expect(source).toContain("doc: editor.schema.nodeFromJSON(content)");
- expect(source).toContain("plugins: editor.state.plugins");
- });
-});
-
describe("dropped resource files", () => {
const fileTransfer = {
items: [{ kind: "file", getAsFile: () => new File(["png"], "preview.png", { type: "image/png" }) }],
@@ -100,3 +89,25 @@ describe("editor outline demo preference wiring", () => {
});
});
+
+test('document reset keeps reused image sources, releases removed media and clears undo history',async()=>{
+ const {parseHTML}=await import('linkedom'),{Schema}=await import('@tiptap/pm/model'),{EditorView}=await import('@tiptap/pm/view'),{EditorState}=await import('@tiptap/pm/state'),{history,undoDepth}=await import('@tiptap/pm/history');
+ const {window}=parseHTML('<html><body><div id="editor"></div></body></html>');
+ const values={window,document:window.document,Node:window.Node,HTMLElement:window.HTMLElement,Element:window.Element,MutationObserver:window.MutationObserver,getComputedStyle:()=>({whiteSpace:'pre-wrap'}),navigator:{userAgent:'test'}};
+ const originals=new Map(Object.keys(values).map(key=>[key,Object.getOwnPropertyDescriptor(globalThis,key)]));
+ for(const [key,value] of Object.entries(values))Object.defineProperty(globalThis,key,{value,writable:true,configurable:true});
+ let view;
+ try {
+ const schema=new Schema({nodes:{doc:{content:'block*'},paragraph:{content:'text*',group:'block',toDOM:()=>['p',0]},text:{group:'inline'},image:{group:'block',attrs:{src:{}},toDOM:node=>['img',{src:node.attrs.src}]}}});
+ const content={type:'doc',content:[{type:'paragraph',content:[{type:'text',text:'One'}]},{type:'image',attrs:{src:'/api/v1/resources/test/blob'}}]};
+ view=new EditorView(window.document.getElementById('editor'),{state:EditorState.create({schema,doc:schema.nodeFromJSON(content),plugins:[history()]})});
+ const editor={view,schema,get state(){return view.state;}};
+ view.dispatch(view.state.tr.insertText(' edit',4));expect(undoDepth(view.state)).toBe(1);
+ const image=view.dom.querySelector('img');resetEditorDocument(editor,content);
+ expect(view.dom.querySelector('img')).toBe(image);expect(image.getAttribute('src')).toBe('/api/v1/resources/test/blob');expect(undoDepth(view.state)).toBe(0);
+ resetEditorDocument(editor,{type:'doc',content:[{type:'paragraph',content:[{type:'text',text:'Another memo'}]}]});
+ expect(view.dom.querySelector('img')).toBeNull();expect(image.getAttribute('src')).toBe('');
+ } finally {
+ view?.destroy();for(const [key,descriptor] of originals){if(descriptor)Object.defineProperty(globalThis,key,descriptor);else delete globalThis[key];}
+ }
+});
diff --git a/apps/web/src/components/editor/editor-pane-helpers.ts b/apps/web/src/components/editor/editor-pane-helpers.ts
index 767feda7..e4f8fdaf 100644
--- a/apps/web/src/components/editor/editor-pane-helpers.ts
+++ b/apps/web/src/components/editor/editor-pane-helpers.ts
@@ -86,15 +86,19 @@ export const releaseEditorMedia = (editor: Editor) => {
/**
* Replace the document with a fresh EditorState so undo/redo cannot leak
* across memos. Cheaper than destroying the TipTap view on every switch.
- * Releases decoded images from the previous document first.
+ * Release removed media after updating; unchanged image NodeViews are reused.
*/
export const resetEditorDocument = (editor: Editor, content: TiptapDoc) => {
- releaseEditorMedia(editor);
+ const root=editor.view.dom;
+ const previousMedia=Array.from(root.querySelectorAll("img, iframe, embed, object, video, audio, source, canvas"));
editor.view.updateState(EditorState.create({
schema: editor.schema,
doc: editor.schema.nodeFromJSON(content),
plugins: editor.state.plugins,
}));
+ releaseHtmlMediaSources({
+ querySelectorAll: (selector)=>previousMedia.filter(node=>node.matches(selector) && !root.contains(node)),
+ });
};
export const CREATED_MEMO_FOCUS_MAX_ATTEMPTS = 120;
diff --git a/bun.lock b/bun.lock
index 43665c03..49a3d89b 100644
--- a/bun.lock
+++ b/bun.lock
@@ -127,6 +127,10 @@
"react-dom": "~19.2.7",
"sonner": "2.0.8",
"turndown": "^7.2.4",
+ "@joplin/turndown-plugin-gfm": "1.0.68",
+ "mdast-util-from-markdown": "2.0.3",
+ "mdast-util-gfm": "3.1.0",
+ "micromark-extension-gfm": "3.0.0",
},
"devDependencies": {
"web-ext": "^10.7.0",
@@ -329,6 +333,7 @@
+ "@joplin/[email protected]": "patches/@joplin%[email protected]",
},
"overrides": {
"dompurify": "3.4.16",
@@ -1087,6 +1092,8 @@
"@jest/types": ["@jest/[email protected]", "", { "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw=="],
+ "@joplin/turndown-plugin-gfm": ["@joplin/[email protected]", "https://registry.npmmirror.com/@joplin/turndown-plugin-gfm/-/turndown-plugin-gfm-1.0.68.tgz", {}, "sha512-m8DfAQNC/V7g0j5H6Jv60WhekBBjodD+zTPGrU+g2m+ux/z8ZX07KQIl6kaAmbKwfvsQhC04op52g63I78sVgg=="],
+
"@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
"@jridgewell/remapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
diff --git a/docs/browser-clipper-platform-expansion-plan.md b/docs/browser-clipper-platform-expansion-plan.md
index 91ddc70c..faf1c754 100644
--- a/docs/browser-clipper-platform-expansion-plan.md
+++ b/docs/browser-clipper-platform-expansion-plan.md
@@ -2,7 +2,7 @@
[简体中文](browser-clipper-platform-expansion-plan.zh-CN.md)
-Related: [Issue #493](https://github.com/tianma-if/edgeever/issues/493). Updated: 2026-10-10. The user confirmed that Phase 1 contains **Facebook, Instagram, LinkedIn, Threads and Bluesky**. See [usage and verification](browser-clipper-platforms.md).
+Related: [Issue #493](https://github.com/tianma-if/edgeever/issues/493). Updated: 2026-10-15. The user confirmed that Phase 1 contains **Facebook, Instagram, LinkedIn, Threads and Bluesky**. See [usage and verification](browser-clipper-platforms.md).
## Delivery phases
@@ -11,7 +11,8 @@ Related: [Issue #493](https://github.com/tianma-if/edgeever/issues/493). Updated
| 1 | Facebook, Instagram, LinkedIn, Threads, Bluesky | One selected post, its complete readable text, available author and publication time, images, and explicit quotations. |
| 2 | BOSS Zhipin, Xueqiu, Xiaoyuzhou | Job details; investment posts and explicit stock identifiers; full episode Show Notes and timestamps. |
| 3 | WeChat Official Accounts, Jike, V2EX, Substack, Medium | Articles, posts and topic supplements, preserving structure and original metadata. |
-| To schedule | Sspai, Juejin, Douban, further Hacker News work | Article/code structure, reviews and submission metadata. |
+| Requested supplement | Sspai, Juejin, Douban | Article/code structure, long/short reviews and diaries. |
+| Existing implementation | Hacker News | Reuse the merged reader's main-post text/link, author, score and submission time. |
Deliver independent PRs per phase. Earlier local Hacker News, V2EX and Xiaoyuzhou work remains available but does not redefine Phase 1.
@@ -19,9 +20,11 @@ Deliver independent PRs per phase. Earlier local Hacker News, V2EX and Xiaoyuzho
The toolbar clips a supported post detail page; a valid text selection retains priority. The platform command in a page context menu selects the post under the pointer, including supported feed cards. A small content script remembers only the clicked card’s permalink; it performs no network requests or automatic capture. Feed pages without a resolvable card prompt the user to open the post and retry.
+Fix the target and initial selection before queueing. Later right-clicks or selections during feedback or waiting do not change that job. Matching selections retain rich content; changed or lost selections save only the original selected text without falling back to the whole page. Navigation still cancels saving, while code blank lines and literal Markdown characters retain their meaning.
+
Readers validate the selected post ID against its own header permalink or activity URN. Links in the body, comments and quoted posts do not establish the parent post’s identity. Navigation and message correlation are checked again before note creation. An unreadable recognized post fails explicitly rather than falling back to the entire page.
-Only content already readable in the current page is captured. Facebook and LinkedIn expand a local post control when necessary, with a bounded wait. Instagram and Threads use loaded post data only when the same caption is readable in the matching DOM card. Missing carousel items and hidden collection remainders fail as incomplete. No login, private API, background crawling, video download or transcription is added.
+Only readable content is captured. Xueqiu feed context menus may request the selected card’s public detail HTML on the current origin, retaining the existing page session and validating the post identity; private APIs and content behind login/challenge walls are excluded. Facebook and LinkedIn expand a local post control when necessary, with a bounded wait. Instagram and Threads use loaded post data only when the same caption is readable in the matching DOM card. Missing carousel items and hidden collection remainders fail as incomplete. No login, private API, background crawling, video download or transcription is added.
Metadata includes canonical source URL, available author, separate publication and capture times, `web-clip` and the platform’s stable tag. Known timestamps use the browser system timezone at capture and `yyyy-MM-dd HH:mm:ss`; missing, date-only and relative values are not fabricated. Saved text is stable after later device timezone changes. Comments, controls and unrelated feed cards are excluded; scripts, dangerous protocols and active HTML are removed or escaped.
@@ -49,3 +52,11 @@ bunx playwright test tests/e2e/web-clipper-platforms.spec.ts --project=chromium
```
Record code/test status separately from commit, PR, store publication and live acceptance. Signed-out samples and Chromium integration do not establish authenticated feed behavior or Edge/Firefox runtime acceptance. Page structure changes can cause a refusal or incomplete extraction; fail closed and retain explicit partial-image feedback. Rollback removes the affected route, menu and reader without changing saved notes or data. Preserve unrelated workspace changes.
+
+Phase 1 merged in PR #521. Phase 2 now adds BOSS jobs and Xueqiu details, and verifies the existing Xiaoyuzhou timeline/explicit-host flow; see the Phase 2 scope and limits in the linked verification document.
+
+2026-10-14: the user authorized completing the remaining listed platforms in the existing P2 contribution worktree. WeChat, Jike, Sspai, Juejin and Douban readers and menus are now implemented locally. V2EX, Substack and Medium retain their existing implementation. No additional branch or PR was created; commit, push and publication remain separate. See the latest usage/verification section for login badges, Douban comment-list targeting and acceptance limits.
+
+2026-10-15: Completed Medium/Substack metadata/tags, Jike H5 topic-card targeting and P1 visibility/media/optional-metadata boundaries against the user guidelines. Actual Substack paid previews show restriction guidance and reject whole-article saving. Real-image acceptance also repairs Web document reset clearing reused images. Cache prerequisites and unverified client boundaries are recorded in the current platform guide.
+
+2026-10-15 addition: synchronized the existing contribution branch with upstream `7b03c8db` and retained the current React extension popup. Added selected-card public-detail capture for Xueqiu feeds and LinkedIn personal professional headlines plus distinct `share` identities. Temporary detail frames disable scripts, retain browser-computed CSS visibility and are removed after success, failure or timeout.
diff --git a/docs/browser-clipper-platform-expansion-plan.zh-CN.md b/docs/browser-clipper-platform-expansion-plan.zh-CN.md
index f498e9be..fc888465 100644
--- a/docs/browser-clipper-platform-expansion-plan.zh-CN.md
+++ b/docs/browser-clipper-platform-expansion-plan.zh-CN.md
@@ -2,7 +2,7 @@
[English](browser-clipper-platform-expansion-plan.md)
-关联:[Issue #493](https://github.com/tianma-if/edgeever/issues/493)。更新于 2026-10-10。用户已确认 Phase 1 为 **Facebook、Instagram、LinkedIn、Threads 和 Bluesky** 五个平台。见[使用说明与验证记录](browser-clipper-platforms.zh-CN.md)。
+关联:[Issue #493](https://github.com/tianma-if/edgeever/issues/493)。更新于 2026-10-15。用户已确认 Phase 1 为 **Facebook、Instagram、LinkedIn、Threads 和 Bluesky** 五个平台。见[使用说明与验证记录](browser-clipper-platforms.zh-CN.md)。
## 交付阶段
@@ -11,7 +11,8 @@
| 1 | Facebook、Instagram、LinkedIn、Threads、Bluesky | 用户选中的单帖、完整可读正文、可用作者与发布时间、图片和明确引用。 |
| 2 | BOSS 直聘、雪球、小宇宙 | 岗位详情;投资帖及明确股票标识;单集完整 Show Notes 和时间轴。 |
| 3 | 微信公众号、即刻、V2EX、Substack、Medium | 文章、动态、主题附言,保留结构与原始元数据。 |
-| 待排期 | 少数派、掘金、豆瓣及 Hacker News 后续工作 | 文章与代码结构、评论、投稿元数据。 |
+| 本次要求补齐 | 少数派、掘金、豆瓣 | 文章/代码结构、长短评与日记。 |
+| 已有实现 | Hacker News | 沿用已合并读取器的主帖正文/外链、作者、积分和提交时间。 |
各阶段独立提交 PR。先前本地 Hacker News、V2EX、小宇宙改动继续保留,但不再作为 Phase 1 的定义。
@@ -19,9 +20,11 @@
工具栏剪藏支持的单帖详情页;有效文本选区保持优先。页面右键菜单的平台命令定位指针下的帖子,也支持可识别的信息流卡片。小型内容脚本只记住被点击卡片的永久链接,不发起网络请求或自动抓取。信息流无法确定卡片时,提示打开单帖后重试。
+保存入队前固定目标与初始选区,保存提示或等待期间的新右键/选区不改变当前任务。选区仍匹配时保留富文本;改变或消失时仅保存最初选中的文字,不回退整页。导航仍取消保存,代码空行与文字中的 Markdown 符号保持可读原意。
+
读取器使用帖头自身永久链接或 activity URN 校验目标 ID。正文、评论及引用帖中的链接不能证明父帖身份。创建笔记前再次检查页面导航与消息关联。已识别但不可读的帖子明确失败,不退回整页抓取。
-仅保存当前页面已可读的内容。Facebook、LinkedIn 必要时点击帖内展开按钮并限时等待。Instagram、Threads 只有在对应 DOM 卡片中可读相同配文时,才使用已加载的帖子数据。轮播缺项或图片合集仍有隐藏项时报告不完整。不会新增登录、私有 API、后台爬取、视频下载或转写。
+仅保存可读的内容。雪球信息流的右键采集可在当前域请求选中卡片的公开详情 HTML,沿用现有页面会话并核验帖子身份,不读取私有接口或登录/验证墙后的内容。Facebook、LinkedIn 必要时点击帖内展开按钮并限时等待。Instagram、Threads 只有在对应 DOM 卡片中可读相同配文时,才使用已加载的帖子数据。轮播缺项或图片合集仍有隐藏项时报告不完整。不会新增登录、私有 API、后台爬取、视频下载或转写。
元数据包含规范来源 URL、可用作者、独立的发布时间与抓取时间、`web-clip` 和稳定平台标签。已知时间点按剪藏时浏览器系统时区格式化为 `yyyy-MM-dd HH:mm:ss`;不补造缺失信息、日期精度或相对时间。后续设备时区变化不会改变已保存正文。剔除评论、操作控件及其他信息流卡片,清理或转义脚本、危险协议和活动 HTML。
@@ -49,3 +52,11 @@ bunx playwright test tests/e2e/web-clipper-platforms.spec.ts --project=chromium
```
分别记录代码/测试、提交、PR、商店发布和真实页面验收状态。未登录样本及 Chromium 集成结果不能证明登录后信息流或 Edge/Firefox 运行时已通过。页面结构变化可能导致拒绝或提取不全,以明确失败和图片部分成功反馈约束风险。回滚可移除对应路由、菜单、读取器,不改变已存笔记及数据。保护工作区其他改动。
+
+Phase 1 已由 PR #521 合并。Phase 2 新增 BOSS 岗位与雪球详情,并核验已有小宇宙时间轴/明确主播流程;范围和验收边界见关联验证文档的 Phase 2 一节。
+
+2026-10-14:用户已授权在既有 P2 贡献工作区补齐其余列出的平台。微信公众号、即刻、少数派、掘金和豆瓣的读取器与菜单已在本地实现;V2EX、Substack 和 Medium 沿用已有实现。未创建额外分支或 PR,提交、推送与发布仍分别记录。登录角标、豆瓣短评列表定位与验收边界见最新使用/验证章节。
+
+2026-10-15:按用户技术规范补齐 Medium/Substack 元数据与标签、即刻 H5 话题卡片定位及 P1 隐藏内容/媒体/可选元数据边界。真实 Substack 付费预览显示受限提示并拒绝整篇保存;真实图片验收同时修复 Web 文档重置清空复用图片的问题。客户端离线缓存前提及未验证范围见最新使用说明。
+
+2026-10-15 补充:在原贡献分支同步上游 `7b03c8db`,迁移到现有 React 扩展弹窗;补齐雪球信息流右键读取选中卡片的公开详情,以及 LinkedIn 个人职业简介与 `share` 身份。临时详情预览框禁用脚本、保留浏览器计算的 CSS 可见性并在完成/失败/超时后移除。
diff --git a/docs/browser-clipper-platforms.md b/docs/browser-clipper-platforms.md
index fc755350..bd7ac114 100644
--- a/docs/browser-clipper-platforms.md
+++ b/docs/browser-clipper-platforms.md
@@ -2,7 +2,188 @@
[简体中文](browser-clipper-platforms.zh-CN.md)
-Related to [Issue #493](https://github.com/tianma-if/edgeever/issues/493) and the [implementation plan](browser-clipper-platform-expansion-plan.md). Updated: 2026-10-11. Phase 1 implementation is prepared for PR review; extension-store publication and full cross-browser live acceptance remain pending.
+Related to [Issue #493](https://github.com/tianma-if/edgeever/issues/493) and the [implementation plan](browser-clipper-platform-expansion-plan.md). Updated: 2026-10-15. Phase 1 is merged; Phase 2 and the remaining requested adapters are implemented locally; extension-store publication and full cross-browser live acceptance remain pending.
+
+## 2026-10-15 PR submission verification
+
+This submission uses latest upstream `72ab4816` and includes P2/follow-up article adapters plus repairs to merged P1. Upstream note duplication merges cleanly with the Web changes. This submission includes only the 83 task files; unrelated Android caches are excluded.
+
+After integration, 3,529 bulk tests, 17 API integrations and 13 desktop authentication integrations pass: 3,559 total, including 427 extension tests. Root/mobile typechecking, Web and Chromium/Firefox extension builds pass; Firefox lint reports 0 errors, 0 notices and 7 dependency warnings. The 31-source Chromium save/attachment-readback flow and two HTML safety checks pass. Blank-line whitespace cleanup preserves the complete extraction results and preformatted text in all six affected fixtures; 67 related tests pass.
+
+The first browser rerun finds a stale local Wrangler asset manifest after rebuilding Web: new JavaScript paths return HTML. Restarting this task's local development service restores the correct MIME types and the complete regression passes. Production code and test timeouts are unchanged. Post-test API/backup ID comparison confirms that all original 17 notes and one token remain.
+
+This is a staged contribution associated with #493. Store publication, full-content acceptance of the current login-truncated BOSS page and native Edge/Firefox saving remain pending. Older statements such as “not committed” below describe their respective review rounds.
+
+## 2026-10-15 Save and text fidelity review
+
+This pass fixes six reproduced defects:
+
+- Sspai authors come only from the current article, retaining coauthors and optional absence while excluding unrelated or hidden author cards.
+- An odd number of backslashes before a pipe in table code no longer splits columns or drops later cells. Fragments that GFM cannot represent losslessly use escaped plain text, preserving characters and cell boundaries; other code styling remains.
+- Image archival rewriting preserves title entities, line breaks and table pipes, preventing lost images or shifted columns after upload.
+- Platform context menus fix the selected permalink before showing saving feedback, so another right-click during feedback injection cannot replace the target.
+- Generic, platform and feed toolbar saves record the initial selection and whole-page mode before joining the queue; selection menus use the browser-provided original text. Changed or lost selections save only the original plain text, while matching selections retain rich content and pictures. Plain-text fallback uses character entities to avoid reinterpreting headings, indentation, URLs or HTML. Navigation still stops saving. Login pages and lists without an initial selection never fall back to whole-page capture.
+- Selection-menu saving no longer globally compresses blank lines, preserving consecutive blank lines inside code.
+
+The final full non-E2E run passes 3,505 bulk tests (including 427 extension tests), 17 API integrations and 13 desktop authentication integrations: 3,535 total. Root/mobile typechecking, Web and Chromium/Firefox extension builds pass; Firefox lint reports 0 errors, 0 notices and 7 dependency warnings. The current build passes the 31-source Chromium save/attachment-readback flow and two HTML safety checks. Jike feed images use the real CDN; other images remain controlled PNGs. API/backup ID comparison confirms that all original 17 notes and one token remain, with no additional notes. Correctness, design and simplification reviews have no unhandled substantive findings.
+
+These repairs remain local in the contribution worktree, without a commit, push or PR. The user controls the ego-lite acceptance space, so its installed extension was not reloaded this round. The current login-truncated BOSS page, native Edge/Firefox saving and other authenticated layouts still need live acceptance; older records below describe their respective revisions only.
+
+## 2026-10-15 Upstream synchronization and remaining gaps
+
+The existing contribution worktree and branch now use upstream baseline `7b03c8db`, retaining the clipper changes and adapting them to the current React popup. Login/content-restriction badges and guidance remain visible; saving, error and success feedback take priority, while explicit selections remain allowed. The removed legacy popup stylesheet is not restored.
+
+A context-menu capture on a truncated Xueqiu feed card renders only its own public detail in a temporary same-origin frame, retaining the existing page session and browser-computed CSS visibility. The frame uses `sandbox="allow-same-origin"` without scripts and is removed after success, failure or timeout. Wrong identities, CSS-hidden bodies, recycled cards, navigation and inaccessible content create no note. The pointer listener still performs no network requests. Live Ego verification covers a current selected card, public detail reading and cleanup; real-source fixtures separately cover full long text and images.
+
+LinkedIn personal professional headlines are read separately from author names and publication times, and saved as “Author: Name · Professional headline”. The `activity`, `ugcPost` and `share` namespaces remain distinct. Connection degrees, follower counts and nested-post metadata cannot supply the author, headline or time. The real personal sample is Mohammad Ahmed / Technical Lead - Backend at Dizzaract.
+
+Post-sync local macOS non-E2E checks pass: 3,490 bulk tests, 17 API integration tests and 13 desktop authentication integration tests, including 412 extension tests. Root/mobile typechecking, Web and Chromium/Firefox extension builds pass. Firefox lint reports 0 errors, 0 notices and 7 warnings: four from the new upstream React DOM bundles, two existing Readability warnings and one mdast internal-parser warning; checks remain enabled. Rebuilding stale ProseMirror installation links resolves the type conflict without changing dependency versions or business types.
+
+The current 31-source Chromium saving flow passes, covering body/metadata, attachment rewriting and readback, reopening the editor after source blocking, CSS-hidden detail refusal, temporary-frame script isolation/cleanup, and React login/paid-preview guidance. Two additional HTML-safety checks pass. The Jike feed case uses its real CDN and verifies the attachment hash, browser decoding and reopening a cached note offline; the remaining images use controlled PNGs, not renewed live-CDN acceptance. Tests now verify the required rows in the upstream virtualized list instead of counting all DOM rows.
+
+The first run stopped at a Vite session-forwarding timeout; a later Wrangler log records a `ProxyController` error and process exit. The complete flow ultimately passes through the same workerd’s internal Web/API address. No development-server changes, retries or larger timeouts were added, and the proxy defect is not claimed as permanently fixed. Interrupted-run data is cleaned up. API IDs match all 17 original backup notes with zero additional notes, and the token count returns to the original one. The local extension is reloaded and the same eight-page ego-lite acceptance space is retained. No commit, push, PR or publication was performed.
+
+The current live BOSS page still has a login-truncated body and no readable salary, so full-content acceptance is not established. Native Edge/Firefox saving and other signed-in layouts remain unverified. Earlier records below apply only to their corresponding revisions.
+
+## 2026-10-15 Cross-platform defect review
+
+The earlier acceptance defects were checked across P1, P2 and the other requested readers. This pass fixes single-newline loss in Douban music reviews, invisible V2EX text/metadata and visible descendants of hidden supplement containers, nested-post body attribution in Facebook/Bluesky/LinkedIn, and hidden header links changing the context-menu target. Medium, Substack, generic pages and explicit selections now share the HTML-to-Markdown converter without compressing blank lines inside code.
+
+Shared table conversion preserves rows, columns, images and cell line breaks rather than displaying an HTML fallback as source text. Only attribute-free `<br>` tokens inside table cells become hard breaks; arbitrary HTML remains literal. Rich cell blocks become readable inline content, not nested list/quote/code-block nodes. Vertical spans repeat their value within their original row group; horizontal spans use empty placeholders. Additional header rows remain data rows. Image rewriting now uses parser source positions and label boundaries, preserving escaped examples, code, references, nested labels and table images. Generic/selection entry points also report partial image archival.
+
+An isolated experiment with the installed Wrangler proxy reproduces 7 failures in 50 edit/save pairs when the upstream leaves `{}` unread. Reading the body, applying Wrangler's drain middleware, or sending no body each produces 0/50 failures. The extension removes its unnecessary edit-session request body; API and other clients remain unchanged, and this is not a claim that every Wrangler connection fault is fixed. Substack's actual article and Note now archive 3/3 and 1/1 images through the configured `http://127.0.0.1:8787` endpoint. All four attachments decode and match source SHA-256 hashes; both temporary notes and all four attachments are deleted, preserving the 17 existing notes.
+
+All 387 extension tests and 346 shared/editor tests pass, as do root/mobile typechecks, the Web build and Chromium/Firefox extension builds. Firefox lint has 0 errors, 0 notices and 3 warnings: the two existing Readability warnings and a false positive for mdast's internal parser `document().write()` method, which does not access a browser document. The background bundle is also exercised without a DOM. Independent correctness, design and simplification reviews have no remaining actionable findings in this scope. The dependency patch is verified with a clean isolated install.
+
+The same eight-page ego-lite acceptance space is retained. Native toolbar/context-menu clicks, authenticated layouts without samples and complete cross-browser acceptance remain pending. Existing notes are not rewritten automatically. No commit, push or publication is performed.
+
+## 2026-10-15 P1 actual-image verification
+
+All five P1 platforms continue through `page-images`. The actual Bluesky full-size image is downloadable, but extension and source-page fetches fail CORS with the browser reporting `MissingAllowOriginHeader`. This pass adds only `https://cdn.bsky.app/*` host access, verified natively after reloading the local extension. No unnecessary CDN permissions are added for the other four platforms.
+
+Current ego-lite pages supply the extracted text and images. The extension page downloads actual CDN bytes; the shared archival function uploads and rewrites temporary notes through the original configured `http://127.0.0.1:8787` endpoint. Browser readback verifies Facebook 1/1, Instagram 3/3, LinkedIn 8/8, Threads 4/4 and Bluesky 1/1. All 17 attachments return HTTP 200, match the source SHA-256 hashes and decode successfully, with zero external images in these temporary notes. Facebook uses the current post header's permalink; identity matching is not relaxed to guess old-link aliases.
+
+Instagram's first attempt archives 2/3 despite downloading all three images. A separate check supplies the missing attachment to that same temporary note, so the final result does not establish complete archival in one save. An additional Medium sample passes download, archival and readback for two actual images. Substack's article and Note download and upload all 3+1 images, but each final rewrite encounters a local proxy 503 and cannot be marked archived. The fault recurs after restart. Its symptoms agree with the [upstream Wrangler proxy connection-race report](https://github.com/cloudflare/workers-sdk/issues/14641), but this pass does not prove the precise underlying trigger, change Wrangler, add product retries or claim a permanent fix.
+
+All 370 extension tests and Chromium/Firefox builds pass; Firefox lint retains the two existing Readability warnings. Native toolbar/context-menu clicks and complete cross-browser acceptance remain manual; source-page permissions are not granted by script in place of the user. Temporary notes and attachments are removed after verification, preserving existing notes. The local extension is reloaded and P1 pages are available in the same acceptance space. No commit, push or publication is performed.
+
+## 2026-10-15 Image downloads and attachment rewriting
+
+Existing acceptance notes retain 16 external images in the latest WeChat sample, all external images in the Xueqiu and Jike samples, and mixed results for Sspai. WeChat's CDN lacks extension host access and rejects in-page CORS reads. Sspai's CDN returns 403 without a referrer and valid images with the Sspai root referrer. The extension adds `https://mmbiz.qpic.cn/*` and `https://cdnfile.sspai.com/*` host access and shares the existing Douban header-rule module with Sspai. Each rule affects only this extension's own HTTPS GETs to the corresponding CDN, without source article paths or queries. Downloads, uploads, edit-conflict protection and URL rewriting continue through `page-images`.
+
+This pass also reproduces a local Wrangler proxy 503 on the final `/save`: all 21 images upload, but the note retains all 21 external URLs. After restarting the current local development services, the original configured `http://127.0.0.1:8787` endpoint completes actual CDN downloads, temporary-note uploads and rewriting for WeChat 21/21, Xueqiu 3/3, Jike 1/1, Sspai 9/9, Douban 6/6, Juejin 2/2 and the Xiaoyuzhou cover 1/1. All 43 attachments read back with HTTP 200, match their downloaded SHA-256 hashes and decode successfully in the browser; the temporary notes retain zero external images. This verifies recovery of that endpoint's archival flow after restart, without changing Wrangler or claiming a permanent fix for the proxy's underlying fault.
+
+All 370 extension tests, root typechecking and Chromium/Firefox builds pass. Firefox lint retains only the two existing Readability warnings. Toolbar/context-menu bundle regressions cover the Sspai source-header rule; ego-lite verifies native host access, request rules, shared archival and attachment readback. Native toolbar/context-menu clicks remain for manual acceptance. Temporary notes and attachments are removed after verification; existing notes are not rewritten automatically. The local extension is reloaded; clip again to apply the fix. No commit or publication is performed.
+
+## 2026-10-15 Douban review paragraphs and images
+
+Douban reviews use `white-space: pre-wrap`, making blank lines within one HTML paragraph meaningful paragraph boundaries. The reader now restores them on a detached copy, retaining emphasis and links across boundaries without splitting code's own blank lines. The sample review retains all seven displayed paragraphs instead of two merged paragraphs, preserving its six image positions.
+
+The previous acceptance note contains six external images and no archived attachments. The CDN returns 418 without a Douban referrer, while in-page fetch is restricted by CORS. The extension adds `https://*.doubanio.com/*` host access and `declarativeNetRequestWithHostAccess`. A session rule matches only this extension's own HTTPS GETs for `img[0-9].doubanio.com/view/` images and sets the Douban root referrer, without the source page path or query. Images retain the existing `page-images` byte/time limits, upload and URL rewriting path, with partial-archival feedback on failure. Upgrades may require confirmation of the added site permission.
+
+After reloading the local extension in ego-lite, the native request rule enables 200 responses for all six actual CDN WebP files. The shared `page-images` flow archives and rewrites all six images in a temporary note. Readback through the configured instance retains seven body paragraphs and zero external images; each attachment's SHA-256 matches its source and all six decode in the browser as valid 1080-pixel-wide images. That pass's complete upload/save verification uses the same API worker's internal address: the regular local Wrangler proxy returned `503 / Your worker restarted mid-request` during one upload and a subsequent save. Extension settings and development services were unchanged at that time; the later verification through the original endpoint is recorded above. Native toolbar/context-menu clicks remain for manual acceptance. This live check separately covers real DOM extraction, extension CDN requests, the shared archival flow and API/browser readback.
+
+All 368 extension tests, root typechecking and Chromium/Firefox builds pass. Firefox lint has no errors/notices and two existing Readability warnings. E2E adds paragraph-boundary assertions and passes test collection; the complete E2E is not rerun. Both temporary notes are cleaned up, preserving existing notes. Existing notes are not rewritten.
+
+## 2026-10-15 Juejin table structure
+
+Manual acceptance found that Juejin's three-column summary table became continuous text. Both the live page and fixture retain the complete HTML table; the shared converter lacked table rules. Capture now uses Joplin's Turndown table plugin to produce GFM tables, retaining headers, rows, columns, links and inline code. Only table rules are enabled. Captions are converted as normal rich-text paragraphs so literal HTML cannot become markup. A pinned dependency patch preserves repeated `||` characters that the plugin otherwise collapses.
+
+On the same live Juejin page in ego-lite, the note editor's Markdown parser produces one three-column table with one header and four body rows. Every cell and the “事件循环” link match the source; two images, original publication time and source DOM stay unchanged. All 363 extension tests, root/mobile typechecks, Web and Chromium/Firefox extension builds, and diff checks pass. Frozen-lockfile installation passes; existing dependency versions are retained, adding only the table dependency and patch. Actual toolbar/context-menu bundle regressions verify tables before and after image URL rewriting. E2E adds editor row/column assertions; this pass verifies collection only, without rerunning the complete browser persistence suite. Complex merged cells, nested tables and multiline rich content inside cells are outside this acceptance pass. Reload the local extension and clip again; existing notes are not rewritten.
+
+## 2026-10-15 Sspai article updates
+
+Manual acceptance found that Sspai places article updates in a separate block beside the main body, which the reader previously omitted. Capture now appends the same article's visible updates in page order. Each update becomes a separate blockquote containing its displayed time, bold title and complete body in source order; update titles are not promoted to section headings. Rich content uses the existing conversion and image archival path. It excludes duplicate update navigation, interactions and sidebars. Missing optional titles/times do not discard readable update text; hidden updates remain excluded and original publication metadata stays separate.
+
+Reading the same live page in ego-lite and parsing its Markdown confirms that the time, bold title “中国大陆推出睡眠呼吸暂停迹象提示功能” and complete explanation share one blockquote with no extra heading elements. The original 2024-10-10 publication date, nine images and source DOM remain unchanged. After the quote-format fix, all 123 related extraction/save tests, root typechecking, Chromium/Firefox builds and diff checks pass. Actual toolbar/context-menu bundle regressions cover update text and image URL rewriting. Browser E2E adds persisted-blockquote assertions; this pass verifies collection only, without rerunning the complete E2E. Reload the local extension and clip again; existing notes are not rewritten.
+
+## 2026-10-15 WeChat body heading hierarchy
+
+The original article title is preserved; only body sections encoded as ordinary paragraphs and typography are repaired. Clearly larger paragraph text is compared with the article's dominant body font size and mapped to heading levels starting at H2. Groups of “第几步:…” step labels sit one level below their section. Existing heading tags, ordinary bold prose, drop caps, numbered actions, quotes, code and captions retain their semantics; heading wording is not rewritten. Bold alone is insufficient when typography provides no heading evidence.
+
+Reading the same live WeChat page in ego-lite confirms three H2 sections and four H3 steps, with the original title, 21 useful images and source DOM unchanged. The fixture now retains the necessary computed font size, weight and alignment to reproduce the visual headings. All 355 extension tests, root typechecking, Chromium/Firefox builds and diff checks passed. Toolbar/menu bundle regressions check heading markers both before and after image URL rewriting. Browser E2E gains heading-element assertions; only test collection was checked in this pass, and the full suite was not run. Reload the rebuilt local extension before clipping again; existing notes are not rewritten.
+
+## 2026-10-15 WeChat manual-acceptance repair
+
+Manual acceptance found that the dedicated WeChat reader retained metadata and the `wechat` tag but still treated publisher banners and decorative images inside `#js_content` as article content. The WeChat path now removes explicit blue-text follow/about prompts and their grouped artwork, decorative GIFs labeled as dividers, native CPS ads, and trailing standalone native article recommendation cards. Tutorial actions, code/quoted wording, meaningful GIFs, and inline references remain; individual words such as “click” or “follow” never trigger paragraph removal. WeChat's sibling-per-line `<code>` widget is normalized into a complete code block instead of retaining only its first line.
+
+This sample now retains its cover and 20 body images, 21 in total. The six removed images are banner artwork, four dividers, and a recommendation thumbnail; the original fixture remains unchanged. Real-bundle toolbar/menu regressions check content and image archival, and reading the same live WeChat page in ego-lite confirms the cleanup and all six model-code lines without modifying its DOM. All 352 extension tests, root typechecking, Chromium/Firefox builds and diff checks passed. Existing notes are not rewritten; reload the rebuilt extension before clipping again. This does not establish live acceptance for every WeChat layout, CDN archival, or the complete save UI.
+
+## 2026-10-15 follow-up review loop
+
+This pass closes six boundaries: selection-menu saves stop when navigation occurs while queued, extracting, or looking up a notebook, while iframe selections keep their own source URL; Substack Notes filter CSS-hidden content before matching their own cards, so a hidden duplicate cannot hide a readable card; Substack gates use actually visible text, including descendants that restore visibility; Jike preserves confirmed originals when image containers or images themselves have button semantics; Medium still recognizes an article shell without a title and refuses failed extraction instead of falling back to generic content; development E2E skips Service Worker and offline-cache checks because the development server disables the PWA, while an explicitly configured built instance runs them. Real CDN transfer, digest checks, and image reads after source blocking remain in the default test path.
+
+Removed the duplicate source-string assertion for Web document reset, retaining the actual DOM reuse, image release, and undo-history regression. All 348 extension tests and seven Web editor tests passed, along with root typechecking and Chromium/Firefox extension builds; E2E test collection passed. Browser E2E and live-site acceptance were not repeated in this pass; browser results below remain evidence from the previous run. Changes remain in the existing contribution worktree, without a commit, push, or release.
+
+## 2026-10-15 guideline completion and P1 fixes
+
+Jike H5 topic feeds reuse `social-target`, `capture-platform` and the existing save queue to capture only the uniquely identified card under the pointer. Medium/Substack articles now retain available authors, original publication time, `web-clip` and `medium`/`substack` tags. Public metadata must identify the current article; missing metadata never blocks readable text. Images use `page-images` and return archival status; download/upload/rewrite failure keeps one note and reports that some images remain external links. Medium calendar dates retain date precision, and relative values remain as displayed.
+
+The actual Substack paid-preview `.paywall` shows an amber “Content restricted” badge and reading-access guidance. Whole-article capture fails, including when the title/body is missing, without generic fallback. Explicit visible selections remain allowed. Paid-article metadata alone does not reject an accessible full article. New messages are synchronized across zh_CN/en/ja/pl.
+
+All five P1 readers filter CSS-hidden content. Missing body text is not restored solely from SEO data. Declared images verify available media; incorrect or missing images cannot be reported as complete. Facebook/LinkedIn literal HTML is escaped at the Markdown text boundary, preserving code blocks. Meta author and publication metadata remain optional. LinkedIn retains its previously supported public JSON-LD full-image/guest-text path; removing irrelevant hidden controls does not reject complete text.
+
+Real-CDN JPEG acceptance exposed a Web editor defect: document reset cleared image nodes that ProseMirror reused. Reset now releases only old media removed from the editor after updating, preserving undo-history isolation. A real ProseMirror regression verifies reused nodes, released old images and zero undo depth after switching. Notebook/list/detail/prefetch repository queries use `offlineFirst`, allowing the initial IndexedDB or desktop-local read while offline; failed retries still wait for connectivity. Cache formats, authentication, resource storage and migrations are unchanged.
+
+Offline boundaries: Web requires an already authenticated page, synchronized notes and requested attachments cached by the Service Worker. Ordinary Web refresh/new-tab cold startup remains blocked by its existing session request when offline. Desktop/iOS require local notes and previously read attachments; native clients are not accepted in this batch. Android's existing in-memory image cache does not establish cold-start offline access; USB-device verification remains pending.
+
+Validation: **3,117 unit tests and 17 integration tests passed**, along with root/mobile typechecks, Web and Chromium/Firefox extension builds, and diff checks. Firefox lint reports 0 errors, 0 notices and the two existing Readability warnings. **Persistence for 29 readable samples, the real Substack restriction badge/refusal, and both HTML-safety checks passed as 3 Chromium E2E tests in 59.9 seconds.**
+
+The new Jike topic sample uses an actual CDN JPEG; the instance resource matches the CDN content digest. After verifying production Web Service Worker control, attachment caching and the IndexedDB note, `clipper.localhost` is disconnected to verify failed network requests, reopening the cached note with its text/image, and a new offline search query. Tests do not seed the caches. Other samples still use controlled image downloads; this does not establish all-CDN, signed-in Jike Web or other-browser live acceptance. Native page-player preloads are counted separately from clipper fetches; the clipper is still checked for no audio/video download.
+
+Verification connects directly to the owned worker's internal origin, avoiding reproduced Wrangler proxy `503` responses and stale asset manifests. A temporary E2E configuration creates and validates a dedicated session through the existing local-dev CLI; product authentication is unchanged. API readback confirms test notes/tokens are cleaned up and pre-existing notes preserved. The test session is revoked, the owned worker and browser task space are closed, and the original development server remains running. Changes are uncommitted, unpushed and unpublished.
+
+## Remaining requested platforms (2026-10-14)
+
+The same existing contribution workspace now also implements WeChat Official Accounts, Jike, Sspai, Juejin and Douban. These changes are local and are not committed, pushed or published. No new instance API, dependency, permission or data migration is added. Toolbar details and dedicated context menus use the same readers; explicit selections retain priority.
+
+| Platform | Saved content | Verified boundaries |
+| --- | --- | --- |
+| WeChat Official Accounts | Article title, full rich-text body converted to Markdown, account name, available author/time, declared cover and lazy-loaded body images. | Supports short `/s/{id}` and identity-bearing `/s?__biz=…&mid=…&idx=…` URLs; `sn` is preserved when present. Share/reward/footer controls are excluded. A missing author, cover or date does not reject readable title/body. |
+| Jike | Complete visible post text and links, author, available time, ordered public original pictures and link-preview cover. | Public mobile share details were sampled for one image, nine images and long text, plus an H5 topic feed. Topic context menus uniquely bind own author profile, text and pictures to loaded public post data; array position and body references never supply the ID. The toolbar still requires a selection or a post detail. Loaded public post data verifies identity/completeness and resolves originals; hidden text is not imported. A local expand control has a bounded wait. Web detail redirects to the QR login page show the amber login badge and refuse whole-page capture. Signed-in Web layouts remain unverified. |
+| Sspai | Article title, full structured body, update titles/displayed times/bodies, author, original publication date, original images and captions. | `/post/{id}` details; retain updates in page order and exclude duplicate update navigation, hidden author popovers and interaction/sidebar UI. |
+| Juejin | Article title, complete body, public author/time metadata, images, structured comparison tables and fenced code with language and indentation. | `/post/{id}` details; remove copy-code controls. Empty image placeholders are not archived images. |
+| Douban | Book/movie/music long reviews, diaries and one selected short comment, with available author/date/rating and body images. | Long reviews and diaries use exact content roots. On subject comment lists, right-click the intended card or select a passage; the toolbar does not save the whole list. Preserve the working list source URL and its existing comment anchor because sampled direct short-comment links returned 404. Dates marked edited are not reported as original publication dates. |
+
+Unreadable supported details fail explicitly. Known stale identities, truncated text, missing or incorrect declared Jike pictures and hidden content are not saved as complete posts. Optional metadata remains optional. Login pages and comment lists allow only the user's initial explicit selection; if it disappears, capture uses the recorded original text without saving the whole page. Existing image transfer limits and partial-success feedback remain unchanged.
+
+Real browser DOM context-menu events also verify exact short-comment pointer targeting for book, movie and music lists. Eleven sanitized real-page fixtures record source URLs and expected content in `apps/extension/fixtures/platforms/sources.json`. Browser reader checks cover the public pages; local expansion success/timeout/navigation are tested using the actual bundle with controlled DOM states, not a live Jike expand click. Chromium persistence tests replace source images with controlled downloads, so they do not establish real-CDN transfer, Edge or Firefox runtime acceptance.
+
+2026-10-14 verification: **3,071 unit tests and 17 integration tests passed**, along with root/mobile typechecks, the Web build, Chromium/Firefox extension builds and `git diff --check`. Firefox lint reports 0 errors, 0 notices and the two existing upstream Readability warnings. Independent correctness and design review closed the discovered missing/stale Jike content, incorrect picture binding, hidden metadata and disappearing-selection fallback defects.
+
+The **28-sample Chromium persistence test passed in 52.7 seconds**, covering the ten new detail fixtures and all eighteen prior samples. Each saves through the actual built extension and local API, checks stored body and expected image references, reopens the Web editor after blocking sources, verifies all article images, and rejects unreadable variants without a second note. Two separate HTML-safety checks also passed. The editor's source-less ProseMirror separator images and its own code-copy controls are excluded from article-content assertions; archived text and every expected attachment remain checked.
+
+The local development request-forwarding layer twice reset connections at unrelated editor metadata requests. The test now uses the same workerd origin for the built Web, API and extension when `EDGE_EVER_CLIPPER_TEST_INSTANCE_URL` is supplied. Without that variable it uses the normal configured base URL. The owned local server was restarted after the Web build to refresh its asset manifest; no product API changes, retries or larger timeouts were added. API readback confirmed zero test clips and zero test tokens after cleanup. The browser task space was closed. No commit, push, PR or publication was performed; the installed main-workspace extension was not replaced. To preview these adapters, load `edgeever-clipper-p2/apps/extension/dist` and refresh the source page.
+
+2026-10-14 additional review: fixed concurrent toolbar and context-menu captures exchanging selected text, and navigation during restricted selection capture/save. Toolbar saving now joins the existing clip queue once; the clicked tab and source URL are fixed before waiting. The queued job, captured response and post-notebook save each verify the original URL where generic/selection capture is used. Inner platform/video queue calls were removed to avoid nested waiting. This also covers a concurrent generic toolbar capture; no new queue, retry, API or metadata prerequisite was introduced. Seven actual-bundle regressions cover the two concurrent entry combinations, active-tab switching while queued, Jike/Douban navigation during injection or notebook lookup, and a timed-out capture replying after the next queued capture starts. Generic page/selection messages now carry a request ID; only the matching pending request consumes a reply, and timeout/injection cleanup cannot clear a later request.
+
+Additional-review validation: **3,078 unit tests and 17 integration tests passed**. Root/mobile typechecks, Web/Chromium/Firefox builds and diff checks passed; Firefox lint retains 0 errors and two existing Readability warnings. The complete 28-sample Chromium persistence test and both HTML-safety tests passed together in 52.3 seconds. Independent follow-up review confirmed the concurrency, navigation and late-response findings are closed, with no new substantive finding. API readback confirmed zero test clips/tokens; the owned local server was stopped. Changes remain uncommitted, unpushed and unpublished. Authenticated Jike Web layouts, real-CDN transfer and other browser runtime acceptance remain outside the verified scope.
+
+## Phase 2: BOSS Zhipin, Xueqiu and Xiaoyuzhou (2026-10-12)
+
+The baseline is official `3855efb3`; P1 merged through [PR #521](https://github.com/tianma-if/edgeever/pull/521). P2 is implemented in contribution workspace `edgeever-clipper-p2`, branch `feat/clipper-phase2`, preserving unrelated work in the original workspace.
+
+| Platform | Current behavior | Explicit limits |
+| --- | --- | --- |
+| BOSS Zhipin | Save the job title, readable salary, city, experience/education, visible benefits, complete responsibilities and requirements, company introduction and work address. | Only `zhipin.com/job_detail/{id}.html`; validate canonical identity when present. Require a readable job title and body, and refuse explicit login truncation. Salary, experience/education, company and address are retained when available and omitted when absent/hidden; do not require a salary format, retrieve protected data or treat the page update date as publication time. |
+| Xueqiu | Save public detail text, author, original post publication time and body images; add `web-clip`, `xueqiu`, `投资` and codes explicitly linked from the final sanitized body. | Preserve leading zeros in five-digit Hong Kong codes. Limit stock tags to 21 plus 3 fixed tags, matching the instance's 24-tag limit; retain every stock link in the body. Do not infer stocks from plain mentions, comments or sidebars; modification time is not publication time. |
+| Xiaoyuzhou | Reuse complete Show Notes/current-route validation, preserving timestamps, podcast name, cover and explicit episode host text. | Do not infer episode hosts from podcast authors, download audio, transcribe it or invent timestamp links. Keep timestamp nodes without `href` as source text. Add CSS-hidden subtree/title protection. |
+
+The toolbar, dedicated context menus and current-page indicator recognize BOSS jobs and Xueqiu details. The indicator describes capture mode; saving still checks readability. Xueqiu detail reads bind to the current page URL; author and publication time are optional, while explicit conflicts in available own permalinks/profile identity still reject. Home/profile pointer targets require the card's own permalink; duplicate occurrences of the same URL do not imply multiple posts. Sampled cards are truncated previews. A context-menu capture renders only the selected card’s public detail in a temporary, script-disabled same-origin frame, preserving browser-computed CSS visibility. Login/challenge pages, inaccessible frames, incorrect identities and navigation fail; neither previews nor the whole feed are saved as complete posts.
+
+The user-provided BOSS job `0d7e760b0a0e7c3a0nF939S0E1NU` initially showed login-truncated requirements and SVG salary placeholders; after reload its full `25-50K·13薪` salary, requirements, company introduction and address were readable. Both states have sanitized fixtures. The readable BOSS fixture marks nodes hidden by computed browser CSS as `hidden` before removing styles, testing that randomly hidden interference text never reaches the note. The public Xueqiu article retains three images and three explicit stock codes. A new “下课以后” episode verifies six timeline nodes and explicitly named hosts 阿丁 and 毛毛.
+
+Validation covers sanitized real DOM, identity/visibility/access boundaries, toolbar/menu parity through the actual bundled background and readers, persisted stock tags and image archival. Chromium integration uses a fresh local Web/API from this workspace and 18 page samples, including the new job, Xueqiu article and explicit-host episode; it checks attachments and reopened editor content after source blocking, refusal without note creation, and cleanup of test notes/tokens. Original image responses are replaced with test PNGs, so fixture E2E is not live CDN-download acceptance. Edge/Firefox live saving, Firefox Android, other BOSS layouts/mobile pages and all authenticated feeds remain unverified; no extension-store version is published.
+
+P2 baseline validation: 3,020 unit tests and 17 integration tests pass; root/mobile typechecking, Web and Chromium/Firefox extension builds pass. Firefox lint has 0 errors and 2 existing dependency warnings. The 18-sample Chromium saving flow and inert-HTML test both pass. P2 code is not yet committed, pushed or submitted as a PR.
+
+2026-10-12 addition: opening the extension runs a read-only DOM probe on BOSS jobs. Only the visible “登录查看完整内容” marker inside the current job body triggers an amber “Sign in needed” badge and sign-in/refresh guidance; hidden leftovers and unrelated login controls do not. Permission failure or navigation during probing shows “Unknown” without the green adapted check. This badge does not establish completeness of other fields; saving still validates identity and full content. The button stays enabled for valid text selections, while a restricted job without a selection still refuses note creation. The hint never overwrites capture feedback already in progress.
+
+Login-badge validation: 248 extension tests and root typechecking pass. The 18-sample Chromium saving flow also verifies the actual readable/login-preview popup states. Chromium/Firefox builds pass; Firefox lint retains 2 existing warnings and no errors.
+
+2026-10-13 review fixes: withdraw unsupported BOSS metadata/salary-format prerequisites, Xueqiu detail author/time-link prerequisites and generic expand-class refusal. Stock tags and Markdown consume the same sanitized body, excluding stocks linked from controls or scripts. Retain the actual 24-tag instance limit and withdraw the unsupported 15-character stock-code cap. CSS filtering distinguishes subtree hiding from descendant-overridable `visibility`: remove hidden own text while retaining explicitly visible descendants; BOSS availability and Xiaoyuzhou extraction follow the same boundary. Both BOSS fixtures further remove unused action redirects, tracking and security parameters.
+
+Post-review validation: the serialized full non-E2E run passes 3,031 unit tests and 17 integration tests. Root/mobile typechecking, Web and Chromium/Firefox extension builds pass; Firefox lint has 0 errors and 2 existing dependency warnings. The Chromium computed-visibility and inert-HTML safety tests pass. Several unchanged tests timed out during the initial parallel run; isolated checks and the final full rerun pass without changing those tests or production infrastructure. The 18-sample integration rerun did not complete: the local development API proxy first returned 503/timeouts. With `EDGE_EVER_CLIPPER_TEST_INSTANCE_URL` reaching the same workerd directly, Xiaoyuzhou and BOSS save and API body readback pass, but editor reopening times out while loading the local Vite page. At a host load of about 38, the final rerun again times out navigating to Web. Test timeouts and production flows were not changed. Earlier 18-sample passing records describe their respective revisions only; this review does not claim a full E2E acceptance pass. Test notes and tokens from this review were cleaned up, with API readback confirming none remained.
## Phase 1: five social platforms (2026-10-10)
@@ -12,7 +193,7 @@ Facebook, Instagram, LinkedIn, Threads and Bluesky now have dedicated readers. O
| --- | --- | --- |
| Facebook | `facebook.com/{account}/posts/{id}`, `permalink.php` and `story.php` | Full readable main post, author/organization, available time and loaded photos; excludes comments and controls. |
| Instagram | `instagram.com/p/{code}/`, `/reel/{code}/` | Complete readable caption, handle, time and all loaded carousel photos or video covers. |
-| LinkedIn | `linkedin.com/posts/…-activity-{id}-…`, `/feed/update/urn:li:activity:{id}/` | Full post, publisher, time and complete loaded image collection. |
+| LinkedIn | `linkedin.com/posts/…-{type}-{id}-…`, `/feed/update/urn:li:{type}:{id}/` | Full post, publisher, personal professional headline, time and complete loaded image collection (`type`: activity, ugcPost, share). |
| Threads | `threads.com/@{handle}/post/{code}` and `threads.net` aliases | Full post, handle, time, loaded images and explicit quoted content. |
| Bluesky | `bsky.app/profile/{handle}/post/{id}` | Body, author, available time, full-size CDN images and visible quoted post. |
diff --git a/docs/browser-clipper-platforms.zh-CN.md b/docs/browser-clipper-platforms.zh-CN.md
index 43bee004..9c8541f2 100644
--- a/docs/browser-clipper-platforms.zh-CN.md
+++ b/docs/browser-clipper-platforms.zh-CN.md
@@ -2,7 +2,188 @@
[English](browser-clipper-platforms.md)
-关联 [Issue #493](https://github.com/tianma-if/edgeever/issues/493) 和[实施方案](browser-clipper-platform-expansion-plan.zh-CN.md)。更新于 2026-10-11:Phase 1 已准备提交 PR 审查;扩展商店发布和完整跨浏览器实站验收仍待完成。
+关联 [Issue #493](https://github.com/tianma-if/edgeever/issues/493) 和[实施方案](browser-clipper-platform-expansion-plan.zh-CN.md)。更新于 2026-10-15:Phase 1 已合并,Phase 2 与其余本次要求的平台适配已在本地实现;扩展商店发布和完整跨浏览器实站验收仍待完成。
+
+## 2026-10-15 PR 提交验证
+
+本次提交以最新上游 `72ab4816` 为基线,包含 P2/后续文章平台适配及已合并 P1 的修复。上游“复制笔记”与当前 Web 修改无冲突合并。本次仅提交 83 个任务文件,排除无关 Android 缓存。
+
+合并后 3,529 项批量测试、17 项 API 集成及 13 项桌面认证集成通过,共 3,559 项,其中扩展测试 427 项。根/移动端类型检查、Web 和 Chromium/Firefox 扩展构建通过,Firefox lint 为 0 错误、0 提示、7 条依赖警告。31 个来源样本的 Chromium 保存/附件回读及 2 项 HTML 安全检查通过。夹具空白行清理前后,六份受影响样本的完整提取结果与预格式化文字一致,相关 67 项测试通过。
+
+首轮浏览器复验发现,Web 重建后本地 Wrangler 资源清单仍引用旧资产,新 JavaScript 路径返回 HTML;重启本任务的本地开发服务后,MIME 回读及整组回归通过。未修改生产代码或放宽测试时限。测试后 API 与备份 ID 集合一致,原有 17 条笔记及 1 个令牌完整保留。
+
+本次为关联 #493 的阶段性 PR,商店发布、BOSS 当前登录截断页的全文及原生 Edge/Firefox 保存仍待验收。下方“未提交”等状态为对应轮次的历史记录。
+
+## 2026-10-15 保存与文本保真复审
+
+本轮修复六处有复现证据的问题:
+
+- 少数派作者仅从当前文章读取,保留同文合著者和作者缺失情形,排除其他文章及隐藏作者卡片。
+- 表格代码中的奇数个反斜线接竖线不再造成错列或丢失后列。GFM 无法无损表达的片段改为转义后的普通文字,保留字符与单元格边界;其他代码样式保持。
+- 图片转存回写保留标题中的实体、换行及表格竖线,避免归档后图片消失或表格错列。
+- 平台右键先固定选中帖子的链接,再显示保存提示,提示注入期间的新右键不会替换本次目标。
+- 通用网页、平台及信息流工具栏在入队前记录初始选区与整页模式;右键选区使用浏览器提供的原文字。选区后来改变或消失时仅保存原选区文字,匹配时保留富文本与图片。纯文本回退使用字符实体,避免标题、缩进、URL 和 HTML 被重新解析;导航仍停止保存。没有初始选区的登录页或列表不会因此保存整页。
+- 右键选区保存不再全局压缩空行,保留代码内部的连续空行。
+
+最终完整非 E2E 检查通过:3,505 项批量测试(含 427 项扩展测试)、17 项 API 集成与 13 项桌面认证集成,共 3,535 项。根/移动端类型检查、Web 和 Chromium/Firefox 扩展构建通过;Firefox lint 为 0 错误、0 提示、7 条依赖警告。当前构建的 31 个来源样本 Chromium 保存/附件回读流程及 2 项 HTML 安全检查通过;其中即刻信息流使用真实 CDN,其余图片仍为受控 PNG。API 与备份 ID 集合比对确认原有 17 条笔记和 1 个令牌完整保留,无额外笔记。正确性、设计与简化复审无未处理实质发现。
+
+以上修复仍在本地贡献工作区,尚未提交、推送或创建 PR。ego-lite 验收空间由用户控制,本轮未重载其中已安装的扩展。BOSS 当前登录截断、原生 Edge/Firefox 保存及其他登录态布局仍待实站验收;下方较早记录只代表对应版本。
+
+## 2026-10-15 上游同步与遗漏补齐
+
+沿用贡献工作区和原分支,将上游基线推进到 `7b03c8db`,保留此前剪藏修改并适配新的 React 弹窗。需登录/内容受限角标及说明继续显示;正在保存、错误和成功反馈优先,明确选区仍可保存。旧弹窗样式未恢复。
+
+雪球信息流右键选中的截断卡片会通过临时同源预览框读取自身公开详情,保留已有页面会话和浏览器计算的 CSS 可见性。预览框设置 `sandbox="allow-same-origin"`,禁用脚本,成功/失败/超时后均移除;错误身份、CSS 隐藏正文、卡片复用、页面跳转或访问受限不创建笔记。原右键监听器仍不联网。真实 Ego 页面已验证选中当前卡片读取公开详情与清理,完整长文和图片另由真实来源夹具验证。
+
+LinkedIn 新增个人职业简介,与作者姓名和发布时间分开读取,保存为“作者: 姓名 · 职业简介”。`activity`、`ugcPost`、`share` 三种身份保持区分;关系等级、关注人数和嵌套帖元数据不能冒充作者、职务或时间。真实个人样本为 Mohammad Ahmed / Technical Lead - Backend at Dizzaract。
+
+同步后的 macOS 本地完整非 E2E 检查通过:3,490 项批量测试、17 项 API 集成与 13 项桌面认证集成;其中扩展专项 412 项通过。根/移动端类型检查、Web 与 Chromium/Firefox 扩展构建通过。Firefox lint 为 0 错误、0 提示、7 条警告:4 条来自新上游 React DOM 包、2 条既有 Readability、1 条 mdast 内部解析器;未禁用检查。旧 ProseMirror 安装软链接造成的类型冲突通过重建依赖链接消除,未修改依赖版本或业务类型。
+
+当前 31 个来源样本的 Chromium 保存流程通过,覆盖正文/元数据、附件回写与回读、屏蔽来源后编辑器重开、CSS 隐藏详情拒绝、临时预览框脚本隔离与清理,以及 React 登录/付费预览提示;另有 2 项 HTML 安全检查通过。即刻信息流样例使用真实 CDN,验证附件哈希、浏览器解码及已缓存笔记断网重开,其余图片为受控 PNG,不据此重复声称真实 CDN 验收。测试按上游虚拟列表验证目标行,不再按全部 DOM 行数等待。
+
+首轮停在 Vite 会话转发超时,后一次 Wrangler 日志记录 `ProxyController` 错误退出。最终使用同一 workerd 的内部 Web/API 地址通过整组检查;未改开发服务器、添加重试或放宽测试时限,也未宣称该代理故障已根治。中断轮次残留数据已清理;API 与备份 ID 集合比对确认原有 17 条笔记全部保留、额外笔记为 0,令牌恢复到原有 1 个。本地扩展已重载,同一个 8 页 ego-lite 验收空间保留。尚未提交、推送、创建 PR 或发布。
+
+当前 BOSS 实站仍为登录截断与无可读薪资,不能视为全文验收通过。原生 Edge/Firefox 保存及其他登录态布局仍待验收。以下较早检查记录仅代表各自当时版本。
+
+## 2026-10-15 跨平台缺陷复审
+
+将此前验收问题横查到 P1、P2 及其余本次要求的平台。修复豆瓣乐评单换行丢失、V2EX 隐藏正文/元数据泄漏及隐藏附言容器内恢复可见的正文遗漏、Facebook/Bluesky/LinkedIn 将嵌套帖正文归到原帖、隐藏帖头链接改变右键目标的问题。Medium、Substack、通用网页和明确选区共用 HTML 转 Markdown,不再压缩代码内部空行。
+
+共用表格转换保留行列、图片及单元格换行,避免把 HTML fallback 当源码文字显示。只有表格单元格内无属性的 `<br>` 会转为硬换行,任意 HTML 仍作为文字。复杂单元格保留可读的内联内容,不保留嵌套列表/引用/代码块节点。纵向合并在原行组内重复值,横向合并使用空单元格占位;额外表头行作为数据行保留。图片地址替换改用解析器提供的源码位置与标签边界,保留转义示例、代码、引用式图片、嵌套图片标签及表格图片。通用网页/选区入口也会提示图片未完全归档。
+
+使用已安装 Wrangler 代理进行独立实验:上游不消费 `{}` 时,50 组编辑/保存请求有 7 次失败;消费请求体、使用 Wrangler 原版 drain 中间件、不发请求体,均为 0/50 失败。扩展删除创建编辑会话时无用的请求体,未修改 API 或其他客户端,也不宣称修复了所有 Wrangler 连接故障。Substack 真实文章和 Note 已通过原配置 `http://127.0.0.1:8787` 完成 3/3 与 1/1 图片归档,4 张附件全部可解码、SHA-256 与源文件一致;两条临时笔记和 4 张附件均清理,原有 17 条笔记保留。
+
+387 项扩展测试和 346 项共享模块/编辑器测试通过;根/移动端类型检查、Web 构建及 Chromium/Firefox 扩展构建通过。Firefox lint 为 0 错误、0 提示、3 条警告:两条既有 Readability 警告,以及 mdast 内部解析器 `document().write()` 方法被误判为浏览器文档写入;该方法不访问浏览器文档,background bundle 另在无 DOM 环境执行验证。正确性、设计与简化独立复审在本轮范围内均已收敛;依赖补丁另经隔离的干净安装验证。
+
+继续保留同一个 8 页 ego-lite 验收空间。原生工具栏/右键点击、缺少样本的登录态布局及完整跨浏览器验收仍待完成;已有笔记不会自动改写。未提交、推送或发布。
+
+## 2026-10-15 P1 真实图片补验
+
+P1 五站继续共用 `page-images` 附件转存。真实 Bluesky 原尺寸图片可以下载,但扩展及来源页的 fetch 均被 CORS 拒绝,浏览器记录 `MissingAllowOriginHeader`。本轮仅新增 `https://cdn.bsky.app/*` 主机权限,重载本地扩展后原生权限检查通过;未为其他四站新增不必要的 CDN 权限。
+
+在 ego-lite 当前页面提取正文与图片,通过扩展页面下载真实 CDN 内容,使用共用转存函数和原配置 `http://127.0.0.1:8787` 上传、回写,再从浏览器回读附件:Facebook 1/1、Instagram 3/3、LinkedIn 8/8、Threads 4/4、Bluesky 1/1。17 张附件全部 HTTP 200、SHA-256 与源文件一致且能正常解码,临时笔记外链图片为 0。Facebook 使用当前帖头的永久链接;不放宽帖子身份匹配来猜测旧链接别名。
+
+本轮 Instagram 首次转存为 2/3,三张图片实际均已下载,缺失附件在同一临时笔记中单独补验后齐全,因此不是一次保存全部成功的证据。额外验证 Medium 的 2 张真实图片转存与回读通过;Substack 文章和 Note 的 3+1 张图片均已下载、上传,但最后回写各遇到一次本地代理 503,不能记为归档通过。该错误重启后仍复现;其表现与 [Wrangler 上游记录的代理连接竞争问题](https://github.com/cloudflare/workers-sdk/issues/14641) 一致,但本轮没有证明精确的底层触发机制,也未改 Wrangler、添加产品重试或宣称问题已经根治。
+
+370 项扩展测试与 Chromium/Firefox 构建通过,Firefox lint 保留两条既有 Readability 警告。原生工具栏点击、右键及完整跨浏览器验收仍待人工完成;本轮没有通过脚本代替用户授予来源页权限。临时笔记及附件在验证后清理,用户原有笔记保留。本地扩展已重载,P1 页面已放到同一个验收空间;未提交、推送或发布。
+
+## 2026-10-15 图片下载与附件回写验收
+
+抽查现有验收笔记发现,公众号最近一篇仍有 16 张外链,雪球和即刻未转存,少数派则有全部成功和部分失败的记录。公众号 CDN 缺少主机权限且拒绝页面内跨域读取;少数派 CDN 在没有来源头时返回 403、带少数派根站点来源头时返回有效图片。扩展新增 `https://mmbiz.qpic.cn/*` 和 `https://cdnfile.sspai.com/*` 访问权限,并将豆瓣既有来源头规则与少数派规则放在同一模块;每条规则只作用于本扩展发起的相应 HTTPS CDN GET,不携带原文章路径或查询参数。继续复用 `page-images` 的下载、上传、编辑冲突保护及图片地址改写流程。
+
+本轮还复现了本地 Wrangler 代理在最后 `/save` 返回 503:21 张图片虽全部上传,笔记仍保留 21 张外链。重启当前本地开发服务后,通过原配置 `http://127.0.0.1:8787` 完成公众号 21/21、雪球 3/3、即刻 1/1、少数派 9/9、豆瓣 6/6、掘金 2/2、小宇宙封面 1/1 的真实 CDN 下载、临时笔记上传与回写。43 张附件逐张回读均为 200,SHA-256 与下载内容一致,并全部在浏览器解码成功,临时笔记中的外链图片为 0。这证明重启后该入口的本次转存链路恢复,未修改 Wrangler 或宣称代理故障根因已永久修复。
+
+扩展 370 项测试、根类型检查及 Chromium/Firefox 构建通过;Firefox lint 仍只有两条既有 Readability 警告。工具栏/右键 bundle 回归覆盖少数派来源头规则;ego-lite 验证原生主机权限、请求规则、共用转存流程及附件读取,原生工具栏/右键点击仍待人工点验。临时笔记和附件在核对后清理,已有笔记不自动改写;本地扩展已重载,需重新剪藏才能应用修复。尚未提交或发布。
+
+## 2026-10-15 豆瓣书评分段与图片
+
+豆瓣长评的段落使用 `white-space: pre-wrap`,同一个 HTML 段落中的空行也是作者分段。读取器现在在脱离原页面的副本上恢复这些分段,保留跨分段的加粗与链接,代码内部空行不作为段落边界。示例书评由原先合并的 2 段恢复为原页显示的 7 段,6 张图片的位置保持不变。
+
+旧验收笔记确认为 6 张外链、0 张附件。图片 CDN 在缺失豆瓣来源头时返回 418,页面内 fetch 又受 CORS 限制。扩展新增 `https://*.doubanio.com/*` 主机访问和 `declarativeNetRequestWithHostAccess` 权限;会话规则只匹配本扩展发起的 HTTPS GET、`img[0-9].doubanio.com/view/` 图片请求,将来源头设为豆瓣根站点,不携带原页面路径或查询参数。图片仍使用 `page-images` 的既有体积/时间限制、资源上传及地址改写流程,失败仍提示部分图片为外链。升级后可能需要确认新增网站权限。
+
+ego-lite 已重载本地扩展,原生请求规则使 6 张真实 CDN WebP 均返回 200。共用 `page-images` 对临时笔记完成 6/6 资源转存与地址改写,随后从已配置实例入口回读:7 段正文保留、外链图片为 0,6 张附件逐张 SHA-256 与源图一致,并在浏览器中全部解码为 1080 像素宽的有效图片。该次完整上传/保存验证直连同一 API worker 的内部地址:正常本地 Wrangler 代理先后在一次上传和一次保存返回了 `503 / Your worker restarted mid-request`,当时未改扩展配置或重启开发服务;后续通过原入口的验证见上节。原生工具栏/右键点击仍由人工验收;本轮实站验证分段覆盖真实 DOM 读取、扩展 CDN 请求、共用转存流程与 API/浏览器回读。
+
+扩展 368 项测试、根类型检查与 Chromium/Firefox 构建通过;Firefox lint 为 0 错误、0 提示和两条既有 Readability 警告。E2E 新增段落边界断言并通过测试收集,未重跑整组 E2E。两条临时笔记已清理,原有笔记保留;已有笔记不会自动改写。
+
+## 2026-10-15 掘金表格结构修复
+
+人工验收发现,掘金总结中的三列表格被转换成了连续文字。原页与夹具均保留完整 HTML 表格,问题在共用转换器缺少表格规则。现在通过 Joplin 的 Turndown 表格插件生成 GFM 表格,保留表头、行列及单元格中的链接和行内代码;仅启用表格规则。表格说明先按正常富文本段落转换,避免插件把字面 HTML 当作标记输出。固定插件版本并通过依赖补丁修正连续 `||` 被合并的问题,不改变代码原文。
+
+ego-lite 同一真实掘金页通过笔记编辑器使用的 Markdown 解析器核对出 1 张表、3 列、1 行表头与 4 行内容,所有单元格文字和“事件循环”链接均与原页一致;2 张图片、原始发布时间及原页面 DOM 保持不变。扩展 363 项测试、根项目/移动端类型检查、Web 与 Chromium/Firefox 扩展构建及 diff 检查通过;冻结锁文件安装通过,保留既有依赖版本,仅新增表格依赖及补丁。工具栏/右键真实 bundle 回归覆盖保存及附件地址改写后的表格。E2E 新增编辑器行列断言,本轮仅验证测试收集,未重跑整组浏览器保存验收。复杂合并单元格、嵌套表格及单元格内多行富文本不在本轮验收范围内。重载本地扩展并重新剪藏后生效,已有笔记不会自动重写。
+
+## 2026-10-15 少数派更新说明补全
+
+人工验收发现,少数派把文章更新说明放在正文容器旁的独立区块,原读取器只取正文而遗漏该区块。现在按页面顺序追加同篇文章可见的更新说明,每条转为独立引用块,内部按原页顺序保留显示时间、加粗标题和完整正文,不将更新标题提升为章节。富文本及图片继续使用既有转换与转存机制;不重复保存顶部更新导航,不扩大到互动或侧栏。缺失可选标题/时间不丢弃更新正文,隐藏更新不采集,原始发布时间保持独立。
+
+ego-lite 同一真实页面读取后解析 Markdown,确认时间、加粗标题“中国大陆推出睡眠呼吸暂停迹象提示功能”及完整说明位于同一个引用块,没有额外标题元素;原始发布时间仍为 2024-10-10,9 张图片和原页面 DOM 保持不变。引用格式修正后,提取与保存相关 123 项测试、根类型检查、Chromium/Firefox 构建及 diff 检查通过;工具栏和右键真实 bundle 回归覆盖更新正文及其中图片的地址改写。浏览器 E2E 增补引用块保存断言,本轮仅验证测试收集,未重跑整组 E2E。重载本地扩展并重新剪藏后生效,已有笔记不自动改写。
+
+## 2026-10-15 公众号正文标题层级
+
+保留原文总标题,仅修复公众号正文中用普通段落和字号排版的章节。按正文主要字号识别明显较大的整段文字,并将不同字号映射为二级起的标题层级;成组的“第几步:…”放在所属章节的下一级。原有标题标签、普通加粗段落、首字放大、编号操作项、引用、代码和图注保持各自语义,不改写标题措辞。字号信息不足时不据单独加粗猜测标题。
+
+同一真实公众号页面在 ego-lite 读取确认 3 个二级章节和 4 个三级步骤,文章总标题、21 张有效图片及原页面 DOM 保持不变。夹具补留实站计算出的必要字号/字重/对齐属性,用于复现原有视觉标题。扩展 355 项测试、根类型检查、Chromium/Firefox 构建及 diff 检查通过。工具栏和右键 bundle 回归同时核对保存及图片地址改写后的标题标记;浏览器 E2E 增补标题元素断言,本轮仅验证测试收集,未执行该整组 E2E。重载本地重建的扩展后重新剪藏生效,已有笔记不会自动改写。
+
+## 2026-10-15 公众号人工验收修正
+
+人工验收发现,公众号专用读取器虽然保留了元数据与 `wechat` 标签,仍把作者放在 `#js_content` 中的关注横幅和装饰图片视为正文。现在仅在公众号路径清理明确的蓝字关注/关于引导及同组附图、标注为分割线的装饰 GIF、原生 CPS 广告和末尾独立的原生文章推荐卡。保留教程操作说明、代码/引用中的原文、有内容的 GIF 和正文内引用,不按“点击”“关注”等单个词删除段落。微信逐行 `<code>` 组件先合并为完整代码块,避免只保存首行。
+
+这篇样本清理后保留头图及 20 张正文图,共 21 张,删除的 6 张为关注横幅附图、4 张分割线及文末推荐图;原始夹具保留不变。工具栏/右键真实 bundle 回归核对正文和图片转存,ego-lite 同一真实公众号页面读取也确认清理结果、六行模型代码均保留且未修改原 DOM。扩展 352 项测试、根类型检查、Chromium/Firefox 构建及 diff 检查通过。已保存的笔记不会自动重写,修复后的扩展需重载后重新剪藏。该记录不代表所有公众号版式、CDN 转存或完整保存界面均已实站验收。
+
+## 2026-10-15 追加闭环复审
+
+本轮补上六处边界:右键选区在排队、提取或笔记本查询期间导航时停止保存,iframe 保留自己的来源 URL;Substack Note 先过滤 CSS 隐藏内容再定位自身卡片,隐藏副本不会挡住可见正文;Substack 付费提示按实际可见文本判断,支持子节点恢复可见性;即刻图片容器和图片自身带按钮语义时仍保留全部已确认原图;Medium 缺失标题时仍识别文章壳,读取失败不回退通用正文;默认开发环境的 E2E 不等待被主动禁用的 Service Worker,只有显式配置构建实例时执行缓存与断网段。真实 CDN 转存、摘要及源站阻断后的图片读取仍在默认测试路径中。
+
+删除了 Web 文档重置中重复的源码字符串断言,保留实际 DOM 复用、图片释放和撤销历史回归。扩展 348 项测试、Web 编辑器 7 项测试通过,根类型检查及 Chromium/Firefox 扩展构建通过;E2E 测试可正常收集。本轮未重跑浏览器 E2E 或新增实站验收,下面的浏览器结果仍属于上一轮记录。改动保留在原贡献工作区,未提交、推送或发布。
+
+## 2026-10-15 技术规范补齐与 P1 修复
+
+即刻 H5 话题信息流复用 `social-target`、`capture-platform` 和现有保存队列,只保存指针下唯一确认的卡片。Medium/Substack 文章补齐可用作者、原始发布时间、`web-clip` 和 `medium`/`substack` 标签;公开元数据必须对应当前文章,缺失元数据不阻止可读正文。图片沿用 `page-images` 转存并回传归档状态;下载、上传或地址改写失败时保留一条笔记,明确提示部分图片仍为外链。Medium 可见日历日期保留日期精度,相对时间仍原样保存。
+
+实站 Substack 付费预览的 `.paywall` 显示橙色“内容受限”角标与阅读权限提示,整篇保存明确失败,标题或正文未加载时也不回退通用采集。有效的可见选区仍可保存。该判断不因“付费文章”元数据单独拒绝已可读的全文。新增文案同步 zh_CN/en/ja/pl。
+
+P1 五站统一过滤 CSS 隐藏内容。正文已缺失时,不靠 SEO 文本恢复;图片声明用于核对现有媒体,不能替换错误图片或把漏图报为完整。Facebook/LinkedIn 字面 HTML 通过 Markdown 文本边界转义,代码块保持原文。Meta 的作者与发布时间均为可选。LinkedIn 仍保留此前明确支持的公开 JSON-LD 全图及访客正文路径;清除无关隐藏控件不阻止完整正文。
+
+真实 CDN JPEG 验收发现 Web 编辑器会在重置文档前清空仍复用的图片节点。现改为更新后只释放已移出编辑器的旧媒体,保留现有撤销历史隔离;真实 ProseMirror 回归覆盖节点复用、旧图释放和切换后撤销深度归零。笔记本、列表、详情与预取的本地 repository 查询改为 `offlineFirst`:允许首次离线读取 IndexedDB 或桌面本地数据,失败重试仍等待联网。没有修改缓存格式、认证、资源存储或迁移机制。
+
+离线边界:Web 需要已登录页面、已同步笔记与已请求且由 Service Worker 缓存的附件;普通 Web 断网刷新/新标签冷启动仍受现有会话请求限制。桌面/iOS 需要本地笔记及已读取附件缓存,当前批次没有原生端验收。Android 现有图片内存缓存不证明冷启动离线可用,USB 真机未验证。
+
+本轮验证:**3117 项单元测试、17 项集成测试通过**;根项目/移动端类型检查、Web 与 Chromium/Firefox 扩展构建、diff 检查通过。Firefox lint 为 0 错误、0 提示和两条既有 Readability 警告。**29 份可读样本的保存验收、真实 Substack 受限预览角标/拒绝保存及两项 HTML 安全检查,共 3 项 Chromium E2E 在 59.9 秒内通过**。
+
+新增即刻话题样本使用真实 CDN JPEG,实例资源回读与 CDN 内容摘要一致。生产 Web 确认 Service Worker 控制、附件缓存和 IndexedDB 笔记已写入后,通过 `clipper.localhost` 真正断网,核对网络请求失败、切走再重开笔记的正文/图片与新的离线搜索查询;未主动写入测试缓存。其余样本的来源图片仍由受控下载源替换,不能据此证明全部 CDN、登录态即刻 Web 或其他浏览器实站验收。页面播放器的原生媒体预载与剪藏脚本的 fetch 分开计数,仍验证剪藏不下载音频/视频。
+
+验证直连本次独立 worker 的内部来源,避开 Wrangler 代理的已复现 `503` 和旧服务资产清单问题;临时 E2E 配置通过现有 local-dev CLI 创建并校验专用测试会话,没有改产品认证。API 回读确认本次测试笔记和令牌已清理,原有笔记保留;本次测试会话已撤销、独立 worker 与浏览器任务空间已关闭,原有开发服务保留。改动仍未提交、推送或发布。
+
+## 本次补齐的平台(2026-10-14)
+
+沿用已有贡献工作区,补齐微信公众号、即刻、少数派、掘金和豆瓣。当前改动均在本地,尚未提交、推送或发布。未新增实例 API、依赖、权限或数据迁移。详情页工具栏与专用右键菜单共用读取器;明确选区继续优先。
+
+| 平台 | 保存内容 | 已验证边界 |
+| --- | --- | --- |
+| 微信公众号 | 文章标题、完整富文本正文转 Markdown、公众号名、可用作者/时间、声明的头图及懒加载正文图片。 | 支持短链 `/s/{id}` 和带身份参数的 `/s?__biz=…&mid=…&idx=…`;存在 `sn` 时保留。去掉分享、赞赏与底部控件。作者、头图或时间缺失不阻止保存可读标题与正文。 |
+| 即刻 | 完整可见动态及链接、发帖人、可用时间、按序的公开原图及链接卡片封面。 | 已采样公开移动分享详情的单图、九宫格、长文及 H5 话题信息流。话题页右键按自身作者资料、正文与图片唯一匹配公开帖子数据;不按数组位置或正文引用链接猜测 ID。工具栏仍要求明确选区或打开单帖。已加载的公开原帖数据用于核对身份/完整性与原图地址,不导入隐藏正文。本地展开控件有等待上限。Web 详情跳转扫码登录页时显示橙色需登录角标,并拒绝整页采集;登录后的 Web 布局尚未验收。 |
+| 少数派 | 文章标题、完整结构化正文、更新标题/显示时间/正文、作者、原始发布日期、原图与图注。 | 支持 `/post/{id}`;更新按页面顺序保留,排除重复更新导航、隐藏作者浮层、互动与侧栏。 |
+| 掘金 | 文章标题、完整正文、公开作者/时间元数据、图片、结构化对比表格,以及保留语言和缩进的围栏代码块。 | 支持 `/post/{id}`;去掉复制代码控件,空图片占位不算已归档图片。 |
+| 豆瓣 | 书/影/音长评、日记和选中的单条短评,保留可用作者/日期/评分及正文配图。 | 长评与日记按准确正文容器读取。作品短评列表中,右键目标卡片或选择一段文字;工具栏不保存整个列表。实测部分短评详情链接返回 404,因此保留可访问的列表来源 URL 及已有单条锚点。标为已编辑的时间不冒充原始发布时间。 |
+
+不可读的已适配详情明确失败。已知身份变化、正文截断、即刻声明图片缺失或不匹配、隐藏内容,不会作为完整帖保存;可选元数据仍按可用性保留。登录页或短评列表只允许保存用户最初明确选择的文字;该选区中途消失时使用已记录的原文字,不回退为整页采集。沿用既有图片传输上限与部分成功提示。
+
+真实浏览器中还通过 DOM 右键事件核对了书、影、音列表的单条短评定位。新增十一份真实页面脱敏夹具,在 `apps/extension/fixtures/platforms/sources.json` 记录来源与预期。浏览器读取器检查覆盖公开实站页面;即刻展开成功/超时/导航使用真实 bundle 和受控 DOM 验证,不代表实站展开点击验收。Chromium 持久化检查以受控下载源替换来源图片,不能据此证明真实 CDN 转存、Edge 或 Firefox 运行时已通过。
+
+2026-10-14 验证:**3071 项单元测试、17 项集成测试通过**,根项目/移动端类型检查、Web 构建、Chromium/Firefox 扩展构建及 `git diff --check` 通过。Firefox lint 为 0 错误、0 提示,保留两条既有上游 Readability 警告。独立正确性与设计复审已关闭即刻正文缺失/变化、图片错绑、隐藏元数据和选区消失后回退整页的问题。
+
+**28 样本 Chromium 持久化测试在 52.7 秒内通过**,覆盖十份新增详情夹具和先前十八份样例。逐份通过真实构建扩展及本地 API 保存,核对已存正文与预期图片引用,屏蔽来源后重开 Web 编辑器并检查全部正文图片;不可读变体拒绝创建第二条笔记。另两项 HTML 安全检查通过。正文断言排除编辑器自身无来源的 ProseMirror 分隔图与复制代码按钮,仍检查归档正文和每个预期附件。
+
+本地开发的测试请求转发层两次在无关编辑器元数据请求上发生连接重置。现在设置 `EDGE_EVER_CLIPPER_TEST_INSTANCE_URL` 时,测试中的构建 Web、API 与扩展直接使用同一个 workerd 来源;未设置时沿用正常配置的 base URL。Web 构建后已重启本次创建的本地服务,刷新静态资产清单;未修改产品 API、增加重试或放宽超时。清理后通过 API 回读确认测试剪藏与测试令牌均为零,并关闭浏览器任务空间。未提交、推送、创建 PR 或发布,也未替换主工作区已安装的扩展。预览本次适配需加载 `edgeever-clipper-p2/apps/extension/dist` 并刷新来源页。
+
+2026-10-14 追加复审:修复工具栏与右键并发时串存选区,以及受限页选区采集/保存期间导航未被拦截的问题。工具栏保存统一且仅一次进入既有采集队列,入队前固定点击时的标签页和来源 URL。涉及通用网页/选区采集时,在任务开始、采集回包及笔记本查询后的保存前核对原 URL;删除平台/视频分支内层排队,避免相互等待。覆盖另一页通用工具栏并发场景;未新增队列、重试、API 或元数据必填条件。七项真实 bundle 回归覆盖两种并发入口组合、排队时切换活跃页、即刻/豆瓣在注入或笔记本查询期间导航,以及超时后旧回包晚于下一条采集开始的场景。通用网页/选区消息增加请求标识,仅匹配的等待请求消费回包;超时或注入失败不会清空后续请求。
+
+追加复审验证:**3078 项单元测试、17 项集成测试通过**;根项目/移动端类型检查、Web/Chromium/Firefox 构建及 diff 检查通过,Firefox lint 保持 0 错误和两条既有 Readability 警告。完整 28 样本 Chromium 持久化测试与两项 HTML 安全测试在同一轮共 52.3 秒内通过。独立复审确认并发、导航和迟到回包问题已关闭,没有新的实质发现。API 回读确认测试笔记/令牌均为零,本次创建的本地服务已停止。仍未提交、推送或发布。登录后即刻 Web 布局、真实 CDN 转存及其他浏览器运行时仍不属于已验证范围。
+
+## Phase 2:BOSS 直聘、雪球、小宇宙(2026-10-12)
+
+基线为官方 `3855efb3`,P1 已由 [PR #521](https://github.com/tianma-if/edgeever/pull/521) 合并。P2 在贡献工作区 `edgeever-clipper-p2`、分支 `feat/clipper-phase2` 实现,保留原工作区无关改动。
+
+| 平台 | 当前行为 | 明确边界 |
+| --- | --- | --- |
+| BOSS 直聘 | 保存岗位标题、可读薪资、城市、经验/学历、可见福利、完整职责与任职要求、公司介绍和工作地址。 | 仅支持 `zhipin.com/job_detail/{id}.html`;若存在 canonical 则核对身份。只要求可读岗位标题与正文;明确登录截断仍拒绝。薪资、经验/学历、公司与地址等按可用性保留,缺失或隐藏则省略,不强制薪资格式,不读取受限数据,不把页面更新时间当发布时间。 |
+| 雪球 | 保存公开详情全文、作者、原始帖发布时间、正文配图;附加 `web-clip`、`xueqiu`、`投资` 和最终净化正文明确股票链接中的代码。 | 港股五位数字保留前导零。最多 21 个股票标签,加 3 个固定标签,符合实例 24 个标签上限;正文仍保留全部链接。不猜测普通文字中的股票代码,不从评论/侧栏打标签;修改时间不冒充发布时间。 |
+| 小宇宙 | 复用已有完整 Show Notes 与当前路由校验,保留时间轴、节目名、封面和正文明确的主播信息。 | 不从节目作者推断当集主播,不新增音频下载或转写。不补造时间轴跳转链接;无 `href` 的时间节点按原文保留。新增 CSS 隐藏子树/标题保护。 |
+
+工具栏、专用右键菜单和当前网页状态同步识别 BOSS 岗位与雪球详情;状态只表示采集模式,保存时仍检查可读性。雪球详情以当前页面 URL 绑定目标,作者与发布时间不设必填;可用的自身永久链接/作者身份明确冲突时拒绝。首页/个人页的右键定位需要卡片自身永久链接,重复的相同 URL 不构成多帖;本次真实样本为截断预览;右键选中的自身卡片会在临时同源预览框中读取对应公开详情,禁用脚本并保留浏览器计算的 CSS 可见性,验证身份后保存完整正文。登录/验证页、预览框不可访问、错误详情或途中导航会拒绝保存,不将预览或整个信息流视为完整帖子。
+
+BOSS 用户指定岗位 `0d7e760b0a0e7c3a0nF939S0E1NU` 在初次采样显示登录截断和 SVG 薪资占位;刷新后可读取完整薪资 `25-50K·13薪`、全部任职要求、公司介绍和地址。两种状态均保留去敏夹具。BOSS 夹具将浏览器计算为隐藏的节点标为 `hidden` 后移除样式,用于验证站点随机隐藏干扰文本不进入笔记。雪球公开长帖保留三图和三只明确股票;小宇宙新增“下课以后”单集样本,核验六个时间节点及明确的阿丁、毛毛主播文本。
+
+验证覆盖去敏真实 DOM、身份/隐藏/权限截断边界、实际打包后台与读取器的工具栏/菜单一致性、股票标签持久化及图片转存。Chromium 集成使用此工作区的新本地 Web/API,覆盖 18 个页面样本,包括新岗位、雪球长帖及明确主播单集;检查来源被屏蔽后的附件和编辑器重新打开、拒绝保存不创建笔记,并清理验收笔记和令牌。原始图片响应以测试 PNG 替换,因此不把夹具 E2E 当作真实 CDN 下载验收。Edge/Firefox 实站保存、Firefox Android、BOSS 其他版式/移动页面和所有登录态信息流仍未验证;未发布扩展商店版本。
+
+P2 基础验证:完整非 E2E 3,020 项单元测试和 17 项集成测试通过;根目录/移动端类型检查、Web 构建、Chromium/Firefox 扩展构建通过;Firefox lint 0 错误,保留 2 条已有依赖警告。18 样本 Chromium 保存流程与 HTML 安全测试均通过。当前代码尚未提交、推送或创建 P2 PR。
+
+2026-10-12 补充:打开扩展时,对 BOSS 岗位执行只读 DOM 探测。仅当前岗位正文中可见的“登录查看完整内容”标记触发琥珀色“需登录”角标和登录/刷新提示;隐藏的残留标记或无关登录控件不会触发。探测权限失败或途中导航显示“未识别”,不显示绿色适配勾选。此角标不保证其他字段完整,保存仍执行身份与全文校验。按钮保持可用,以保留有效文本选区;未选择文字的受限岗位仍拒绝创建笔记。提示不会覆盖已开始的保存反馈。
+
+登录角标补充验证:248 项扩展测试和根目录类型检查通过;Chromium 的 18 个页面样本保存流程同时验证可读/登录预览两种实际弹窗状态。Chromium/Firefox 构建通过,Firefox lint 保留原有 2 条警告、无错误。
+
+2026-10-13 审查修正:撤回无依据的 BOSS 元数据必填/薪资格式限制、雪球详情作者/时间链接必填及通用展开类名拒绝。股票标签与 Markdown 使用同一份净化正文,控件或脚本中的股票链接不再贡献标签;保留实例 24 标签上限,撤回无依据的股票代码 15 字符上限。CSS 过滤区分整子树隐藏与可由后代恢复的 `visibility`:去掉隐藏自身文字,保留显式恢复可见的子节点;BOSS 角标与小宇宙正文同步处理该边界。两份 BOSS 夹具进一步移除无关动作跳转、跟踪与安全参数。
+
+审查后验证:顺序执行完整非 E2E 测试,3,031 项单元测试和 17 项集成测试通过;根目录/移动端类型检查、Web 和 Chromium/Firefox 扩展构建通过,Firefox lint 0 错误、2 条已有依赖警告。Chromium 中的实际 CSS 可见性和惰性 HTML 安全测试通过。初次并行验证中几个未修改测试超时,隔离检查与最终完整重跑均通过;未修改这些测试或生产基础设施。18 样本集成重跑未完成:先遇到本地开发 API 代理 503/超时,改用 `EDGE_EVER_CLIPPER_TEST_INSTANCE_URL` 直连同一 workerd 后,小宇宙与 BOSS 的保存和 API 正文回读通过,但编辑器重开在本地 Vite 页面加载时超时。机器负载约 38 时,最后重跑仍在 Web 导航超时;未放宽测试时限或修改生产链路。先前 18 样本通过记录仅代表当时版本,本轮不声称整组 E2E 验收通过。本轮测试笔记及令牌已清理,并通过 API 回读确认无残留。
## Phase 1:五个社交平台(2026-10-10)
@@ -12,7 +193,7 @@ Facebook、Instagram、LinkedIn、Threads、Bluesky 已新增专用读取器。
| --- | --- | --- |
| Facebook | `facebook.com/{account}/posts/{id}`、`permalink.php`、`story.php` | 完整可读主帖、作者/组织、可用时间、已加载配图,排除评论与控件。 |
| Instagram | `instagram.com/p/{code}/`、`/reel/{code}/` | 完整可读配文、Handle、时间、完整已加载轮播图片或视频封面。 |
-| LinkedIn | `linkedin.com/posts/…-activity-{id}-…`、`/feed/update/urn:li:activity:{id}/` | 完整动态、发布者、时间、完整已加载图集。 |
+| LinkedIn | `linkedin.com/posts/…-{type}-{id}-…`、`/feed/update/urn:li:{type}:{id}/` | 完整动态、发布者、个人职业简介、时间、完整已加载图集(`type` 为 activity、ugcPost 或 share)。 |
| Threads | `threads.com/@{handle}/post/{code}` 及 `threads.net` 别名 | 完整动态、Handle、时间、已加载图片及明确引用内容。 |
| Bluesky | `bsky.app/profile/{handle}/post/{id}` | 正文、作者、可用时间、CDN 原尺寸图片及可见引用帖。 |
diff --git a/package.json b/package.json
index 7264bc86..a5006633 100644
--- a/package.json
+++ b/package.json
@@ -223,6 +223,7 @@
"patchedDependencies": {
+ "@joplin/[email protected]": "patches/@joplin%[email protected]"
}
}
diff --git a/packages/shared/src/document-extensions.ts b/packages/shared/src/document-extensions.ts
index 196727b0..a1d10238 100644
--- a/packages/shared/src/document-extensions.ts
+++ b/packages/shared/src/document-extensions.ts
@@ -1,7 +1,7 @@
import type { AnyExtension } from "@tiptap/core";
import Image from "@tiptap/extension-image";
import { TaskList } from "@tiptap/extension-list";
-import { TableKit } from "@tiptap/extension-table";
+import { EdgeEverTableKit as TableKit } from "./markdown-table";
import { Markdown } from "@tiptap/markdown";
import StarterKit from "@tiptap/starter-kit";
import { createEdgeEverDetailsExtensions } from "./details";
diff --git a/packages/shared/src/markdown-table.test.mjs b/packages/shared/src/markdown-table.test.mjs
new file mode 100644
index 00000000..17137fd5
--- /dev/null
+++ b/packages/shared/src/markdown-table.test.mjs
@@ -0,0 +1,14 @@
+import { expect, test } from "bun:test";
+import { docToMarkdown, markdownToDoc } from "./content.ts";
+
+test("only attribute-free table cell br tokens become hard breaks, preserving the HTML boundary",()=>{
+ const source='Outside <br> stays text.\n\n| Header<br>line | Other |\n| --- | --- |\n| **bold<br/>line** &lt;br&gt; `<br>` | <br onclick="bad()"><script>bad()</script> |';
+ const doc=markdownToDoc(source),nodes=[];
+ const walk=node=>{nodes.push(node);(node.content || []).forEach(walk);};walk(doc);
+ expect(nodes.filter(node=>node.type==='hardBreak')).toHaveLength(2);
+ expect(nodes.filter(node=>node.type==='text').map(node=>node.text).join('')).toContain('Outside <br> stays text.');
+ expect(nodes.filter(node=>node.type==='text').map(node=>node.text).join('')).toContain('<br onclick="bad()"><script>bad()</script>');
+ expect(nodes.find(node=>node.text==='<br>' && node.marks?.some(mark=>mark.type==='code'))).toBeDefined();
+ const again=markdownToDoc(docToMarkdown(doc)),breaks=[];const collect=node=>{if(node.type==='hardBreak')breaks.push(node);(node.content || []).forEach(collect);};collect(again);
+ expect(breaks).toHaveLength(2);
+});
diff --git a/packages/shared/src/markdown-table.ts b/packages/shared/src/markdown-table.ts
new file mode 100644
index 00000000..8c379045
--- /dev/null
+++ b/packages/shared/src/markdown-table.ts
@@ -0,0 +1,30 @@
+import type { MarkdownToken } from "@tiptap/core";
+import { TableKit } from "@tiptap/extension-table";
+
+// GFM cells use <br> for line breaks, including our own table serializer.
+// Recognize only this attribute-free token inside cells; arbitrary HTML and
+// literal tags inside text/code keep the normal Markdown safety boundary.
+const cellTokens = (tokens: MarkdownToken[]): MarkdownToken[] => tokens.map((token) =>
+ token.type === "html" && /^<br\s*\/?>$/i.test(token.raw || "")
+ ? { type: "br", raw: token.raw }
+ : token.tokens ? { ...token, tokens: cellTokens(token.tokens) } : token,
+);
+
+export const EdgeEverTableKit = TableKit.extend({
+ addExtensions() {
+ return (this.parent?.() ?? []).map((extension) => {
+ if(extension.name !== "table") return extension;
+ const parseMarkdown=extension.config.parseMarkdown!;
+ return extension.extend({
+ parseMarkdown(token, helpers) {
+ const cell = (value: { tokens: MarkdownToken[] }) => ({ ...value, tokens: cellTokens(value.tokens) });
+ return parseMarkdown.call(this,{
+ ...token,
+ header: token.header?.map(cell),
+ rows: token.rows?.map((row: Array<{ tokens: MarkdownToken[] }>) => row.map(cell)),
+ }, helpers);
+ },
+ });
+ });
+ },
+});
diff --git a/patches/@joplin%[email protected] b/patches/@joplin%[email protected]
new file mode 100644
index 00000000..6b071b3a
--- /dev/null
+++ b/patches/@joplin%[email protected]
@@ -0,0 +1,9 @@
+diff --git a/lib/turndown-plugin-gfm.cjs.js b/lib/turndown-plugin-gfm.cjs.js
+--- a/lib/turndown-plugin-gfm.cjs.js
++++ b/lib/turndown-plugin-gfm.cjs.js
+@@ -222,1 +222,1 @@
+- filteredContent = filteredContent.replace(/\|+/g, '\\|');
++ filteredContent = filteredContent.replace(/\|/g, '\\|');
+@@ -339,1 +339,2 @@
+ const tableShouldBeHtml = (tableNode, options) => {
++ if (options.preserveTableHtml === false) return false;
diff --git a/tests/e2e/web-clipper-html-safety.spec.ts b/tests/e2e/web-clipper-html-safety.spec.ts
index 39b71529..6a188ffa 100644
--- a/tests/e2e/web-clipper-html-safety.spec.ts
+++ b/tests/e2e/web-clipper-html-safety.spec.ts
@@ -7,9 +7,11 @@ test.use({ channel: "chromium" });
const extensionRoot = fileURLToPath(new URL("../../apps/extension/", import.meta.url));
const fixture = readFileSync(new URL("../../apps/extension/fixtures/platforms/xiaoyuzhou.html", import.meta.url), "utf8");
+const bossFixture = readFileSync(new URL("../../apps/extension/fixtures/platforms/boss.html", import.meta.url), "utf8");
+const bossPreview = readFileSync(new URL("../../apps/extension/fixtures/platforms/boss-login-required.html", import.meta.url), "utf8");
const readers = (await build({
stdin: {
- contents: 'import { readXiaoyuzhou } from "./src/xiaoyuzhou-clip"; globalThis.clipReaders = { readXiaoyuzhou };',
+ contents: 'import { readXiaoyuzhou } from "./src/xiaoyuzhou-clip"; import { bossLoginRequired, readBoss } from "./src/boss-clip"; globalThis.clipReaders = { readXiaoyuzhou, bossLoginRequired, readBoss };',
resolveDir: extensionRoot, sourcefile: "html-safety.ts",
},
bundle: true, platform: "browser", format: "iife", write: false,
@@ -20,6 +22,41 @@ test.beforeEach(async ({ page }) => {
await page.addScriptTag({ content: readers });
});
+test("BOSS visible descendants survive inherited visibility and the visible login warning still blocks full capture", async ({ page }) => {
+ // Use an attached DOM: computed CSS inheritance is the regression boundary.
+ await page.route('https://img.bosszhipin.com/**', route=>route.abort());
+ await page.setContent(bossFixture);
+ const result = await page.evaluate(() => {
+ const wrapper = document.createElement('div'), child = document.createElement('span');
+ wrapper.style.visibility = 'hidden'; wrapper.appendChild(document.createTextNode('HIDDEN PARENT TEXT'));
+ child.style.visibility = 'visible'; child.textContent = 'RESTORED VISIBLE JOB TEXT'; wrapper.appendChild(child);
+ document.querySelector('.job-sec-text')!.appendChild(wrapper);
+ const clip = (window as any).clipReaders.readBoss(document, 'https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html');
+ return { visible: getComputedStyle(child).visibility, clip };
+ });
+ expect(result.visible).toBe('visible');
+ expect(result.clip.ok).toBe(true);
+ expect(result.clip.clip.markdown).toContain('RESTORED VISIBLE JOB TEXT');
+ expect(result.clip.clip.markdown).not.toContain('HIDDEN PARENT TEXT');
+ await page.setContent(bossPreview);
+ const restricted = await page.evaluate(() => {
+ (document.querySelector('.zp-more-info-layer-wrapper') as HTMLElement).style.visibility = 'hidden';
+ (document.querySelector('.zp-more-info-layer-text') as HTMLElement).style.visibility = 'visible';
+ return { warning: (window as any).clipReaders.bossLoginRequired(), read: (window as any).clipReaders.readBoss(document, 'https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html') };
+ });
+ expect(restricted.warning).toBe(true);
+ expect(restricted.read.ok).toBe(false);
+ const nested = await page.evaluate(() => {
+ const label = document.querySelector('.zp-more-info-layer-text') as HTMLElement;
+ label.style.visibility = 'hidden'; label.innerHTML = '<span style="visibility:visible">登录查看完整内容</span>';
+ const visibleWarning = (window as any).clipReaders.bossLoginRequired();
+ const read = (window as any).clipReaders.readBoss(document, 'https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html');
+ label.style.visibility = 'visible'; label.innerHTML = '<span hidden>登录查看完整内容</span>';
+ return { visibleWarning, read, hiddenWarning: (window as any).clipReaders.bossLoginRequired() };
+ });
+ expect(nested.visibleWarning).toBe(true); expect(nested.read.ok).toBe(false); expect(nested.hiddenWarning).toBe(false);
+});
+
test("Show Notes validation does not execute markup or request embedded resources", async ({ page }) => {
const requests: string[] = [];
await page.route("https://clip-probe.test/**", async (route) => {
diff --git a/tests/e2e/web-clipper-platforms.spec.ts b/tests/e2e/web-clipper-platforms.spec.ts
index 0bb1ffc8..e3439a3b 100644
--- a/tests/e2e/web-clipper-platforms.spec.ts
+++ b/tests/e2e/web-clipper-platforms.spec.ts
@@ -1,6 +1,7 @@
import { E2E_STORAGE_STATE_PATH } from "./global-setup";
import { chromium, expect, request as playwrightRequest, test, type BrowserContext, type Worker } from "@playwright/test";
import { execFileSync } from "node:child_process";
+import { createHash } from "node:crypto";
import { cpSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { createServer } from "node:http";
import type { AddressInfo } from "node:net";
@@ -12,10 +13,26 @@ declare const chrome: any;
const repositoryRoot = resolve(fileURLToPath(new URL("../..", import.meta.url)));
const png = Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=", "base64");
const platforms = [
+ { name: "xueqiu-feed", url: "https://www.xueqiu.com/", title: "$泡泡玛特(09992)$之前我一直在说,投资一定要祛魅,不要神化任何一个所谓的投资大佬。雪球上有个网友跟段永平开了个玩笑,说能不能借他一个亿去买纳指ETF。段永平直接回了一句:你当我弱智啊。就这一句回复,其实就能看出来一个人的格局和胸怀。", text: "把自己的真金白银押在别人的嘴上,早晚是要付出代价的。", excluded: "DETAIL HIDDEN SENTINEL", imageCount: 1, targetUrl: "https://xueqiu.com/2754211668/411841572" },
+ { name: "linkedin-person", url: "https://www.linkedin.com/posts/maddyahmad_softwareengineering-artificialintelligence-share-7456582751698190336-6NVK/", title: "AI isn't coming for software engineers, but it is definitely reshaping what great engineers look like.".slice(0,100), text: "What technology are you focusing on in 2026", excluded: "3 度+", imageCount: 0 },
+ { name: "jike-feed", url: "https://m.okjike.com/topics/63579abb6724cc583b9bba9a", title: "今天和朋友聊了很久,关于 AI 对游戏、影视以及整个内容行业的影响。越聊越觉得,我们现在正站在一个很有意思的历史节点上。聊天内容过长,我已经重新整理,补充部分论证例子,讨论如下:01|我们正在经历一场被压缩到 1–2 年的“雅达利大崩溃”。", text: "护城河", excluded: "Ambi", imageCount: 1, targetUrl: "https://m.okjike.com/originalPosts/6ace942f756bbb66581c3f96", realCdn: true },
+ { name: "wechat", url: "https://mp.weixin.qq.com/s/TC-ONpL3PGklsD0yhtcuBQ", title: "华为云DeepSeek-R1&V3满血版体验:10分钟让你轻松掌握AI大模型应用技巧!", text: "选择模型进行对话", excluded: "点击上方蓝字", imageCount: 21 },
+ { name: "jike", url: "https://m.okjike.com/originalPosts/66ac89b0314f5cced41012d3", title: "AI 分析了我的即刻动态,给出了这个结论。绝了。@评论尸 提供的 Prompt。", text: "提供的 Prompt", excluded: "热门评论", imageCount: 1 },
+ { name: "jike-grid", url: "https://m.okjike.com/originalPosts/6715e824d9dc81724c2ec74d", title: "又凑了九张赤坎游客照📷", text: "九张赤坎游客照", excluded: "热门评论", imageCount: 9 },
+ { name: "jike-long", url: "https://m.okjike.com/originalPosts/64c9dd9a2edae6abdc610605", title: "我在即刻写东西的核心原则是,怕什么真理无穷,进一步有一步的欢喜。当我每次取得一点点微小的进步,我都会快速地将自己的方法、启发和心得分享出来。这才是即刻涨粉的正道,既有利于你的成长,又有利于平台的发展,互利共赢。希望能激励到更多人分享自己的所", text: "《世界尽头的咖啡馆》和《斯坦福大学人生设计课》", excluded: "热门评论", imageCount: 1 },
+ { name: "sspai", url: "https://sspai.com/post/92653", title: "已经能测夜间体征的 Apple Watch,为什么要再做一个睡眠呼吸暂停提醒", text: "手腕上的「心率检测」靠谱吗", excluded: "作者提示", imageCount: 9 },
+ { name: "juejin", url: "https://juejin.cn/post/6972051526416072717", title: "JavaScript异步发展历史", text: "let readFile", excluded: "复制代码", imageCount: 2 },
+ { name: "douban-book", url: "https://book.douban.com/review/16093028/", title: "行走在文字间,是我与这个世界达成的和解", text: "直到精疲力尽", excluded: "有关键情节透露", imageCount: 6 },
+ { name: "douban-movie", url: "https://movie.douban.com/review/17798662/", title: "假如没有越狱成功,安迪也仍是自由的", text: "To be honest", excluded: "有关键情节透露", imageCount: 2 },
+ { name: "douban-music", url: "https://music.douban.com/review/17855287/", title: "回来击穿他的肚脐眼", text: "Ink乐评", excluded: "有关键情节透露", imageCount: 3 },
+ { name: "douban-note", url: "https://www.douban.com/note/814698224/", title: "雨中小镇", text: "我和我身边的人", excluded: "赞赏", imageCount: 6 },
+ { name: "xiaoyuzhou-hosts", url: "https://www.xiaoyuzhoufm.com/episode/612375e57f89405077cbeb3b", title: "第0期|教培行业凉了,为什么我们选择开始做教育?", text: "阿丁、毛毛", excluded: "登录/注册", imageCount: 1 },
+ { name: "boss", url: "https://www.zhipin.com/job_detail/0d7e760b0a0e7c3a0nF939S0E1NU.html", title: "AI平台开发工程师", text: "5、熟悉OCR技术", excluded: "立即沟通", imageCount: 0 },
+ { name: "xueqiu", url: "https://xueqiu.com/5636485254/253443400", title: "通威太阳能(组件)盐城基地首车组件顺利发运", text: "及时高效响应全球客户和市场", excluded: "用的陕汽的重卡送货", imageCount: 3 },
{ name: "hacker-news", url: "https://news.ycombinator.com/item?id=40380738", title: "Show HN: I built a LLM-powered Ask HN: like Perplexity, but for HN comments", text: "Ollama on your machine!", excluded: "Matching the HN style", imageCount: 0 },
{ name: "v2ex", url: "https://www.v2ex.com/t/1000000", title: "程序员如何从公司上班转型", text: "看看大家多久后能来还愿", excluded: "抱歉跑个题", imageCount: 0 },
{ name: "xiaoyuzhou", url: "https://www.xiaoyuzhoufm.com/episode/62ad4ae5f9b62781ea058a02", title: "025. 快!抓紧时间拖延!", text: "韦礼安", excluded: "宝子姐生日快乐", imageCount: 1 },
- { name: "facebook", url: "https://www.facebook.com/NASA/posts/pfbid0dPToN66CzcAHGMoaNe3jszH4FfBKvqkE5gogCNJkTxXDPsSGYrGvcVwsLgByyMQQl", title: "Brewing up baby stars NASA's James Webb Space Telescope's unique view reveals many previously hidden", text: "in the red cloud", excluded: "That eight-pronged diffraction pattern", imageCount: 1 },
+ { name: "facebook", url: "https://www.facebook.com/NASA/posts/pfbid0dPToN66CzcAHGMoaNe3jszH4FfBKvqkE5gogCNJkTxXDPsSGYrGvcVwsLgByyMQQl", title: "Brewing up baby stars ⭐NASA's James Webb Space Telescope's unique view reveals many previously hidde", text: "in the red cloud", excluded: "That eight-pronged diffraction pattern", imageCount: 1 },
{ name: "instagram", url: "https://www.instagram.com/p/DeAYvsnn4la/", title: "Swipe for countless stars", text: "Sagittarius B2", excluded: "smallsciencesociety", imageCount: 3 },
{ name: "instagram-slide-captions", url: "https://www.instagram.com/p/DeKe6teEpya/", title: "Warning: These slides may cause existential wonder ✨To celebrate World Space Week, today’s #GoogleDoodle spotlights a never-before-seen photo".slice(0,120), text: "how do astronomers turn raw space data into breathtaking images", excluded: "My first love", imageCount: 20 },
{ name: "threads", url: "https://www.threads.com/@nasa/post/DZceA72Drjf", title: "This is the second week of Moon Joy June, and the prompt is “Moon.” If you’re looking for some inspiration, we have a treat for you: four new and previously unseen images from our Artemis II mission!".slice(0,120), text: "Artemis Art Show topic!", excluded: "chronicxdecay", imageCount: 4 },
@@ -35,18 +52,26 @@ test("platform clips persist through the extension and local API; archived image
const directory = mkdtempSync(join(tmpdir(), "edgeever-platform-extension-"));
const profile = mkdtempSync(join(tmpdir(), "edgeever-platform-browser-"));
cpSync(join(repositoryRoot, "apps/extension/dist"), directory, { recursive: true });
+ const backgroundPath=join(directory,"assets/background.js");
+ // Expose only the registered menu callback in this temporary test build.
+ // Pointer, capture and persistence still use the production bundle.
+ writeFileSync(backgroundPath,`const menuListener=chrome.contextMenus.onClicked.addListener.bind(chrome.contextMenus.onClicked);chrome.contextMenus.onClicked.addListener=(listener)=>{globalThis.__edgeeverTestMenuClick=listener;menuListener(listener);};\n${readFileSync(backgroundPath,"utf8")}`);
const manifestPath = join(directory, "manifest.json");
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
// The test cannot grant activeTab by clicking browser chrome. Give only this
// temporary build the sampled hosts, image host and local instance access.
- manifest.host_permissions = ["http://127.0.0.1/*", ...platforms.map((entry)=>`${new URL(entry.url).origin}/*`)];
+ manifest.host_permissions = ["http://127.0.0.1/*", "https://cdnv2.ruguoapp.com/*", "https://www.lennysnewsletter.com/*", ...platforms.map((entry)=>`${new URL(entry.url).origin}/*`)];
writeFileSync(manifestPath, JSON.stringify(manifest));
let sourceBlocked = false;
const imageServer = createServer((_req,res) => { res.writeHead(sourceBlocked ? 503 : 200, { "Content-Type": "image/png", "Access-Control-Allow-Origin": "*" }); res.end(sourceBlocked ? "blocked" : png); });
await new Promise<void>((done)=>imageServer.listen(0,"127.0.0.1",done));
const imageOrigin=`http://127.0.0.1:${(imageServer.address() as AddressInfo).port}`;
- const request = await playwrightRequest.newContext({baseURL:process.env.EDGE_EVER_CLIPPER_TEST_INSTANCE_URL || baseURL,storageState:E2E_STORAGE_STATE_PATH,timeout:15_000});
+ // The internal workerd URL serves both the built Web app and its API. Use
+ // that same origin for the editor, avoiding a request-forwarding test proxy.
+ const builtInstanceUrl = process.env.EDGE_EVER_CLIPPER_TEST_INSTANCE_URL;
+ const instanceUrl = builtInstanceUrl || baseURL;
+ const request = await playwrightRequest.newContext({baseURL:instanceUrl,storageState:E2E_STORAGE_STATE_PATH,timeout:15_000});
let context: BrowserContext | undefined;
let tokenId = "";
const memoIds: string[] = [];
@@ -57,70 +82,151 @@ test("platform clips persist through the extension and local API; archived image
expect(tokenResponse.status()).toBe(201);
const { token, apiToken } = await tokenResponse.json(); tokenId = apiToken.id;
context = await chromium.launchPersistentContext(profile, {
- channel: "chromium", locale: "zh-CN", timezoneId: "Asia/Shanghai", args: [`--disable-extensions-except=${directory}`, `--load-extension=${directory}`],
+ channel: "chromium", locale: "zh-CN", timezoneId: "Asia/Shanghai", args: [`--disable-extensions-except=${directory}`, `--load-extension=${directory}`, "--host-resolver-rules=MAP clipper.localhost 127.0.0.1"],
});
context.setDefaultTimeout(15_000);
context.setDefaultNavigationTimeout(15_000);
- await context.addCookies(JSON.parse(readFileSync(E2E_STORAGE_STATE_PATH,"utf8")).cookies);
- if (process.env.EDGE_EVER_CLIPPER_TEST_INSTANCE_URL) {
- await context.route(`${new URL(baseURL!).origin}/api/**`,async(route)=> {
- const url=new URL(route.request().url());
- const direct=new URL(url.pathname+url.search,process.env.EDGE_EVER_CLIPPER_TEST_INSTANCE_URL);
- await route.fulfill({response:await route.fetch({url:direct.href,timeout:15_000})});
- });
- }
+ const cookies=JSON.parse(readFileSync(E2E_STORAGE_STATE_PATH,"utf8")).cookies;
+ await context.addCookies(cookies);
+ await context.addCookies(cookies.filter((cookie:any)=>cookie.domain === "127.0.0.1").map((cookie:any)=>({...cookie,domain:"clipper.localhost"})));
const worker: Worker = context.serviceWorkers()[0] ?? await context.waitForEvent("serviceworker");
- await worker.evaluate((settings) => chrome.storage.local.set(settings), { instanceUrl: process.env.EDGE_EVER_CLIPPER_TEST_INSTANCE_URL || baseURL!, token, notebookId: "" });
+ await worker.evaluate((settings) => chrome.storage.local.set(settings), { instanceUrl: instanceUrl!, token, notebookId: "" });
const article = context.pages()[0] ?? await context.newPage();
let failure = false;
let currentPlatform: typeof platforms[number] | undefined;
const sourceRequests: string[] = [];
const imageUrls = new Map<string,number>();
await context.route(/^https:\/\//, async (route) => {
- const url = route.request().url(); sourceRequests.push(url);
+ const url = route.request().url();
+ // Native players may preload their source when the fixture renders.
+ // Clipper fetches still count, including an accidental audio download.
+ if(route.request().resourceType() !== "media") sourceRequests.push(url);
if (sourceBlocked) { await route.abort(); return; }
- const platform = currentPlatform?.url === url ? currentPlatform : undefined;
- if (!platform) { await route.abort(); return; }
+ const feedDetail=currentPlatform?.name === "xueqiu-feed" && url === "https://www.xueqiu.com/2754211668/411841572";
+ const platform = currentPlatform?.url === url || feedDetail ? currentPlatform : undefined;
+ if (!platform) {
+ if(currentPlatform?.realCdn && new URL(url).hostname === "cdnv2.ruguoapp.com") await route.continue();
+ else await route.abort();
+ return;
+ }
const articlePlatform = platform.name === "medium-article" || platform.name === "substack-article";
- const html = failure ? articlePlatform
- ? readFileSync(join(repositoryRoot, `apps/extension/fixtures/platforms/${platform.name}.html`), "utf8").replace("<article", "<article hidden")
+ let html = failure && platform.name === "boss" ? readFileSync(join(repositoryRoot, "apps/extension/fixtures/platforms/boss-login-required.html"), "utf8") : failure && platform.name !== "xueqiu-feed" ? articlePlatform
+ ? readFileSync(join(repositoryRoot, `apps/extension/fixtures/platforms/${feedDetail ? "xueqiu-feed-detail-second" : platform.name}.html`), "utf8").replace("<article", "<article hidden")
: "<html><body><h1>Sign in</h1><p>Unrelated comments</p></body></html>"
- : readFileSync(join(repositoryRoot, `apps/extension/fixtures/platforms/${platform.name}.html`), "utf8")
- .replace(/https:\/\/(?:bts-image\.xyzcdn\.net|cdn\.bsky\.app|[^/]+\.fbcdn\.net|[^/]+\.cdninstagram\.com|media\.licdn\.com|miro\.medium\.com|substackcdn\.com(?=\/image\/))\/[^"\s<]+/g, (original) => `${imageOrigin}/${new URL(original).hostname}${new URL(original).pathname}?image=${imageUrls.get(original) || (()=>{const id=imageUrls.size+1;imageUrls.set(original,id);return id;})()}`);
+ : platform.realCdn ? readFileSync(join(repositoryRoot, `apps/extension/fixtures/platforms/${feedDetail ? "xueqiu-feed-detail-second" : platform.name}.html`), "utf8")
+ : readFileSync(join(repositoryRoot, `apps/extension/fixtures/platforms/${feedDetail ? "xueqiu-feed-detail-second" : platform.name}.html`), "utf8")
+ .replace(/https:\/\/(?:mmbiz\.qpic\.cn|cdnv2\.ruguoapp\.com|cdnfile\.sspai\.com|img-blog\.csdnimg\.cn|img[0-9]\.doubanio\.com|image\.xyzcdn\.net|xqimg\.imedao\.com|bts-image\.xyzcdn\.net|cdn\.bsky\.app|[^/]+\.fbcdn\.net|[^/]+\.cdninstagram\.com|media\.licdn\.com|miro\.medium\.com|substackcdn\.com(?=\/image\/))\/[^"\s<]+/g, (original) => `${imageOrigin}/${new URL(original).hostname}${new URL(original).pathname}?image=${imageUrls.get(original) || (()=>{const id=imageUrls.size+1;imageUrls.set(original,id);return id;})()}`);
+ if(feedDetail) html=html.replace('</head>',`<style>.detail-hidden-sentinel{display:none}${failure ? '.article__bd__detail{display:none}' : ''}</style></head>`)
+ .replace('class="article__bd__detail">','class="article__bd__detail"><p class="detail-hidden-sentinel">DETAIL HIDDEN SENTINEL</p>')
+ .replace('</body>','<script>parent.document.documentElement.dataset.detailScriptRan="yes";</script></body>');
await route.fulfill({ contentType: "text/html; charset=utf-8", body: html });
});
const senderPromise = context.waitForEvent("page");
await worker.evaluate(() => chrome.windows.create({ url: chrome.runtime.getURL("options.html"), focused: false }));
const sender = await senderPromise; await sender.waitForLoadState();
- const save = async (url: string) => {
+ const activate = async (url: string) => {
await worker.evaluate(async (targetUrl) => {
const [tab] = await chrome.tabs.query({ url: targetUrl });
await chrome.tabs.update(tab.id, { active: true });
await chrome.windows.update(tab.windowId, { focused: true });
}, url);
+ };
+ const save = async (url: string) => {
+ await activate(url);
return sender.evaluate(() => chrome.runtime.sendMessage({ type: "captureCurrentPage" }));
};
+ const checkBossPopup = async (url: string, needsLogin: boolean) => {
+ await activate(url);
+ await sender.goto(worker.url().replace(/\/assets\/background\.js$/, '/popup.html'));
+ await expect(sender.locator('#capture-mode')).toHaveText(needsLogin ? '需登录' : '已适配');
+ await expect(sender.locator('#capture-context')).toHaveAttribute('data-kind', needsLogin ? 'login-required' : 'adapted');
+ if (needsLogin) {
+ await expect(sender.locator('#status')).toContainText('请在网站登录并刷新');
+ await expect(sender.locator('#capture-context .lucide-check')).toHaveCount(0);
+ await expect(sender.locator('#save')).toBeEnabled();
+ await sender.screenshot({path:'/tmp/edgeever-p2-boss-login-popup.png'});
+ }
+ };
for (const platform of platforms) {
currentPlatform = platform;
console.log("Verifying",platform.name);
const before = (await (await request.get("/api/v1/memos?limit=100")).json()).memos as Array<{ id: string }>;
const oldIds = new Set(before.map((memo) => memo.id));
await article.goto(platform.url);
- const saved = await save(platform.url);
+ if (platform.name === 'boss') await checkBossPopup(platform.url, false);
+ let saved;
+ if(platform.targetUrl) {
+ if(platform.name === "xueqiu-feed") await article.locator('a[class*="date-and-source_"][href="/2754211668/411841572"]').dispatchEvent("contextmenu");
+ else await article.locator(".post-item-li").nth(1).locator(".text").dispatchEvent("contextmenu");
+ await expect(article.locator("[data-edgeever-social-target]")).toHaveAttribute("data-edgeever-social-target",platform.targetUrl);
+ expect((await save(platform.url)).ok).toBe(false);
+ await worker.evaluate(async ({url,menu})=>{
+ const [tab]=await chrome.tabs.query({url});
+ (globalThis as any).__edgeeverTestMenuClick({menuItemId:menu,pageUrl:url,frameId:0},tab);
+ },{url:platform.url,menu:platform.name === "xueqiu-feed" ? "save-xueqiu" : "save-jike"});
+ await expect.poll(async()=> (await (await request.get("/api/v1/memos?limit=100")).json()).memos.filter((memo:any)=>!oldIds.has(memo.id)).length).toBe(1);
+ // Image rewriting happens after creation; wait for its resource URL.
+ await expect.poll(async()=> {
+ const notes=(await (await request.get("/api/v1/memos?limit=100")).json()).memos;
+ const note=notes.find((memo:any)=>!oldIds.has(memo.id));
+ if(!note) return false;
+ if(!memoIds.includes(note.id)) memoIds.push(note.id);
+ const {memo}=await (await request.get(`/api/v1/memos/${note.id}`)).json();
+ return memo.contentMarkdown.includes('/api/v1/resources/');
+ }).toBe(true);
+ saved={ok:true};
+ } else saved = await save(platform.url);
console.log("Saved",platform.name,saved);
expect(saved.ok).toBe(true);
const after = (await (await request.get("/api/v1/memos?limit=100")).json()).memos as Array<{ id: string; title: string }>;
const note = after.find((memo) => !oldIds.has(memo.id) && memo.title === platform.title);
- memoIds.push(...after.filter((memo) => !oldIds.has(memo.id)).map((memo) => memo.id));
+ memoIds.push(...after.filter((memo) => !oldIds.has(memo.id) && !memoIds.includes(memo.id)).map((memo) => memo.id));
expect(note, platform.name).toBeTruthy();
const detail = await request.get(`/api/v1/memos/${note!.id}`);
expect(detail.ok()).toBe(true);
const { memo } = await detail.json();
expect(memo.contentMarkdown).toContain(platform.text);
expect(memo.contentMarkdown).not.toContain(platform.excluded);
+ if(platform.name === "douban-book") {
+ expect(memo.contentMarkdown).toContain("\n\n在路上,我遇到了瓦尔泽");
+ expect(memo.contentMarkdown).toContain("\n\n有人说,他写的是西方的散文");
+ }
+ if(platform.name === "sspai") {
+ expect(memo.contentMarkdown).toContain("> **中国大陆推出睡眠呼吸暂停迹象提示功能**");
+ expect(memo.contentMarkdown).toContain("> 2026 年 10 月 14 日,Apple 在中国大陆正式推出");
+ }
+ if(platform.name === "wechat") {
+ expect(memo.contentMarkdown).toContain("## 什么是Deepseek V3");
+ expect(memo.contentMarkdown).toMatch(/^###\s+第一步:注册华为云账号$/m);
+ }
+ if (platform.name === "juejin") expect(memo.contentMarkdown).toContain("```javascript\nlet readFile = (path, callBack) => {");
expect(memo.contentMarkdown).toContain(platform.name === "linkedin" ? "https://www.linkedin.com/feed/update/urn:li:activity:7497764718095323136/"
- : platform.name.startsWith("linkedin-ugc") ? "https://www.linkedin.com/feed/update/urn:li:ugcPost:7497764716677758977/" : platform.url);
+ : platform.name === "linkedin-person" ? "https://www.linkedin.com/feed/update/urn:li:share:7456582751698190336/" : platform.name.startsWith("linkedin-ugc") ? "https://www.linkedin.com/feed/update/urn:li:ugcPost:7497764716677758977/" : platform.targetUrl || platform.url);
expect(memo.contentMarkdown).toMatch(/抓取时间: \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\b/);
+ if (platform.name === "linkedin-person") {
+ expect(memo.contentMarkdown).toContain("作者: Mohammad Ahmed · Technical Lead - Backend at Dizzaract");
+ expect(memo.contentMarkdown).toContain("5 个月前");
+ }
+ if (platform.name === "boss") {
+ for (const text of ["25-50K·13薪", "深圳 5-10年 本科", "130个国家和地区", "深圳福田区博今国际A座", "五险一金"]) expect(memo.contentMarkdown).toContain(text);
+ }
+ if (platform.name === "xueqiu-feed") {
+ expect(memo.tags).toEqual(expect.arrayContaining(["web-clip","xueqiu","投资","09992","NTES"]));
+ await expect(article.locator('iframe[sandbox="allow-same-origin"]')).toHaveCount(0);
+ expect(await article.evaluate(()=>document.documentElement.dataset.detailScriptRan)).toBeUndefined();
+ }
+ if (platform.name === "xueqiu") {
+ expect(memo.tags).toEqual(expect.arrayContaining(["web-clip", "xueqiu", "投资", "SH600438", "SH601012", "SH688472"]));
+ expect(memo.contentMarkdown).toContain("2023-06-17 07:54:12");
+ }
+ if (platform.name === "medium-article" || platform.name === "substack-article") {
+ expect(memo.tags).toEqual(expect.arrayContaining(["web-clip",platform.name === "medium-article" ? "medium" : "substack"]));
+ expect(memo.contentMarkdown).toContain(platform.name === "medium-article" ? "Scott Batson" : "Ethan Mollick");
+ expect(memo.contentMarkdown).toContain(platform.name === "medium-article" ? "2026-09-01 02:48:46" : "2026-10-01 18:54:12");
+ }
+ if (platform.name === "xiaoyuzhou") {
+ for (const stamp of ["02:52", "08:00", "14:20", "19:20", "30:43", "34:00", "38:52", "54:30"]) expect(memo.contentMarkdown).toContain(stamp);
+ }
if (platform.name === "v2ex") {
expect(memo.contentMarkdown).toContain("2023-12-13 13:25:31");
expect(memo.contentMarkdown).toContain("2023-12-13 14:47:02");
@@ -135,24 +241,69 @@ test("platform clips persist through the extension and local API; archived image
for (const resource of resources) {
const blob = await request.get(`/api/v1/resources/${resource[1]}/blob`);
expect(blob.ok()).toBe(true);
- expect(Buffer.from(await blob.body()).equals(png)).toBe(true);
+ if(platform.realCdn) {
+ expect(blob.headers()["content-type"]).toContain("image/jpeg");
+ expect(createHash("md5").update(await blob.body()).digest("base64")).toBe("OwtQdRowjgnW2tBYjA4j2A==");
+ } else expect(Buffer.from(await blob.body()).equals(png)).toBe(true);
}
}
const preview = await context.newPage();
- await preview.goto(baseURL!);
+ const verifyWarmOffline=platform.realCdn && !!builtInstanceUrl;
+ const webUrl=verifyWarmOffline ? instanceUrl!.replace("127.0.0.1","clipper.localhost") : instanceUrl!;
+ await preview.goto(webUrl);
+ if(verifyWarmOffline) {
+ // The default Vite development server intentionally disables the PWA.
+ // A configured built instance must register its actual Service Worker.
+ await expect.poll(()=>preview.evaluate(()=>!!navigator.serviceWorker.controller)).toBe(true);
+ }
await preview.getByRole("button", { name: "全部笔记", exact: true }).click();
await preview.getByPlaceholder("搜索笔记").fill(platform.title);
await preview.locator(`[data-memo-id="${note!.id}"]`).locator("button").first().click();
const editor = preview.locator(".ProseMirror");
await expect(editor).toContainText(platform.text);
- await expect(editor).not.toContainText(platform.excluded);
+ if(platform.name === "douban-book") {
+ await expect(editor.locator("p").filter({hasText:"在路上,我遇到了瓦尔泽"})).toHaveText(/^在路上,我遇到了瓦尔泽/);
+ await expect(editor.locator("p").filter({hasText:"有人说,他写的是西方的散文"})).toHaveText(/^有人说,他写的是西方的散文/);
+ }
+ if(platform.name === "juejin") {
+ const table=editor.locator("table");
+ await expect(table).toHaveCount(1);
+ await expect(table.locator("tr")).toHaveCount(5);
+ await expect(table.locator("th")).toHaveText(["发展史","优点","缺点"]);
+ for(const [index,label] of ["callback","promise","generator","async/await"].entries()) {
+ await expect(table.locator("tr").nth(index+1).locator("td")).toHaveCount(3);
+ await expect(table.locator("tr").nth(index+1).locator("td").first()).toHaveText(label);
+ }
+ await expect(table.locator("a")).toHaveText("事件循环");
+ }
+ if(platform.name === "sspai") {
+ const update=editor.locator("blockquote").filter({hasText:"中国大陆推出睡眠呼吸暂停迹象提示功能"});
+ await expect(update).toHaveCount(1);
+ await expect(update.locator("strong")).toHaveText("中国大陆推出睡眠呼吸暂停迹象提示功能");
+ await expect(update).toContainText("以下内容于 10:00更新");
+ await expect(update).toContainText("2026 年 10 月 14 日,Apple 在中国大陆正式推出");
+ }
+ if(platform.name === "wechat") {
+ await expect(editor.locator("h2").filter({hasText:"什么是Deepseek V3"})).toHaveCount(1);
+ await expect(editor.locator("h3").filter({hasText:"第一步:注册华为云账号"})).toHaveCount(1);
+ }
+ // Code-copy buttons are added by EdgeEver's editor after loading. They
+ // are not part of the archived article or its source-site controls.
+ const articleText = await editor.evaluate(element => {
+ const copy = element.cloneNode(true) as Element;
+ copy.querySelectorAll(".edgeever-code-copy-button").forEach(button => button.remove());
+ return copy.textContent || "";
+ });
+ expect(articleText).not.toContain(platform.excluded);
await expect(editor.locator("p").filter({ hasText: "抓取时间:" })).toContainText(/抓取时间: \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/);
if (platform.name === "v2ex") {
await expect(editor).toContainText("2023-12-13 14:47:02");
await expect(editor).toContainText("2023-12-14 15:00:40");
}
if (platform.imageCount) {
- const images = editor.locator("img");
+ // ProseMirror inserts source-less separator images around inline
+ // content; count the article images, excluding those editor controls.
+ const images = editor.locator("img:not(.ProseMirror-separator)");
await expect(images).toHaveCount(platform.imageCount);
for (let index=0;index<platform.imageCount;index++) {
const image=images.nth(index);
@@ -160,16 +311,68 @@ test("platform clips persist through the extension and local API; archived image
await expect.poll(() => image.evaluate((element) => (element as HTMLImageElement).complete && (element as HTMLImageElement).naturalWidth > 0)).toBe(true);
}
}
+ if(verifyWarmOffline) {
+ const paths=[...memo.contentMarkdown.matchAll(/!\[[^\]]*\]\((\/api\/v1\/resources\/[^/)]+\/blob)\)/g)].map((match:any)=>match[1]);
+ await expect.poll(()=>preview.evaluate(async paths=>{
+ const cache=await caches.open("edgeever-resource-blobs");
+ return Promise.all(paths.map(path=>cache.match(path).then(Boolean)));
+ },paths)).toEqual(paths.map(()=>true));
+ const mirrored=await preview.evaluate(id=>new Promise<boolean>((resolve,reject)=>{
+ const open=indexedDB.open("edgeever-local");open.onerror=()=>reject(open.error);
+ open.onsuccess=()=>{const db=open.result,get=db.transaction("memos").objectStore("memos").getAll();
+ get.onsuccess=()=>{resolve(get.result.some((memo:any)=>memo.id===id));db.close();};get.onerror=()=>reject(get.error);};
+ }),note!.id);
+ expect(mirrored).toBe(true);
+ // Prepare the cached all-notes list online; searching is a separate
+ // query lifecycle, while this case verifies reopening a cached note.
+ await preview.getByPlaceholder("搜索笔记").fill("");
+ // The current note list virtualizes rows; verify the two rows needed
+ // for switching away and back rather than counting the whole dataset.
+ await expect(preview.locator(`[data-memo-id="${note!.id}"]`)).toHaveCount(1);
+ await expect(preview.locator(`[data-memo-id]:not([data-memo-id="${note!.id}"])`).first()).toBeVisible();
+ await context.setOffline(true);
+ try {
+ expect(await preview.evaluate(()=>navigator.onLine)).toBe(false);
+ expect(await preview.evaluate(async()=>{try{await fetch("/api/v1/auth/session");return false;}catch{return true;}})).toBe(true);
+ await preview.locator(`[data-memo-id]:not([data-memo-id="${note!.id}"])`).first().locator("button").first().click();
+ await expect.poll(()=>editor.evaluateAll((nodes,text)=>nodes.some(node=>node.textContent?.includes(text)),platform.text)).toBe(false);
+ await preview.locator(`[data-memo-id="${note!.id}"]`).locator("button").first().click();
+ await expect(editor).toContainText(platform.text);
+ const images=editor.locator("img:not(.ProseMirror-separator)");await expect(images).toHaveCount(platform.imageCount);
+ await expect.poll(()=>images.first().evaluate(img=>(img as HTMLImageElement).naturalWidth > 0)).toBe(true);
+ await preview.getByPlaceholder("搜索笔记").fill('6ace942f756bbb66581c3f96');
+ await expect(preview.locator('[data-memo-id]')).toHaveCount(1);
+ await preview.locator(`[data-memo-id="${note!.id}"]`).locator("button").first().click();
+ await expect(editor).toContainText(platform.text);
+ console.log("Verified real CDN archival and warm Web offline reopen",platform.name);
+ } finally {await context.setOffline(false);}
+ }
await preview.close();
sourceBlocked = false;
// Recognized articles also refuse hidden content without a fallback note.
failure = true;
await article.goto(platform.url);
- expect((await save(platform.url)).ok).toBe(false);
+ if (platform.name === 'boss') await checkBossPopup(platform.url, true);
+ if(platform.name === "xueqiu-feed") {
+ await article.locator('a[class*="date-and-source_"][href="/2754211668/411841572"]').dispatchEvent("contextmenu");
+ await worker.evaluate(async url=>{const [tab]=await chrome.tabs.query({url});(globalThis as any).__edgeeverTestMenuClick({menuItemId:"save-xueqiu",pageUrl:url,frameId:0},tab);},platform.url);
+ await expect(article.locator('#edgeever-clipper-toast [data-sonner-toast][data-type="error"]')).toBeVisible();
+ await expect(article.locator('iframe[sandbox="allow-same-origin"]')).toHaveCount(0);
+ } else expect((await save(platform.url)).ok).toBe(false);
const unchanged = (await (await request.get("/api/v1/memos?limit=100")).json()).memos as Array<{ id: string }>;
expect(unchanged.filter((memo) => !oldIds.has(memo.id)).map((memo) => memo.id)).toEqual([note!.id]);
failure = false;
}
+ currentPlatform={name:'substack-paywall',url:'https://www.lennysnewsletter.com/p/how-to-build-ai-product-sense',title:'How to build AI product sense',text:'',excluded:'',imageCount:0};
+ const beforePaywall=(await (await request.get("/api/v1/memos?limit=100")).json()).memos.map((memo:any)=>memo.id);
+ await article.goto(currentPlatform.url);await activate(currentPlatform.url);
+ await sender.goto(worker.url().replace(/\/assets\/background\.js$/, '/popup.html'));
+ await expect(sender.locator('#capture-mode')).toHaveText('内容受限');
+ await expect(sender.locator('#capture-context')).toHaveAttribute('data-kind','content-restricted');
+ await expect(sender.locator('#status')).toContainText('受限预览');
+ await sender.screenshot({path:'/tmp/edgeever-p2-substack-restricted-popup.png'});
+ expect((await save(currentPlatform.url)).ok).toBe(false);
+ expect((await (await request.get("/api/v1/memos?limit=100")).json()).memos.map((memo:any)=>memo.id)).toEqual(beforePaywall);
expect(sourceRequests.some((url) => /\.(mp3|m4a|mp4)(\?|$)/.test(url))).toBe(false);
} finally {
const cleanup = async (operation: () => Promise<unknown>) => {