el1t / uBlock-Safari

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

Totally disabled on Safari Technology Preview 80 #151

Closed brunnopleffken closed 2 months ago

brunnopleffken commented 5 years ago

Describe the issue

uBlock Origin for Safari is totally disabled on Safari Technology Preview 80 released today, April 17th. So, this extension will be useless on the next release of macOS/Safari unless it's republished according to their new rules. As seen in their changelog:

Legacy Safari Extensions (.safariextz files) are no longer supported. Safari App Extensions and Content Blockers, which can take advantage of powerful native APIs and frameworks as well as web technologies, can be distributed with apps in the App Store or from developers’ websites. You can learn more at developer.apple.com/safari/extensions/.

michael-yx-wu commented 5 years ago

Does anyone know of existing alternatives?

mustii82 commented 5 years ago

@michael-yx-wu AdGuard is the best i tried yet

brunnopleffken commented 5 years ago

@michael-yx-wu @mustii82 Issue #145 is about discussing new alternatives to uBlock Origin on Safari. By the way, I tried AdGuard, it has good filters and the websites looks the same as uBO, but I felt it a little heavier and memory consumer than uBlock.

buckzilla commented 5 years ago

What about 1Blocker X?? I love it on the iphone, noticed they have a paid extension for Safari. I did purchase it for my iPhone. .


From: Brunno Pleffken notifications@github.com Sent: Friday, April 26, 2019 3:58:29 PM To: el1t/uBlock-Safari Cc: Subscribed Subject: Re: [el1t/uBlock-Safari] Totally disabled on Safari Technology Preview 80 (#151)

@michael-yx-wuhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmichael-yx-wu&data=02%7C01%7C%7C07f813e2a81d4e02ed1408d6ca92514b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636919127103114757&sdata=Zx4eFf2ly1wR5y%2B3nJYZ%2Flylyp5rZnJEhxL8I4X1BVg%3D&reserved=0 @mustii82https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmustii82&data=02%7C01%7C%7C07f813e2a81d4e02ed1408d6ca92514b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636919127103124762&sdata=1cukeislHE3ALraTTC45scvz8cdelDHUxj6DE%2BuKFRQ%3D&reserved=0 Issue #145https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fel1t%2FuBlock-Safari%2Fissues%2F145&data=02%7C01%7C%7C07f813e2a81d4e02ed1408d6ca92514b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636919127103134767&sdata=8zb9FP3sh%2F2gsXMt4FrELKBve8%2FuA5BU%2FRppIMTJErs%3D&reserved=0 is about discussing new alternatives to uBlock Origin on Safari. By the way, I tried AdGuard, it has good filters and the websites looks the same as uBO, but I felt it a little heavier and memory consumer than uBlock.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fel1t%2FuBlock-Safari%2Fissues%2F151%23issuecomment-487214122&data=02%7C01%7C%7C07f813e2a81d4e02ed1408d6ca92514b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636919127103144778&sdata=Tge5GyBJWFU1%2BuU0Ki9AgSA3%2BItylkniqa4fQo1vqsU%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACSR5ILS4TMLWSW7CS2ZSU3PSN3ILANCNFSM4HGYODQQ&data=02%7C01%7C%7C07f813e2a81d4e02ed1408d6ca92514b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636919127103154790&sdata=v%2B%2ByVCNalkbxhAEGUh0QMmHY34bCq%2Ft2RADI4tw2FWY%3D&reserved=0.

Beribis commented 5 years ago

Isn't it obvious? Just go back to safari and KEEP using uBlock origin, at least until compatibility is returned..

brunnopleffken commented 5 years ago

Isn't it obvious? Just go back to safari and KEEP using uBlock origin, at least until compatibility is returned..

Isn't obvious because by the pace of progress of this repository, compatibility won't return...

Beribis commented 5 years ago

Isn't it obvious? Just go back to safari and KEEP using uBlock origin, at least until compatibility is returned..

Isn't obvious because by the pace of progress of this repository, compatibility won't return...

Yes thanks, I realize this now, AFTER having read all the great contributions here. Will be missed for sure. Is it not worth doing, or is there a reason why *AdGuard can do this and not others?

*Running 100% on Safari TP80 MINUS 50k+ filters, for now

AdGuard-safariTP80
brunnopleffken commented 5 years ago

@Beribis After some research I'm running AdGuard now, it's not as lightweight as uBlock Origin but is the best I found. It's open-source, has embedded EasyList and EasyPrivacy rules (much better than proprietary ones) and accepts custom rules/lists.

WhiteWalkerLivesMatter commented 5 years ago

Not sure why you guys with fancy titles in your profiles are having so many issues...

I'm able to git clone in xcode and convert to .app for Safari 80 with some tweaking.

Basic info here: https://developer.apple.com/documentation/safariservices/safari_app_extensions/converting_a_legacy_safari_extension_to_a_safari_app_extension

Wish I could contribute more, I had limited time on a hackintosh vps and have exams coming up in high school

Hope you folks can figure the rest out

mustii82 commented 5 years ago

@michael-yx-wu @mustii82 Issue #145 is about discussing new alternatives to uBlock Origin on Safari. By the way, I tried AdGuard, it has good filters and the websites looks the same as uBO, but I felt it a little heavier and memory consumer than uBlock.

I think its heavier on using Ressources but the best Alternative yet. It seems that the Browser Extension cant work on its own and needs to work with a native MacOSX App.

Beribis commented 5 years ago

@brunnopleffken Will uBO then migrate to App Store as official extension using the API ("with some tweaks"), as @WhiteWalkerLivesMatter mentions?

InternalLoss commented 5 years ago

I can confirm that on macOS Catalina Developer Beta 1, uBlock Origin is completely removed as it is not using the MAS distribution method.

vmachiel commented 5 years ago

Could I fork it, wrap inside a MAS app and put it up? Will that work?

InternalLoss commented 5 years ago

Potentially wrapping it in a MAS app could fix this.

glouel commented 5 years ago

Potentially wrapping it in a MAS app could fix this.

So I had a quick look, this is a much bigger job than just rewrapping the extension in an app. Basically a lot of the platform code needs to be rewritten in Swift (anything that touches events has to be done Swift side). I may still have a go at it but this might take a while and I'm not sure everything needed is available in the new app extension API, which is quite poorly documented to be honest.

glouel commented 5 years ago

So, I spent some more hours looking at this more thoroughly, the sad news is, my understanding is this cannot be done without limitations so large that it would no longer be uBlock Origin.

There are now two separate types of Extensions for Safari:

If you want to run any sort of code (what uBlock Origin does), you need an App Extension. So that sounds good. But one rule for App Extensions is while they can (now, in Catalina) do some useful things like intercepting bad misdirections on clicks (XSS, popups, fake redirections etc etc), they simply cannot filter individual connections anymore.

The only way to filter connections is to give a list to a Safari Content Blocker, and let it do the filtering itself. Of course, you cannot just send the list in the classic format used by everyone else, you need to format that list in JSON. Again, that's doable.

But there's an undocumented limit of 50000 rules for content blockers (in both iOS and MacOS). Just as a reference, on my french (pretty much default) install on Firefox, I have 167 633 rules active in uBlock Origin.

So at that point, you can workaround this again by (and now this is getting stupid) making multiple content blockers extensions. This is getting non trivial as some rules may impact one another and if you just split a list in 49999 chunks, you'll get side effects.

So to sum up:

At that point, there's not much of uBlock Origin left since you won't be using anything from it (apart from click hijacking on navigation which I think is one if not the only thing that would remain). And you are basically writing a completely new extension that is no longer uBlock (except for its choice of lists) and will miss all of its interesting features.

With all of these limitations, I personally don't see the point of trying to port it to the current APIs as it would no longer be uBlock and you'd just be redoing what AdGuardForSafari is doing. They are currently limited to the 50k rules too but plan to split their lists in non overlapping chunks in their 1.4 version, you can read more about that here, that gives some info on the 50K splitting : https://github.com/AdguardTeam/AdGuardForSafari/issues/93

This is painful, I wouldn't have minded doing the port (despite the absurdly poor documentation) but there won't be much left of uBlock afterwards, to the point that @gorhill would probably (and rightly) be quite unhappy to see the uBlock Origin name used on something so limited.

lenn5 commented 5 years ago

Does anyone know of existing alternatives?

Since installing the Catalina beta I have been using Wipr. It seems to be very lightweight and does a good job so far. Bummer about uBlock Origin though. :(

kusuriurikun commented 5 years ago

So pretty much officially Safari's main purpose in life is going to be that of MSIE back in the Bad Old Days (read: use only for Vendor Specific Stuff and to download a functional, securable browser). Sad to hear that pretty much we are now literally at the point it is easier to port uBlock Origin to Edge than to Safari and Apple is going so hard to the walled-garden that they've effectively made adblockers impossible to successfully implement--funny, I thought Google was going to be the first to go in that direction :/

So now my suggestions to Safari users are going to be a variant of the patient advice I'd give to people using Windows: "Never use the default browser for anything except getting a browser you can secure with an adblocker and for the few vendor-specific things you HAVE to use the default browser for". (And anymore, I have to actually give this less and less for Windows, because their default browser is actually a Chromium fork with...wait for it...a native port of uBlock Origin on its app store.)

And to the macOS users who are going to instantly go "BUT KEYCHAINS" at the concept of switching to Chrome, Firefox, or something Chromium (like Opera) or Firefox (like Waterfox) derived: There are tools here on Github that allow you to export an existing keychain to a format that is completely importable to a modern password management program (like KeepassX or Lastpass) with exactly equivalent functionality (including plugins for both Chrome and Firefox that do things like not only autofilling but autogeneration of passwords, secure cloud-based and local storage of its own keychain file, etc.) and which are actually portable between multiple devices--including non-iOS/non-macOS devices.

Oh no they might not have the "built-in-Cupertino" shiny. The combo will actually work and keep your system functional, though, which is more than I can say for Safari at this point (which is very much becoming a victim of Apple's increasing trend towards returning to the walled-garden fullscale).

And if one prefers shiny to functional security...well, you do you. Just please feel sympathy for the poor guy at the Genius Store who'll eventually have to clean some nasty off or point out the reason your browser is pegging the CPU is because someone's decided to put on a lovely cryptominer script on someone else's website. :/

(And yes, this makes me genuinely Sad. I'm going to miss the days when I could gladly point out that macOS (in its days of MacOS X) was really a very good and open BSD derivative with a very, very pretty suit on ("see, it even comes with Emacs!") Now it seems the suit is more important than the OS kernel wearing it :()

Beribis commented 5 years ago

Two solutions:

  1. Use public-pihole.com [Basically add a DNS server, much faster safari!]
  2. Update to new adguard which has fixed the filter limitations from 50-300k.

Bad news: Safari 13 is out so uBO is officially over 😭 Good news: Safari Technology Preview (release 92) works fantastically on latest Adguard (v1.5.4) 🎉 they are working out a few kinks, but it can and does eventually update and do what it should from day 1

The macOS Catalina future is assured. Safari will NOT be relegated to ie status!

vassudanagunta commented 5 years ago

Please close this issue as it cannot be fixed.

Full explanation at #158, which the author of uBlock Origin Safari just pinned.

Beribis commented 4 years ago

The end.

🏚