4 ms·
Extensions for Safari on iOS and iPadOS have been available since 2021, I’ve been using ad blockers on those systems, but it’s nice the have uBlock now.
by ErneX 1y ago
Extensions for Safari on iOS and iPadOS have been available since 2021, I’ve been using ad blockers on those systems, but it’s nice the have uBlock now.
- lapcat 1y agoThis is a bit misleading. Safari content blockers have been available on iOS since 2015. In 2021, JavaScript-based Safari web extensions were added.
- karel-3d 1y agoTrying to actually write one before, it's incredibly frustrating experience, as you still need to have some weird native glue code in in Swift/Obj-C. And everything is under-documented, as it the true Apple Experience. (I forgot the details. I can find the code on github, maybe.) If you ask yourself why there are so little Safari extensions, this is why. edit: I look at the code now... I needed to wrestle with BOTH cocoapods and npm, at which point I gave up
- darrenf 1y ago[EDIT to clarify: here I’m talking about writing a javascript based extension, not a content blocker] That’s not my experience (in the admittedly only browser extension I’ve ever written). After getting it working to my satisfaction in Chrome and Firefox, I created the Safari macOS/iOS versions by running $ xcrun safari-web-extension-converter --bundle-identifier <bundle ID> . in my repo. Then I opened xcode, configured the signing/capabilities, and built it. IIRC I had to create the directory for the output because xcode didn't do it itself, but once that was done I could install it to both macOS and iOS. Honestly I was surprised it was so little effort. I don’t doubt that an extension with more functionality than mine might require a jumping through a lot more hoops, but it definitely can be easy to successfully target Safari IME.
- karel-3d 1y agoInteresting. Maybe I tried to do something too complex, I don't remember. https://developer.apple.com/documentation/safariservices/creating-a-safari-web-extension https://developer.apple.com/documentation/safariservices/cre... Here they talk about the "container" that needs to be in Swift/Obj-C. I remember I used to have some problems with the "container" application I think the issue starts to be when you want your extension/app to have any kind of settings that is retained? I don't remember, really.
- darrenf 1y agoYeah, I didn’t go the “Creating a Safari web extension” route, rather I went via “Packaging a web extension for Safari”: https://developer.apple.com/documentation/safariservices/packaging-a-web-extension-for-safari https://developer.apple.com/documentation/safariservices/pac... I note that they say the command has changed from the one I used, it’s now: xcrun safari-web-extension-packager My extension has storage/settings, and it works fine. I have edited no Swift code at all.
- ErneX 1y agoEven better, thanks for the correction.