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

Explanation of the state of uBlock Origin (and other blockers) for Safari #158

Open ghost opened 5 years ago

ghost commented 5 years ago

Very quick tl;dr: uBO will no longer work with Safari, use Firefox or a new "content blocker" app (see below for good replacements).

In the past few months, and especially in the past week, there have been a lot of posts and comments questioning the status of uBlock Origin for Safari. This should answer all questions on the status of uBO for safari.

uBlock Origin was ported for Safari in 2016, and was updated regulary (mostly changes from the main project) until 2018 when development completley stopped. Since then Apple has begun phasing out Safari extensions as extensions, and has instead been implenting a new extensions framework which is extremley limited in adblocking functions, only allowing "content blockers", which are just links bundled as an app which Safari enforces. From Safari 12 / macOS Mojave, old legacy Safari extensions were still allowed, but came with warnings saying that they will slow down your browsing (they infact won't, or at least not noticably). Safari also recently shut their Extension Gallery, instead redirecting it to the mac app store. Though it is still curently possible to install uBlock Origin by downloading the extension from Github (edit: must follow these instructions, it will not be starting from Safari 13 / macOS Catalina, when the legacy entension API will be fully deprecated.

It will not possible for uBlock Origin to work with the upcoming Safari 13 / macOS Catalina release If you are a current user of uBlock Origin for Safari here are the options to continue blocking ads:

  1. For the moment continue to use Safari 12 with uBlockOrigin. Anybody with uBO currently installed, it won't be removed until you update to Safari 13. If you don't have uBO installed, and wish to install on a pre-Catalina version of Safari, Download the latest (and final) release here and follow these instructions to install it. Unfortunately it's a bit complicated. This will stop working with macOS Catalina (coming "this fall"). Update: It appears that it is not possible to install uBO permanently, it will always uninstall on a restart of Safari. If you have it, it should stay.
  2. Switch to a different browser. If you choose this, I strongly recomend Firefox. Chrome will itself be ending support for uBlockOrigin soon. If battery life is an issue for you get Firefox Beta, Nightly or Developer which has massive battery life improvements to bring it on par with Safari / Chrome being tested (note: somewhat unstable). This will come to the stable version, hopefully in time for uBO-Safari's eol.
  3. Get a content blocker. Not nearly as powerful as uBO, but the best option if you want to stay with Safari. Do not get the app called "uBlock", this is unassociated with uBlockOrigin (read about the split here), and is simply a content blocker with a big negative feature of having acceptable ads built in (which is AdBlockPlus's pay-to-play ad and tracker unblocking program). It shares no code with uBO and has no advantages over any other content blocking app. Here are some recomendations of content blockers:

Top picks

Other Good Options

Do Not Reccomend

Update: Here is a statement from gorhill (uBO developer) on the state of Safari

Edit: a lot people are asking about uBlock Origin not working in the future on Chrome. If you'd like more information on this, here is an article from ghacks from january, and a statement from gorhill, developer of uBlock.**

There has been discussion of this on Reddit Github and Hacker News.

translit commented 4 years ago

ability to hide unwanted annoyances on specific web pages as desired

Yes, this is key.

gorhill commented 4 years ago

they lack the ability to manually select and block annoying screen elements on the fly

Solutions like NextDNS are also not able to filter network requests through URL pattern-based matching. Large swathes of EasyList and other such lists are URL pattern-based filters. What I explained here also applies to DNS-based blocking.

jorge-d commented 4 years ago

I'm not denying all those point, which are completely valid. I'm just saying that for a completely simple remove-ads scenario this is probably the easiest solution, the killer point for me being that those same filters can be applied to mobile trafic.

DumbGameMaker commented 4 years ago

I am going to LOVE MacOS Big Sur since it means either uBO will work again or I can, with a little tweaking, install the FireFox version of uBO on Safari

DumbGameMaker commented 4 years ago

Oh wait...

So.. is ubo coming to new safari and big sur? I dont really understand all this technical speak

No. https://www.reddit.com/r/uBlockOrigin/comments/hdz0bo/will_ublock_origin_back_to_macos_big_sur/fvoc7wk/ Use uBo in firefox or chrome, or use adguard in safari.

safari extension preferences say - permission to read sensitive information including passwords and logins. Do they store these information?

alvarnell commented 4 years ago

All blocking extensions must have permission to read everything on a web page, which may include sensitive information, in order to do it's job. There is no reason for it to retain or do anything else with that data in order to perform it's blocking functions, but one would have to perform a detailed analysis of it's storage and off-platform communications in order to answer your question. I would also encourage you to review it's Privacy Policy for a detailed explanation of what it collects and what it does with same. Then you have to make up your mind on whether you believe what it says and if it's worth any risk you perceive.

Sent from my iPad

-Al-

On Sep 4, 2020, at 17:33, DumbGameMaker notifications@github.com wrote:

safari extension preferences say - permission to read sensitive information including passwords and logins. Do they store these information?

cristian-rivera commented 4 years ago

According to https://arstechnica.com/gadgets/2020/11/macos-11-0-big-sur-the-ars-technica-review/7/:

Safari 14 gives extension developers a lifeline by allowing them to use the WebExtensions API that allows Chrome and Firefox extensions (and Edge, and Opera, and most browsers based on Google’s or Mozilla’s codebases) to use most of the same code. Using Xcode, you can make Safari Web Extensions by importing your existing Chrome or Firefox extension using a command-line tool provided by Apple.

If true, hoping this will finally bring uBlock back to Safari 🙏🏼

gwarser commented 4 years ago

@cristian-rivera

webRequest

BlockingResponse not supported.

Blocking requests not supported.

https://developer.apple.com/documentation/safariservices/safari_web_extensions/assessing_your_safari_web_extension_s_browser_compatibility

And also watch this: https://www.youtube.com/watch?v=_dduavvDj6s

glmanhtu commented 4 years ago

@el1t is there any chance to bring back this extension ???

alvarnell commented 4 years ago

@el1t has not posted here since May of 2017.

possiblerobot commented 4 years ago

I want to second the rec for NextDNS. It's fantastic. I use it in combination with a Safari extension called Wipr, which is a clean, no-frills ad and tracker blocker based on Easylist. It has no options and you can't subscribe to arbitrary lists. Even though it has no options, it seems to cover my pattern-based filter needs. I stopped using AdGuard because it's so heavy and sometimes hits the CPU enough to ramp the fans up. That's too much for a blocker. NextDNS catches anything Wipr misses, which is very little. Plus, NextDNS filters stuff outside of Safari, catching random trackers that are built into apps, etc.

Also, here's a pro-tip I just discovered for using NextDNS on MacOS Big Sur: use the NextDNS Apple config file generator. It uses the new native encrypted DNS support and plays nice with my VPN.

https://apple.nextdns.io/

possiblerobot commented 4 years ago

Just to be clear, if an efficient, full-featured blocker like uBlock existed for Safari, I'd use it. I just got tired of having an Electron behemoth hogging resources in the background ::looks at AdGuard::. Right now, Wipr is using 20mb RAM total, and it's been running for a couple days.

@freediverx and @translit are right. We need pattern-based blocking inside webpages in addition to DNS-level blocking. And we need to be able to subscribe to any blocklist we'd like.

superlex commented 4 years ago

@possiblerobot 1) Open AG for Safari 2) Update your filters 3) Close AG for Safari

No app in background needed, no resource used :)

possiblerobot commented 3 years ago

@superlex That's not a bad strategy, for sure. But computers are supposed to take care of boring/annoying background tasks for us. Opening AG once or twice a day to update lists is exactly what we should not have to do. But maybe in a week, that's what I'll be doing too. Haha.

At least Safari 14 took a step in the right direction with standard (mostly) WebExtensions. I still have hope.

superlex commented 3 years ago

@possiblerobot Yep, you're right.. We need a simple script in order to update automatically filters.

dwiehoff commented 3 years ago

Switch to a different browser.

From what I can tell, only Safari supports using AirPlay with embedded videos. Is there a way to stream videos via AirPlay within Chrome or Firefox?

muHashh commented 3 years ago

So what's the recommended one for M1 macs?

elesto commented 3 years ago

Honestly I gave up trying to mess with safari and I switched to firefox and ubo. Been happy ever since.

cristian-rivera commented 3 years ago

Honestly I gave up trying to mess with safari and I switched to firefox and ubo. Been happy ever since.

Agreed, the ability to customize, low resource usage and overall security/privacy settings made Firefox a no-brainer for me.

praveenperera commented 3 years ago

Honestly I gave up trying to mess with safari and I switched to firefox and ubo. Been happy ever since.

Agreed, the ability to customize, low resource usage and overall security/privacy settings made Firefox a no-brainer for me.

Unfortunately Safari is still king when it comes to battery usage

fdenzer commented 3 years ago

If

then I do lose more battery, than by using FF+μBO.

BOTKooper commented 3 years ago

If

  • the websites don't work (Safari is the new IE9 to web devs like myself: hard to test against and so much of niche, that a "install a different, mainstream browser" nag screen is getting my preferred solution. But of course, some users don't even know what a browser is and on mobile devices you can not change away from Apples Rendering Engine.)
  • and/or I am forced to watch ads,

then I do lose more battery, than by using FF+μBO.

Well, it works just fine, and if you wanna show "install a different browser" to 50% mobile internet, god bless you do not. Rendering is actually a point, sure. Yeah, it's strange sometimes, but what else we could get from so closed (from communication point) company. Nothing restricts you from committing to webkit though.

For me the only features missing there is multi-profile like in Chrome for differing personal and work accounts and support for ordinary extensions like uBlock, but for that I have Chrome installed.

vprelovac commented 3 years ago

Just as a heads up, Orion (macOS browser, WebKit fork) has native support for uBlock Origin and many other web extensions. We are currently in private beta and accepting new testers.

vassudanagunta commented 3 years ago

@vprelovac

Just as a heads up, Orion (macOS browser, WebKit fork) has native support for uBlock Origin and many other web extensions. We are currently in private beta and accepting new testers.

I put it on HN for you: https://news.ycombinator.com/item?id=26631598

strafe commented 3 years ago

@vprelovac will you be accepting some applications soonish?

vprelovac commented 3 years ago

Current waitlist time for Orion is about 2-3 weeks.

ujeshkrishnan commented 3 years ago

The Safari support for WebExtensions was released in 2021 and is available from Safari 14 (shipped with macOS Big Sur). WebExtensions for Safari are published in the App Store. See documentation here.

Any hope for uBlock back in Safari?

gwarser commented 3 years ago

@ujeshkrishnan https://www.reddit.com/r/uBlockOrigin/comments/nura67/ubo_on_ios_soon/

chinmaythosar commented 3 years ago

Curious if on macOS NetworkExtensions can be used to make a DoT / DoH app (I made one for iOS a while back) which then has lists from ublock (or rather any list) that is added to blacklist for the app such that any DNS request is then blocked. With M1 Macs I feel that searching through anything around 50,000 blacklists won't be much of a problem. Not sure if this approach was discussed anywhere else.

Note : In case anyone is wondering using System DNS in Network Extensions for macOS 11 and iOS 14 will override any DNS from apps. This is because apps can decide to use their own encrypted DNS in iOS 14 / macOS 11 in which case your local DNS blockers will not work.

dronezzzko commented 3 years ago

@chinmaythosar there're two options (both worked for me):

ink-splatters commented 3 years ago

AdGuard is SLOOOOOOOOW. Horrible piece of software. Typical of garbage created with Electron.

well, I don't agree it's garbage, it's pretty decent in terms of it does the thing well, but it's painfully slow. And Electron is garbage, of course

vassudanagunta commented 3 years ago

Has anyone tried using alternative open source router firmware, such as Tomato and its forks such as FreshTomato, that supports blocking at the router?

From what I can tell, this is achieved via a router-based DNS that "blocks all ads and trash websites via the DNS cache poisoning method". I don't know if other open source router firmware offers other methods.

For Tomato and its forks:

In addition, FreshTomato has a built-in ad blocker that I guess is easier to manage than custom scripts:

FreshTomato's ad blocker works through DNS cache poisoning. It downloads lists of URLs/domains to block. It then replaces whatever dnsmasq resolves as the advertiser's correct IP address with an address of 0.0.0.0.

FreshTomato's built-in ad blocker is separate from the ad blocking scripts seen on the Web pasted into FreshTomato's custom script window

strafe commented 2 years ago

Has anyone tried using alternative open source router firmware, such as Tomato and its forks such as FreshTomato, that supports blocking at the router?

Yes with OpenWRT. It's not as convenient as blocking at the browser though as exceptions take longer to input and can't be temporarily added with a single click. Best for devices that don't support system-wide blocking, e.g. iOS.

Chasapple4 commented 2 years ago

Would the Chromium MV3 style work with the new Safari extension model?

emikaadeo-git commented 2 years ago

Is there are some plans to make a port of new experimental uBOLite MV3 API-based content blocker to Safari? Safari have support for MV3 extensions since version 15.4 https://webkit.org/blog/12445/new-webkit-features-in-safari-15-4/#safari-web-extensions EDIT: Looks like currently it's not possible: https://github.com/uBlockOrigin/uBOL-issues/issues/52

vprelovac commented 2 years ago

Just a heads up that full (or nearly full) uBO experience is possible in a WebKit-based browser. Orion browser, a WebKit-based Mac browser (still in beta) supports Chrome/Firefox extensions natively.

https://browser.kagi.com

ankitsharma07 commented 2 years ago

I have been using Orion and it's been great so far.

sdykae commented 1 year ago

My god orion did it 😫

NewteqDeveloper commented 1 year ago

The biggest problem with what everyone has mentioned with using FireFox or a different browser that supports uBlock Origin is that on iOS and iPadOS; those browsers don't support extensions that are available for those browsers, because Apple has forced them to wrap their browser in webkit so that it is basically a skinned version of Safari.

The OP's message suggestions is the best that I've found. For the past 2 years, I've been looking for a way to get rid of all the tracking and ads and such on my iPhone but I've not had any success; until now - when I found this post that detailed everything.

I decided to bite the bullet at take the subscription to AdGuard (bought the lifetime license). Because of what the OP mentioned about AdGuard using the same syntax as uBlock Origin, all I had to do was migrate my filters into my AdGuard on my phone and now everything is working as it should; balance has been restored 😁

From all the reading that I've done the past week, AdGuard is my number 1 recommendation, but all the suggestions that the OP mentioned in the original message are good choices too 😊

F1248 commented 1 year ago

permission to read sensitive information including passwords and logins. Do they store these information?

Only locally and only what is necessary for its use.

Has anyone ever verified this in the source code? This app could intercept ALL passwords, bank details, etc., as well as scan the entire browsing history. I know that the permission to read web content is necessary to block certain items. But why does it also need to have access to the history? I would be very grateful if a professional could check this independently!

alvarnell commented 1 year ago

@F1248 Your comment appears to be way off-topic for this very old issue which has largely been abandoned by anybody that matters.

The quotes you used are not even found in this discussion, so you might have better luck getting help with your request if you started a new Issue.

daslicht commented 1 year ago

any news on this?

alvarnell commented 1 year ago

There has been no real news on this topic since the developer's original posting over four years ago, so I don't anticipate there will ever be.

daslicht commented 1 year ago

There has been no real news on this topic since the developer's original posting over four years ago, so I don't anticipate there will ever be.

thats sad, I really like safari, but without proper adblockewr it is kind of mehhh

marlonjames71 commented 7 months ago

2024 and I'm wondering why uBlock O can't be ported to Safari still. Didn't Apple make improvements in this area?

sdykae commented 7 months ago

Plugin extension api is not fully supported in Safari, UBlock O uses this api for its core functionality, It can't be ported cuz that

2024 and I'm wondering why uBlock O can't be ported to Safari still. Didn't Apple make improvements in this area?

daslicht commented 7 months ago

Plugin extension api is not fully supported in Safari, UBlock O uses this api for its core functionality, It can't be ported cuz that

2024 and I'm wondering why uBlock O can't be ported to Safari still. Didn't Apple make improvements in this area?

How does Adguard manage it to make it work ?

vprelovac commented 7 months ago

Adguard uses content blocking functionality in WebKit which is less powerful than native requests-based web extension APIs used by uBO.

If you want to see full uBO functionality in a WebKit browser, Orion browser has implemented web extensions API on top of WebKit and natively supports Chrome and Firefox extensions. This support is still in beta but most popular extensions work (including uBO). Disclaimer: I am one of the devs of Orion.

daslicht commented 7 months ago

Adguard uses content blocking functionality in WebKit which is less powerful than native requests-based web extension APIs used by uBO.

If you want to see full uBO functionality in a WebKit browser, Orion browser has implemented web extensions API on top of WebKit and natively supports Chrome and Firefox extensions. This support is still in beta but most popular extensions work (including uBO). Disclaimer: I am one of the devs of Orion.

I dont care which engine :) I just want to use privacy gateway of safari and its convenient macos integration. Or does Orion can be used with apples privacy gateway?

[EDIT] I juist installed orion and a excited, it just looks like Safari anbd even support touch id etc, keep testing

daslicht commented 7 months ago

Orion.

does Orion iOS also support extensions now in EU?