Conversation
fix: handle XHR responseType='json' when accessing response data
- Introduced initialThinkingModeEnabled prop in ShadowDomPreview component. - Implemented thinking mode state management in Popup component. - Enhanced ShadowDom styles for the thinking panel with a minimalist design. - Added export functionality with ExportButton component for exporting content as PDF, image, or markdown. - Created utility functions for exporting and copying content. - Added tests for provider compatibility and thinking mode options. - Documented the Huntly knowledge base skill for user queries related to saved content.
… and export utilities - Replace webpack build system with rspack (@rspack/cli, @rspack/core ^1.7.8) - Upgrade ai package from ^4.3.16 to ^6.0.127 - Refactor popup.tsx: lazy load AIToolbar/RssSubscription/SaveDetailPanel, extract tab messaging helpers, clean up listeners - Redesign AIToolbar model selector with unified gradient border, CheckRounded icon for selected model - Change ExportButton icon to IosShare, tighten menu item layout - Harden exportUtils: cross-origin canvas safety, media sanitization, font inlining, adaptive scale calculation, taint retry - Remove externalShortcuts/externalModels from background context menu payloads - Add skipLibCheck to tsconfig.json - Add rspack.config.js and exportUtils.test.ts - Update manifests to reference web_clipper_vendor.js instead of vendor.js
🤖 Augment PR SummarySummary: This PR modernizes the browser extension build/tooling and expands AI + export capabilities. Changes:
Technical Notes: Export uses an isolated iframe + 🤖 Was this summary useful? React with 👍 or 👎 |
| <title>${title}</title> | ||
| <style>${styles}</style> | ||
| </head> | ||
| <body>${element.innerHTML}</body> |
There was a problem hiding this comment.
exportAsPdf builds a srcdoc document with ${title} and ${element.innerHTML}; if the captured page content contains markup (especially <script>), it can execute or break the print document under the extension origin. Also, the print document hard-codes lang="zh", which is likely incorrect for non-Chinese content and can affect rendering/accessibility.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| link.click(); | ||
|
|
||
| // Clean up the URL object | ||
| URL.revokeObjectURL(url); |
There was a problem hiding this comment.
exportAsMarkdown revokes the object URL immediately after link.click(), which can intermittently cancel the download in some browsers (unlike exportAsImage, which defers revocation). Consider deferring URL revocation to avoid flaky downloads.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| }; | ||
| } | ||
|
|
||
| const parsed = JSON.parse(data); |
There was a problem hiding this comment.
extractOpenAICompatibleStreamDelta calls JSON.parse(data) without handling parse failures; some OpenAI-compatible providers can emit non-JSON data: payloads (or partial frames), which would crash streaming. Consider guarding the parse and surfacing a controlled error instead of throwing from the stream loop.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
app/extension/src/ai/types.ts
Outdated
| }, | ||
| qwen: { | ||
| type: 'qwen', | ||
| displayName: 'Qwen (通义千问)', |
There was a problem hiding this comment.
The new qwen provider displayName includes Chinese text (Qwen (通义千问)), but this PR also adds an English-only UI text guideline; this string is user-facing in the provider picker/settings. Consider keeping provider display names English-only for consistency with that guideline.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
… URL cleanup in markdown export
Summary
@rspack/cli,@rspack/core ^1.7.8) for faster builds; addedrspack.config.jsand removed webpack dependenciesaipackage from^4.3.16to^6.0.127AIToolbar,RssSubscription, andSaveDetailPanel; extractedgetActiveTab/sendMessageToActiveTab/postMessageToActiveTabhelpers; converted callbacks touseCallback; simplified message listener cleanupPsychologyOutlinedIconwithCheckRoundedIconfor selected model indicator; improved thinking toggle placementFileDownloadIcontoIosShareIcon; reduced menu min-width and tightened item paddingexternalShortcuts/externalModelsfrom context menu payloadsvendor.jstoweb_clipper_vendor.jsskipLibCheck: trueexportUtils.test.ts