Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Totally disabled on Safari Technology Preview 80 #151

Closed
brunnopleffken opened this issue Apr 17, 2019 · 21 comments
Closed

Totally disabled on Safari Technology Preview 80 #151

brunnopleffken opened this issue Apr 17, 2019 · 21 comments

Comments

@brunnopleffken
Copy link

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/.

  • MacOS version: macOS Mojave 10.14.4
  • Safari version: Technology Preview 80
  • uBlock Origin version: Latest
@michael-yx-wu
Copy link

Does anyone know of existing alternatives?

@mustii82
Copy link

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

@brunnopleffken
Copy link
Author

@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
Copy link

buckzilla commented Apr 26, 2019 via email

@Beribis
Copy link

Beribis commented Apr 28, 2019

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

@brunnopleffken
Copy link
Author

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
Copy link

Beribis commented Apr 28, 2019

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
Copy link
Author

@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
Copy link

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
Copy link

mustii82 commented May 1, 2019

@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
Copy link

Beribis commented May 16, 2019

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

@InternalLoss
Copy link

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
Copy link

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

@InternalLoss
Copy link

Potentially wrapping it in a MAS app could fix this.

@glouel
Copy link

glouel commented Jul 15, 2019

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
Copy link

glouel commented Jul 16, 2019

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:

  • Content Blocker : You simply provide a list of rules to be filtered, and Safari will filter those for you
  • App Extension : You can inject Javascript and CSS in every pages (but you need to write all the interactions with Safari in Swift/Obj-C and pass messages from Javascript to Swift and the other way round)

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:

  • the new APIs break the ability to do Advanced Filtering/Dynamic Filtering
  • the new APIs break the ability to do "classic" filtering by uBlock Origin
  • the new Content Blocker API can do the filtering for you but only in chunks of 50000k per extension in a format that you have to convert the list to, and make sure your splitting has no side effect

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 : AdguardTeam/AdGuardForSafari#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
Copy link

lenn5 commented Jul 18, 2019

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
Copy link

kusuriurikun commented Aug 27, 2019

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 auto_generation_ 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
Copy link

Beribis commented Sep 20, 2019

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
Copy link

Please close this issue as it cannot be fixed.

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

@Beribis
Copy link

Beribis commented Jan 9, 2020

The end.

🏚

@brunnopleffken brunnopleffken closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests