mirror of
https://github.com/lossless-group/perplexed-plugin.git
synced 2026-07-22 06:49:50 +00:00
Perplexity's API stopped including Access-Control-Allow-Origin headers
for app://obsidian.md, so Electron's Chromium renderer began blocking
every streaming response body — even on successful 200 OK requests.
Every Perplexity query that used streaming was silently producing nothing.
Both streaming call sites now use https.request from node:https instead
of activeWindow.fetch. Node.js routes through the OS network stack and
has no CORS constraint at all. The resulting IncomingMessage stream is
wrapped in a Web ReadableStream<Uint8Array> and passed to the existing
SSE parsing machinery unchanged — idle-timeout, chunk accumulation,
citations, images, and AbortController signal handling all preserved.
Non-streaming requests (Obsidian's request() function) were never
affected and are untouched.
perplexityService.ts:
- Added import * as https from 'node:https' + import type { IncomingMessage }
- Replaced activeWindow.fetch in queryPerplexity streaming branch with
https.request → IncomingMessage → ReadableStream<Uint8Array> bridge
directoryTemplateService.ts:
- Same imports
- Replaced activeWindow.fetch in streamPerplexityToFile with same bridge
- AbortController.signal threaded into https.request signal option so
ceiling-timer and user-cancel abort behavior is fully preserved
Bumps to 0.3.1 — manifest.json, package.json, versions.json updated.
Files changed:
- src/services/perplexityService.ts
- src/services/directoryTemplateService.ts
- manifest.json
- package.json
- versions.json
- changelog/2026-07-06_01.md
- changelog/releases/0.3.1.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| releases | ||
| 2025-07-19_01.md | ||
| 2026-04-30_01.md | ||
| 2026-05-01_01.md | ||
| 2026-05-02_01.md | ||
| 2026-05-10_01.md | ||
| 2026-05-12_01.md | ||
| 2026-05-19_01.md | ||
| 2026-05-19_02.md | ||
| 2026-05-20_01.md | ||
| 2026-05-26_01.md | ||
| 2026-05-26_02.md | ||
| 2026-05-27_01.md | ||
| 2026-07-06_01.md | ||