uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
945 stars 81 forks source link

Browser Support Request: Safari 14 #1123

Closed docyx closed 4 years ago

docyx commented 4 years ago

(this is not an actual issue, just a request, so I removed the template)

uBlock hasn't worked on Safari for a while now, since Apple used a proprietary extension API which caused a lot of issues. more info.

With the new Safari 14 release, it now supports the WebExtensions API. Since uBlock uses this API, it would be really nice to have uBlock on Safari now that it supports it.

Also time to update https://github.com/gorhill/uBlock/blob/master/platform/safari/README.md#safari-platform as well (:

uBlock-user commented 4 years ago

https://www.reddit.com/r/uBlockOrigin/comments/hdz0bo/will_ublock_origin_back_to_macos_big_sur/fvoc7wk/

olbrew commented 3 years ago

https://www.reddit.com/r/uBlockOrigin/comments/hdz0bo/will_ublock_origin_back_to_macos_big_sur/fvoc7wk/

One year later with newer versions available I checked again but it seems like most of the necessary WebExtensions APIs are still not supported.

Tested with Safari 15, Xcode 13 and uBlock Origin 1.38.0, all newest production versions available at time of writing.

Compatibility check with xcrun safari-web-extension-converter ./uBlock0.chromium/ gives:

Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
    browser_action
    all_frames
    options_ui
    contextMenus
    unlimitedStorage
    storage
    webRequest
    commands
    incognito
    short_name
    default_locale
    tabs
    webNavigation
    <all_urls>
    content_security_policy
    version
    name
    web_accessible_resources
    run_at
    match_about_blank
    js
    webRequestBlocking
    matches
    page
    privacy
    manifest_version
    icons
    description
Warning: Persistent background pages are not supported on iOS and iPadOS. You will need to make changes to support a non-persistent background page.
mimi89999 commented 2 years ago

Hello, I attempted to convert the extension. Most APIs should be supported now. The lack of storage and webRequestBlocking might be annoying, but there are probably some workarounds for this.

mbp-de-michel:uBlock michel$ /Applications/Xcode.app/Contents/Developer/usr/bin/safari-web-extension-converter ./uBlock0.chromium/
Xcode Project Location: /Users/michel/git/uBlock
App Name: uBlock Origin
App Bundle Identifier: com.yourCompany.uBlock-Origin
Platform: All
Language: Swift
Warning: The following keys in your manifest.json are not supported by your current version of Safari. If these are critical to your extension, you should review your code to see if you need to make changes to support Safari:
    storage
    match_about_blank
    webRequestBlocking
    incognito
    privacy
Warning: Persistent background pages are not supported on iOS and iPadOS. You will need to make changes to support a non-persistent background page.
gwarser commented 2 years ago

The lack of ... webRequestBlocking might be annoying

The main feature?

MysticalOS commented 2 years ago

https://browser.kagi.com/faq.html if you really need to use webkit, but with ublock origin. Still kinda beta so not perfect yet but seems like a solid project. I used app a bit and it feels like using safari, but it does lag behind on feature support. I could not get push notification api to work with it yet for example.

Milo123459 commented 2 years ago

Hey! Recently switched to uBlock and must say I really like it. Are there any updates on this issue? Is WebKit/Safari getting more of the APIs needed?

u-RraaLL commented 2 years ago

Hey! Recently switched to uBlock and must say I really like it. Are there any updates on this issue? Is WebKit/Safari getting more of the APIs needed?

https://www.reddit.com/r/uBlockOrigin/comments/sf0rjp/does_anybody_want_to_publish_ublock_origin_on/ https://www.reddit.com/r/uBlockOrigin/comments/re5y0i/safari_preview_adds_new_supported_features_are/

MisutaaAsriel commented 1 year ago

The lack of ... webRequestBlocking might be annoying

The main feature?

Safari supports declarativeNetRequest, which is the modern replacement for webRequestBlocking: https://developer.apple.com/documentation/safariservices/safari_web_extensions/blocking_content_with_your_safari_web_extension

Is there a reason declarativeNetRequest cannot be used?

gwarser commented 1 year ago

@MisutaaAsriel https://github.com/uBlockOrigin/uBOL-home/issues/52