josStorer / chatGPT-search-engine-extension

A browser extension to display ChatGPT response alongside Search Engine results
MIT License
631 stars 76 forks source link

Cannot use in Safari: UNAUTHORIZED #18

Closed billzt closed 1 year ago

billzt commented 1 year ago

It shows:

image

And in the console:

image

I've tried to log in and refresh, but no use

josStorer commented 1 year ago

did you open the highlight link? it works on my mac

image
josStorer commented 1 year ago

the second link https://chat.openai.com/api/auth/session

billzt commented 1 year ago

@josStorer Yes, I opened it. No problems.

Does you browser shows Unrecognized Content-Security-Policy directive 'require-trusted-types-for'. Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. in the console?

josStorer commented 1 year ago

only Unrecognized Content-Security-Policy directive 'require-trusted-types-for', and seems that not related to this extension, even I disable all my extensions, it still displays

billzt commented 1 year ago

@josStorer OK.I edited the title.

However, no matter how many times I opened https://chat.openai.com/api/auth/session, it still shows UNAUTHORIZED

Any method to debug it? e.g. using console window

BTW: chrome works OK. So there is no problem in my network.

josStorer commented 1 year ago

I'm afraid you have to debug by building from the source code. At https://github.com/josStorer/chatGPT-search-engine-extension/blob/main/src/background/index.mjs#L20, you can use console.debug to display your config info, and view it through Safari - Develop - Web Extension Background Pages. At https://github.com/josStorer/chatGPT-search-engine-extension/blob/main/src/content-script/index.jsx#L50, you can check whether the accessToken has been correctly obtained.

josStorer commented 1 year ago

the build steps are: npm install npm run build npm run build:safari

josStorer commented 1 year ago

try this safari.dmg.zip, i added extra debug info

billzt commented 1 year ago

@josStorer Thank you. I have installed it (and disabled all other extensions)

But there is no debug info output.

image image

josStorer commented 1 year ago

check the console window of the background page and https://chat.openai.com/api/auth/session

image image
billzt commented 1 year ago

I understand.

I missed Always Allow on Every Website. I only allowed for google.com

AndrielF commented 1 year ago

I understand.

I missed Always Allow on Every Website. I only allowed for google.com

I did the same haha. Thanks, also allow on chat.openai.com and it worked