-
Notifications
You must be signed in to change notification settings - Fork 22
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
feature: maybe it's time to rethink the possibility of porting to Safari #52
Comments
Hi, |
I don't have MacOS, this would have to be undertaken by a another volunteer developer. Anyways, the implementation of declarativeNetRequest API on Safari is missing key capabilities for the current state of uBOL, it does not support conditions such as Additionally, the Safari |
@gorhill |
Just noticed that Apple added support for
I think this feature is available in Safari 16 but Apple haven't updated their documentation. |
Safari 16.4 is out of beta now, not sure how close this gets us. |
I’ve posted on Mastodon to Jen and Jon from the WebKit team, let’s see if they’re considering the missing capabilities mentioned by Raymond https://mastodontech.de/@dminca/110135906549832299 |
Any updates for Safari 17 (macOS Sonoma)? |
Transferring the issue to uBO Lite issues repo because if ever there is a port to Safari, that will be MV3 uBO Lite, not uBO, which requires MV2. |
Are there currently any other barriers to entry for restarting development of the Safari Extension for uBOL? Perhaps there is an opportunity to engage the broader community to alleviate some of those impediments (if there are any) |
Maybe the only barrier is someone willing to fork and develop it for Safari? |
Converting the firefox variant with the safari-web-extension-converter seems to work somehow out of the box on macOS Sonoma. |
@hadig I'm also willing to work on porting UBO Lite with whatever code you have. Since UBO is such a highly used extension I'm sure there are others (even if few) that may be willing to work on porting it (UBO Lite) to Safari. |
Made a PR: #71 |
I know uBlock team is famous for not taking donations (for all the right reasons I might add) but just wanted to say if another interested developer would like to develop but has monetary hurdles myself and a LOT of other Safari users would be happy to contribute. |
Is there any update on this issue/suggestion? |
@Webtapper There's no update that I know of. A PR was made and rejected because Safari's implementation of DNR (declarativeNetRequest) lacks some specific features that uBO-Lite on Chrome/(Firefox?) requires to function properly. There was no minimal viable product in the PR. I'd be more than happy to develop a port, without donations, but I need to check how much support for DNR the Safari team has added. The WebKit devs have moved the project to GitHub, and they're willing to engage with the developer community. I'm sure I/someone else can look at Safari's documentation for DNR and see what is missing/implemented for an MVP for Safari to come to fruition. In the PR I mentioned above, @gorhill stated that specific APIs weren't supported by Safari's DNR implementation, and an investigation was/is needed to figure out which APIs are and are not supported. Like I said above, I'd be more than happy to port uBO-Lite to safari, I just haven't had the time. The requirement for a Safari extension to also be published on the app store and fulfilling the requirements for that ($100 for a dev license) is also one thing that may put a strain on a port. Hopefully this answered your question! |
Just FYI that any volunteers who want to take a look can check the table comparison of Safari's MV3 ability here: https://github.com/uBlockOrigin/uBOL-home/wiki/Availability-of-MV3-APIs-used-by-uBOL I think it's better to PR and complete the table with clear sources first to have a better picture of Safari's compatibility with uBOL. |
For/to all those concerned, I'll be starting work on a port here, and then eventually pushing upstream. |
so update: it will need work to get it to work on safari. i have the extension running, but its very buggy and actually breaks safari haha. it doesn't support "storage" or "type" keys in the manifest, which may prevent a mvp until apple adds those keys. |
There is a
For Edge, it's a patched version of Chromium Once you have a proper Safari-compliant |
Thanks @arjpar. I do not have the knowledge to help with any technical challenges here - but if we are at the stage of needing to raise $100 for the developer license I’d love to contribute as well. I’ll follow it here and appreciate your updates so far!! |
For those wondering, I'll be posting updates here |
Due to the issues explained here which explains the problems I've run into, a port of uBlock Origin Lite to Safari is currently not possible. It is, however, possible to make an excellent free & open source wide spectrum (ad blocker) content blocker for Safari using the relevant Safari-specific APIs and technologies for content blocking. But that is beyond the scope of my port, and it would not be a port of uBlock Origin Lite, it would be either a fork or a new project altogether. I don't have the time, effort, or knowledge of Apple ecosystem development to create such an extension. I welcome anyone who has those things to consider creating it if they want to. For the aforementioned reasons my Safari port of uBlock Origin Lite will cease development. (All the work I've been doing so far was locally) I doubt Apple will release the needed MV3 DNR APIs soon given that they have their own Safari specific ways of doing things. If they do eventually release those APIs and don't neuter them, I probably won't be working on a port, due to the previous reasons of not creating a new Safari ad block project - time, effort, and knowledge. |
Fair enough. You are correct in that Safari has its own APIs which serve similar purposes (and in some ways, I would argue have benefits over DNR APIs, but at the expense of cross-compatibility), so a Safari port would likely be its own thing at this point, which hybridizes compatible uBlock methods with Safari specific Content Blocking methods. Likewise, whilst App Store distribution isn't necessary, the extension being unsigned or otherwise signed by an unrecognized signing authority would make distribution more cumbersome. Thank you for at least trying and/or looking into it. As a Safari user looking to move away from AdGuard, the attempt was appreciated. |
does Safari 18 in the new macOS Sequoia have any effect on the this issue? |
@fanckush I don't believe so. I looked at WebKit's changes for WWDC, and it didn't mention any major changes to content blocking. I only browsed their blog page though, and didn't see the specific videos on it, so maybe there are changes. With that said, I have thought about learning about Apple ecosystem app development and creating a free open-source ad blocker for Safari as an extension. It's just a thought. If there's sufficient user desire for one, I'd really start to consider creating one. Currently there's Wipr (paid), and AdGuard (but different apps for macOS (free) and iOS (paid version for all the goodies)). Given that all the ad blocking solutions for Safari out there don't fit my desires entirely, I might actually start creating one out of interest - but it wouldn't be a port of uBO Lite, since that's not possible. |
@arjpar Yes please 🙏🏻 other options are available as you mentioned above but uBlock is best in class. ublock origin is the only reason many people use other browsers. Please create one for safari. |
btw, if you like Safari but can't use it because UBO isn't available, you can give Orion a try
it's still in beta I think, so it can be a bit buggy here and there |
@arjpar I really would love to have a Safari Extension! |
@Handwork5615 @JulianKahnert To all those concerned: I've started work on the extension. I'm still learning Swift though. I'll be writing up a design document to detail the architecture soon, it will be in Markdown format in the project's repository. Speaking of a repository, would you all like the project to be in a GitHub organization instead of my main profile? I would like it to be a joint effort, and build a community of collaborators. This means that if I eventually move on to something else, the project will still be sustained. |
@arjpar What about a project in the uBlockOrigin org? If you have a PR and want a Code Review, just let me know 😊 |
@JulianKahnert Like I said before, this project wouldn't be a port of uBlock Origin, because it doesn't share the same codebase as uBlock Origin. I would want to make it as close as uBlock Origin as I can, if I can. Also @fanckush I'm a Orion Contributor, and have access to private Orion RC builds. uBlock Origin doesn't apply cosmetic filtering on Orion until you manually reload the page. The Orion dev team is working on fixing smaller issues rather than bigs ones to improve the stability of the product. Eventually, it will work. As I mentioned above (if I did), I think it might be possible to make an ad blocker for Safari that's even more powerful than uBlock Origin Lite, using the relevant Safari-unique APIs. I'll have to see if I can make it work. |
Please read this, posted 17 hours ago on reddit by someone, just look at the upvote of uBlock origin comment. You'll get lot of support from community for sure. https://www.reddit.com/r/mac/s/hCxASUFhpN |
@Handwork5615 I read it, and I'm happy many people would support the project. I was thinking about writing my own Network Filtering Engine, thats on par or even better than uBlock Origin's, but I'm not sure if it would be allowed by Apple's App Store policies or if the APIs allow it (I don't believe so). Regardless I want to try to support the following:
It will also be written entirely in Swift, SwiftUI, be a Catalyst & Universal App. Since it will use the latest technologies provided, it will only be available on recent versions of iOS, iPadOS, macOS & visionOS. These are just my aspirational goals. I think the Apple Documentation page for Content Blocking might be out of date, or maybe I'm just not looking in the right place. Again, these are just my idealistic/aspirational goals, I need to do further investigating to see if its feasible. I'm also still learning Swift, SwiftUI, & Apple Development, but I want to implement features in the most optimal way possible. |
I am very, very sorry to be the party pooper but it may be time to move this discussion elsewhere, please. I for one am satisfied with wipr and only interested in ublock. |
@dminca @gorhill This issue should be closed, since it's not possible to port uBlock Origin Lite to Safari currently. I have created an organization & repository to try to "re-create" uBlock Origin as much as we can in Safari using the Safari-relevant APIs. Further discussion can take place there. I'm currently in the design phase of the app, rather than just moving fast & breaking things. |
fair enough. Appreciate te effort of trying to integrate it. Unfortunately the Safari team from Apple was not so communicative 😔 |
Just asking if it's possible to make this wonderful extension available for Safari now, given the following article published by Apple Developers in regards to converting web extensions for Safari
https://developer.apple.com/news/?id=qiz0arxc
Prerequisites
Description
[Description of the bug or feature]
A specific URL where the issue occurs
[A specific URL is MANDATORY for issue happening on a web page, even if it happens "everywhere"]
Steps to Reproduce
Expected behavior:
[What you expected to happen]
Actual behavior:
[What actually happened]
Your environment
The text was updated successfully, but these errors were encountered: