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>
9 lines
No EOL
142 B
JSON
9 lines
No EOL
142 B
JSON
{
|
|
"0.1.0": "0.15.0",
|
|
"0.1.1": "1.8.10",
|
|
"0.1.2": "1.8.10",
|
|
"0.2.0": "1.8.10",
|
|
"0.2.1": "1.8.10",
|
|
"0.3.0": "1.8.10",
|
|
"0.3.1": "1.8.10"
|
|
} |