Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension for safari #110

Open
Anri-Lombard opened this issue Dec 13, 2022 · 27 comments
Open

Extension for safari #110

Anri-Lombard opened this issue Dec 13, 2022 · 27 comments

Comments

@Anri-Lombard
Copy link

If you could somehow add an extension for safari it would be awesome!

@wong2
Copy link
Owner

wong2 commented Dec 13, 2022

@Anri-Lombard
Copy link
Author

On it ;)

@Anri-Lombard
Copy link
Author

Not sure why, but I don't have permissions to push a branch to this repo ?!

@wong2
Copy link
Owner

wong2 commented Dec 13, 2022

Yes, you need to fork this repo

@Anri-Lombard
Copy link
Author

Just updating my Xcode, then I'll be able to convert the extension fully.

This issue relates to #109 just for reference.

@Anri-Lombard
Copy link
Author

I built the extension and it works, but you need to be on the Apple Developer program to distribute it, which I am not.

Perhaps you can label the issue as "help wanted" or we can close it.

@Anri-Lombard
Copy link
Author

I can push the build if it would help

@wong2
Copy link
Owner

wong2 commented Dec 15, 2022

@Armandotrsg
Copy link

@Anri-Lombard I have tried what the Apple developer's page says about converting the extension to Safari, but I don't seem to make it work for Mac. I keep getting the same error of being unable to load chatGPT once the I make the search. I'm not sure if you changed some configurations inside Xcode. Here's the project created using the command: xcrun safari-web-extension-converter /path/to/extension:
ChatGPT for Google.zip

@canny
Copy link

canny bot commented Dec 22, 2022

This issue has been linked to a Canny post: Support Safari 🎉

@Anri-Lombard
Copy link
Author

@Anri-Lombard I have tried what the Apple developer's page says about converting the extension to Safari, but I don't seem to make it work for Mac. I keep getting the same error of being unable to load chatGPT once the I make the search. I'm not sure if you changed some configurations inside Xcode. Here's the project created using the command: xcrun safari-web-extension-converter /path/to/extension:
ChatGPT for Google.zip

The only difference is that I added the --copy-resources flag, after which it ran smoothly. Although, I can't test it out on my Mac since I'm not part of the developer program.

@Armandotrsg
Copy link

@Anri-Lombard I have tried what the Apple developer's page says about converting the extension to Safari, but I don't seem to make it work for Mac. I keep getting the same error of being unable to load chatGPT once the I make the search. I'm not sure if you changed some configurations inside Xcode. Here's the project created using the command: xcrun safari-web-extension-converter /path/to/extension:
ChatGPT for Google.zip

The only difference is that I added the --copy-resources flag, after which it ran smoothly. Although, I can't test it out on my Mac since I'm not part of the developer program.

I have tried using that and I keep getting the same error, can you provide a .zip file with the Xcode project so I can test it out?

@Anri-Lombard
Copy link
Author

ChatGPT for Google.zip

Sure, @Armandotrsg. Does this work for you?

@Armandotrsg
Copy link

ChatGPT for Google.zip

Sure, @Armandotrsg. Does this work for you?

I get the error when loading into safari that the service_worker script failed to load

@lez-s
Copy link

lez-s commented Dec 28, 2022

ChatGPT for Google.zip
Sure, @Armandotrsg. Does this work for you?

I get the error when loading into safari that the service_worker script failed to load

Same problem here.

@Anri-Lombard
Copy link
Author

Made some real progress on this today.

This is what I did and the results:

  1. I took the zip file I shared earlier and opened it in Xcode. Then I pressed the run button top left.
  2. It ran and gave this output, alongside opening the app on mac:

Screenshot 2022-12-31 at 11 00 28

Screenshot 2022-12-31 at 10 51 55

3. It opened in safari but was grey, so I activated it by going to the "Develop" tab and allowing unsigned extensions, which made it show on Safari:

Screenshot 2022-12-31 at 10 52 53

4. It asked for permission to access the site and I gave it access:

Screenshot 2022-12-31 at 10 56 03

5. The problem is that it does not display anything on the right, in fact, it just removes the information that was previously there and leaving the area blank:

Screenshot 2022-12-31 at 11 04 18

6. I also do not allow toggling of the settings:

Screenshot 2022-12-31 at 10 56 27


Any help with 5 and 6 will make massive progress!

@Anri-Lombard
Copy link
Author

Anri-Lombard commented Dec 31, 2022

You were correct about the script failing, so that might be the major error:

Screenshot 2022-12-31 at 11 07 16


Some additional info is provided by the inspection tools:
Screenshot 2022-12-31 at 11 14 00

@wong2
Copy link
Owner

wong2 commented Jan 1, 2023

I made some progress today. It turns out the zip file #110 (comment) is converted from the source code of this project, which is incorrect, you need to convert from the built files:

  1. npm run build
  2. xcrun safari-web-extension-converter build/chromium

Then I get these files: ChatGPT for Google.zip

Load it in safari as steps described by @Anri-Lombard, there's finally something shown
image
Although it's always this load failed error.

But the options page works normally:
image

@Armandotrsg
Copy link

You were correct about the script failing, so that might be the major error:

Screenshot 2022-12-31 at 11 07 16

Some additional info is provided by the inspection tools: Screenshot 2022-12-31 at 11 14 00

I have been doing the same and I keep getting the same error, I believe it's a problem when communicating to the ChatGPT API, because after quickly reviewing the code in the ./src/content-script/ChatGPTQuery.tsx I can see that the problem should be around these part of the code:
if (error === 'UNAUTHORIZED' || error === 'CLOUDFLARE') { return ( <p className="gpt-inner"> Please login and pass Cloudflare check at{' '} <a href="https://chat.openai.com" target="_blank" rel="noreferrer"> chat.openai.com </a> {isBraveBrowser() && retry > 0 && ( <span> <br /> Still not working? Follow{' '} <a href="https://github.com/wong2/chat-gpt-google-extension#troubleshooting"> Brave Troubleshooting </a> </span> )} </p> ) } if (error) { return ( <p className="gpt-inner"> Failed to load response from ChatGPT: <br /> {error} </p> ) }

The error is neither "UNAUTHORIZED" nor "CLOUDFLARE" apparently

@wong2
Copy link
Owner

wong2 commented Jan 2, 2023

@Armandotrsg Check my comments above.

@lukesmart1
Copy link

I made some progress today. It turns out the zip file #110 (comment) is converted from the source code of this project, which is incorrect, you need to convert from the built files:

  1. npm run build
  2. xcrun safari-web-extension-converter build/chromium

Then I get these files: ChatGPT for Google.zip

Load it in safari as steps described by @Anri-Lombard, there's finally something shown image Although it's always this load failed error.

But the options page works normally: image

I just spent my whole morning attempting to convert this to safari only to discover that the creator is stuck on the same part as me. Is there any updates?

@wong2
Copy link
Owner

wong2 commented Jan 11, 2023

@lukesmart1 Not yet. Unfortunately, Safari support is not my priority now.

@Perifractic
Copy link

+1 for Safari support 🙏

@BladesKnight
Copy link

+1 for Safari support please.

@wong2 wong2 pinned this issue Jan 23, 2023
@josStorer
Copy link
Contributor

@wong2 I created a safari build in my fork, which may help with this issue

I have tested it and it also supports Automated Build, you can check josStorer/chatGPT-search-engine-extension@e9a6812 and josStorer/chatGPT-search-engine-extension@01f8b64

In terms of setting the extension version number, my approach may be a bit hacky and needs some improvement

@wong2
Copy link
Owner

wong2 commented Jan 23, 2023

@josStorer Thanks, but I think the installation of Safari extension is beyond the capability of most users.

@berot3
Copy link

berot3 commented Feb 3, 2023

Just wanted to comment that I am looking for exactly this browser extension but wanted to have this on iPhone. Now afaik the only browser extensions are those for safari.
I think it would be really awesome if you guys could make this possible! 👍🏻
Thanks for you work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants