alexanderatallah / window.ai

Use your own AI models on the web
https://windowai.io
MIT License
806 stars 70 forks source link

Add Safari support #20

Open alexanderatallah opened 1 year ago

alexanderatallah commented 1 year ago

This will allow iOS users to use window apps!

louisgv commented 1 year ago

This will likely be blocked by either:

https://github.com/PlasmoHQ/plasmo/issues/521

Or Plasmo should just spit out the safari bundle <- I will investigate this.

louisgv commented 1 year ago
Screenshot 2023-04-16 at 7 33 12 PM

Popups and stuffs are good to go on Safari. The BGSW tho has some problems - I suspects some API incompatibility.

louisgv commented 1 year ago

I think it's impossible to debug Safari Service Worker lol - it shows only "Service Worker failed to load"...

louisgv commented 1 year ago

Blocker for older Safari:

scripting registerContentScripts, getRegisteredContentScripts, unregisterContentScripts, updateContentScripts supported in Safari 16.4 or later.

The mainworld script injection requires the above APIs.

https://developer.apple.com/documentation/safariservices/safari_web_extensions/converting_a_web_extension_for_safari

Some other refs:

louisgv commented 1 year ago

It works!

Screenshot 2023-04-16 at 9 19 16 PM

Key requirement is latest MacOS Ventura 13.3.1 (22E261) with Safari 16.4

A patch on Plasmo side is needed to fix up some undefined lookup, will PR in a bit.

alexanderatallah commented 1 year ago

This is awesome 🔥

I'll need to update my system to 16.4 before I can test (we'll want to check mobile Safari support too). But this is going to be even more amazing once people have a nice way of sharing credentials between desktop and mobile, coming soon