Free and open source, highly customizable and lightning fast ad blocking extension.
AdGuard.com |
Reddit |
Twitter |
Telegram
Ad blocking extensions for Safari are having hard time since Apple started to force everyone to use the new SDK. AdGuard extension is supposed to bring back the high quality ad blocking back to Safari.
Unlike other major ad blockers, AdGuard provides some extra features you are used to have with the traditional (now deprecated) extensions:
- Managing protection from Safari
- Choose among popular filter subscription
- Custom filters
- Creating your own filtering rules
- Manual blocking tool
- Whitelisting websites
AdGuard for Safari is based on the Safari native content blocking API, which makes it lightning fast, but somewhat limited in capabilities. For instance, Safari limits the number of rules a content blocker can have.
With all above said, there is a solution that is even more effective than AG Safari extension. I mean, of course, AdGuard for Mac. It can:
- filter your traffic in all browsers and apps on your Mac
- have an unlimited number of filter rules
- provide a better filtering quality (due to the lack of browser API restrictions)
You can try it out for free.
AdGuard for Safari consists of three parts:
- An Electron application.
- Safari Content Blocker extension
- Safari Toolbar icon extension
Also, you need to install these packages globally:
npm install -g electron-packager
npm install -g node-gyp
npm install -g electron-osx-sign
cd ElectronMainApp
Install local dependencies by runnning:
yarn install
Launch the application via:
yarn start
Open menu View -> Toggle Developer Tools
Launch the application via
yarn inspect
Open URI chrome://inspect
in Chromium
Then add a network target localhost:5858
via button "Configure" and select this target below.
Replace the following line in file ./AdGuard/Config.xcconfig
AG_SIGN = <YOUR APPLE DEVELOPER COMMON NAME>
where <YOUR APPLE DEVELOPER COMMON NAME>
is your codesign identity
Make sure your system Nodejs version higher v8.9.4.
Steps to check it:
if you use nvm
run
nvm use system
node -v
otherwise
node -v
Open AdGuard.xcworkspace
in Xcode and run building project
cd ElectronMainApp
yarn test
Before updating translations you need to install dependencies.
To do this, you can build project in xCode or run the following commands:
cd ElectronMainApp
yarn install
Create directory private
in the root of the project and put file oneskyapp.json
in it.
Example of oneskyapp.json
{
"url": "https://platform.api.onesky.io/1/projects/",
"projectId": <PROJECT ID>,
"apiKey": <API KEY>,
"secretKey": <SECRET KEY>
}
sh SupportingScripts/localizations/export.sh .
sh SupportingScripts/localizations/import.sh .
Change .
to path to your project if you not in the root.
- update version
package.json
andAdGuard/standalone.xcconfig
orAdGuard/standalone-beta.xcconfig
- select xcode build configuration (Standalone-beta or Standalone)
- build apps
- notarize builds
- publish release on Github
- refresh
updates/updates.json
andrelease.json
in gh-pages branch
xcrun altool --notarize-app --primary-bundle-id "com.adguard.safari.AdGuard" --username <ICLOUD_USERNAME> --password "@keychain:altool_access" --asc-provider <TEAM_ID> --file AdGuard\ for\ Safari.app.zip
xcrun altool --notarization-info <REQUEST_ID -u <ICLOUD_USERNAME> --password "@keychain:altool_access"
xcrun stapler staple AdGuard\ for\ Safari.app.zip
Use fixed electron-osx-sign
npm install -g electron-userland/electron-osx-sign#timestamp-server