Commit 5e3329e
committed
fix(wrappers): guard against undefined Browser.cookies in getChatGptAccessToken
In some browser contexts (e.g. Safari, or environments where the cookies
permission is unavailable), Browser.cookies can be undefined, causing:
"can't access property 'getAll', a.cookies is undefined"
chatgpt-web.mjs already uses this guard pattern. Apply the same
defensive check before calling Browser.cookies.getAll in
getChatGptAccessToken, allowing the session endpoint to be reached
without cookies when the API is unavailable.
Fixes #912
Co-Authored-By: Octopus <liyuan851277048@icloud.com>1 parent c236a4b commit 5e3329e
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
0 commit comments