extension icon indicating copy to clipboard operation
extension copied to clipboard

Support Safari14

Open athei opened this issue 4 years ago • 9 comments

The upcoming Safari14 will support web extensions. It may be worthwhile to look into whether we can support this browser with the current code. Safari14 will not support all API available in Firefox and Chrome in its first release. So some modification might be necessary. Safari web extensions need to be packaged as an app but there is a conversion tool for existing projects in the Xcode12 beta that just creates a bare minimum wrapper app that can be used to distribute the extension through the app store (the only way to distribute web extensions AFAIK).

athei avatar Jun 26 '20 07:06 athei

image

I got this to work using the built in web extension converter in macOS 11, Safari 14 and the Xcode 12 toolkit. After yarn installing and building you can run

xcrun safari-web-extension-converter .

in the build directory. The only api not supported by safari is background.persistence == true. Would be cool to have this officially supported as I use Safari most of the time.

carumusan avatar Jul 30 '20 16:07 carumusan

Really cool. Also on Mac, so I will definitely tale a look at some point - feel free to contribute additional/fixes to support this in the meantime, I always love contributions. (Especially if you are actually using it...)

jacogr avatar Jul 30 '20 18:07 jacogr

The only api not supported by safari is background.persistence == true. Would be cool to have this officially supported as I use Safari most of the time.

I wonder, why does the extension use persistence at the first place?

remon-nashid avatar Sep 15 '20 23:09 remon-nashid

I wonder, why does the extension use persistence at the first place?

The background script in the extension is constantly listening to messages coming from a Dapps (signing and others...).

Tbaut avatar Oct 09 '20 16:10 Tbaut

I am not well-versed (not all all to be honest) in extension development but the documentation reads as if persistent is not required for that.

The registration of listeners is persistent even without persistent. When such a message from a Dapp arrives the background script would be loaded and unloaded when the processing is finished.

athei avatar Oct 11 '20 11:10 athei

With significant overhead, yes. So there are very valid reasons why this extension (like other well known extensions in other blockchains) use persistence.

However since there is manifest 3 on the horizon and this approach is deprecated, it is due for removal, please see https://github.com/polkadot-js/extension/issues/310, as logged

jacogr avatar Oct 11 '20 11:10 jacogr

Thanks for the explanation. It certainly feels sluggish on Safari (clicking the toolbar icon).

athei avatar Oct 12 '20 07:10 athei

Any progress on this?

Really looking forward to this.

AurevoirXavier avatar Nov 16 '21 11:11 AurevoirXavier

image

I got this to work using the built in web extension converter in macOS 11, Safari 14 and the Xcode 12 toolkit. After yarn installing and building you can run

xcrun safari-web-extension-converter .

in the build directory. The only api not supported by safari is background.persistence == true. Would be cool to have this officially supported as I use Safari most of the time.

By ITP policy, the indexedDB and localStorage will be cleared every 7days. Even with ITP disabled, the data will be deleted after each Safari upgrade. Screenshot 2024-02-18 at 09 42 24

david9991 avatar Feb 18 '24 01:02 david9991