el1t / uBlock-Safari

uBlock Origin - An efficient blocker for Chromium, Firefox, and Safari. Fast and lean.
GNU General Public License v3.0
2.75k stars 97 forks source link

Move to Safari App Extensions model #124

Open rcombs opened 6 years ago

rcombs commented 6 years ago

From the macOS 10.14 release notes:

Safari no longer supports developer-signed .safariextz packaged legacy Safari Extensions. At first launch of Safari on macOS 10.14, if users have any legacy developer-signed extensions installed, they will be notified such extensions are no longer supported. These extensions cannot be reenabled. Safari Extension Gallery extensions remain supported on macOS 10.14; however, this support will be removed in an upcoming macOS release. Developers should move to the Safari App Extensions programming model. (39007695)

µBlock will need to be converted to a Safari App Extension, which is a component provided by a native app, distributed in the App Store. See the migration guide here: https://developer.apple.com/documentation/safariservices/safari_app_extensions/converting_a_safari_extension_to_a_safari_app_extension?language=objc

tracernz commented 6 years ago

Can confirm it definitely doesn't work on Safari 12. 😢

M4nk1n commented 6 years ago

It still works if you install it from Safari Extension Gallery Website https://safari-extensions.apple.com/?q=ublock

From: https://www.reddit.com/r/mac/comments/8omf0u/best_safari_extensions/

georgeperez commented 6 years ago

While I'm glad there's a workaround, that's the broken 1.16.0 version in the Safari Extensions Gallery and the developer hasn't committed since April 23.

If you want to keep using a stable version, you won't be able to.

Forcer78 commented 6 years ago

uBlock Origin can't be rewritten as a Safari App Extension without losing most of its features.

photovirus commented 6 years ago

Yeah, I can confirm uBlock Origin doesn't work on Safari 12. For now, it seems that 1Blocker will be one of alternatives. It is definitely inferior to uBlock Origin but at least its extension works on Safari 12.

rcombs commented 6 years ago

As a temporary stopgap, the current version of the extension should be submitted to the extension gallery; that should keep it stable at least for the next year. Relevant changes between legacy extensions and app extensions include:

There's a lot of compatibility glue to be added here, but I think most functionality should be able to be ported. The biggest challenge is translating rules from the internal format to the Safari JSON format; I'm not sufficiently familiar with the µBlock engine's internals to say how lossy such a conversion might be.

hhwong commented 6 years ago

FYI - Safari Technology Preview 58 for High Sierra also does not work with legacy Safari Extensions.

On Jun 6, 2018, at 2:00 PM, photovirus <notifications@github.com mailto:notifications@github.com> wrote:

Yeah, I can confirm uBlock Origin doesn't work on Safari 12. For now, it seems that 1Blocker will be one of alternatives. It is definitely inferior to uBlock Origin but at least its extension works on Safari 12.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/el1t/uBlock-Safari/issues/124#issuecomment-395212121, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC4hV9w1uz9apF-DOvoeFgHr_BqUTb7ks5t6ELWgaJpZM4UaJmJ.

photovirus commented 6 years ago

FYI - Safari Technology Preview 58 for High Sierra also does not work with legacy Safari Extensions.

Thanks, I use the TP build on High Sierra too. It is v12.0. Don't have Mojave installed as of now.

maciboy commented 6 years ago

bildschirmfoto 2018-06-07 um 11 42 40

Installation using the link provided by @VinkenCheng worked 😏

A-R-M commented 6 years ago

Installation using the link provided by @VinkenCheng worked 😏

Yes, but as Apple said, Apple-signed Safari extensions in the Safari Extension Gallery are deprecated in Mojave. It’s very likely Apple will completely remove support for them as early as the very next version of macOS after Mojave.

The biggest challenge is translating rules from the internal format to the Safari JSON format; I'm not sufficiently familiar with the µBlock engine's internals to say how lossy such a conversion might be.

This was posted by the developer of JS Blocker a while back regarding the Content Blocker API:

Safari has a feature called "Content Blockers" that allows for extremely efficient resource blocking on both the desktop and iOS version of Safari. As much as I'd like to incorporate this into JS Blocker, it is not feasible to do so. Using a content blocker will prevent JS Blocker from showing you exactly what's going on on a website (i.e. you won't see what's allowed or blocked.) It'll also break all of JS Blocker's "other" features, such as showing alerts within the webpage and canvas fingerprinting protection. Besides the loss of features, content blockers are limited to 50,000 rules. While this seems like a high number, it isn't enough for efficient protection and a lot of rules would need to be cut out to even run a content blocker. Until Apple eases the restrictions (or at least raises the number of rules that can be in a content blocker), JS Blocker will not be using this API.

This may or may not be relevant here, as I’m not sure if µBlock Origin will need to use the Content Blocker API in the Safari App Extension rewrite or not.

MysticalOS commented 6 years ago

The 50k limit at least can be resolved with multiple filter lists/splitting, but it is still an annoyance. and certain types of filters and whitelisting still not totally compatible with methodology.

darkmastermindz commented 6 years ago

Can confirm it's currently working in Safari 12 on Mojave 10.14 beta using link provided by @VinkenCheng.

mateuszjablonski commented 6 years ago

@el1t any chances to have this Safari App Extension sorted out soon? In the meantime, could you please update the plugin at Safari Extensions Gallery?

cakespls commented 6 years ago

Safari 12.0 (13606.1.22.1) on macOS 10.13.6 Beta 4 disables it with the following warning: s8ypui.

You can still enable it afterwards, though. I suppose this means that 10.13.6 might block unsigned extensions completely as well.

gordio commented 6 years ago

Is that's can help?

screen shot 2018-08-04 at 23 37 28
MysticalOS commented 6 years ago

That doesn't allow them to be run outside of apple extension gallery regardless. So unless tampermonkey and a few others i rely upon don't get updated, I still avoid safari 12

CraftedFury commented 6 years ago

Safari 12 is out, you can re-enable the extension after its disabled. It still works, just warns that it will slow down safari.

JonasGessner commented 6 years ago

uBlock Origin can't be rewritten as a Safari App Extension without losing most of its features.

I'm curious, what exactly could not work with the content blocking API? I'm not too familiar with the content blocking API but I believe rules are defined statically and cannot be changed dynamically, which would be a limitation for adding custom rules. And another limitation is the 50k rules limit. Anything else?

Forcer78 commented 6 years ago

I'm curious, what exactly could not work with the content blocking API? I'm not too familiar with the content blocking API but I believe rules are defined statically and cannot be changed dynamically, which would be a limitation for adding custom rules. And another limitation is the 50k rules limit. Anything else?

untitled

Red boxes would be heavily broken. Cyan boxes would be static-only and unable to be changed by users, so effectively broken dynamic filters.