fix: ChatGPT fetch interception failure + bump to 2.0.6

ChatGPT (and potentially other AI services) calls fetch() with a
Request object as the first argument: fetch(new Request(url, opts))
instead of fetch(url, opts). The interceptor only handled the second
form, so ChatGPT's conversation requests passed through unmodified.

Fixed by handling both fetch signatures:
- fetch(url, options) — existing path
- fetch(Request) — new: extracts URL, method, headers, reads body
  via request.text() for JSON/text content types

Also handles non-string body types:
- Blob → text via blob.text()
- ArrayBuffer → text via TextDecoder
- URLSearchParams → string via toString()

These cover the various ways modern frameworks call fetch().

https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
Claude
2026-03-27 04:07:11 +00:00
parent 8cff1ae382
commit 02c635c4d7
5 changed files with 52 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "silent-send",
"version": "2.0.5",
"version": "2.0.6",
"private": true,
"license": "BSL-1.1",
"description": "Browser extension that substitutes personal data before sending to AI services",