AdGuard for Safari app extension
Switch branches/tags
Nothing to show
Clone or download
Tim Shenin
Tim Shenin Merge pull request #97 in EXTENSIONS/safari-app-extension from featur…
…e/88 to master

* commit '293761e10989e882464f7f4847ba90088cad0214':
  update version and fix turkish
Latest commit 5e2dafd Dec 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AdGuard.xcworkspace Copyright fixes Oct 15, 2018
AdGuard update version and fix turkish Dec 5, 2018
ElectronMainApp Up version number Dec 5, 2018
MediaResources ui design Sep 28, 2018
Shared Copyright fixes Oct 15, 2018
SupportingScripts/localizations Update localization scripts Oct 26, 2018
.gitattributes Initial Jul 20, 2018
.gitignore Add upload locales gulp task Sep 20, 2018
LICENSE Rewritten the repo README Oct 25, 2018
README.md fix readme Nov 7, 2018
issue_template.md Remove closing tag Sep 24, 2018

README.md

 

AdGuard for Safari

The most advanced ad blocking extension for Safari

Free and open source, highly customizable and lightning fast ad blocking extension.

AdGuard.com | Reddit | Twitter | Telegram

Download on the AppStore Latest release



AdGuard for Safari

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.

Better yet, there is a full-fledged AdGuard for Mac

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.

How to build AdGuard for Safari

AdGuard for Safari consists of three parts:

  • An Electron application.
  • Safari Content Blocker extension
  • Safari Toolbar icon extension

Prerequisites

  • MacOS 10.13 or above
  • Xcode 9.4 or above
  • Xcode Command Line Tools
  • Node.js v8.9.4 or higher
  • Yarn

Also, you need to install these packages globally:

npm install -g electron-packager 
npm install -g node-gyp 
npm install -g electron-osx-sign

How to build

To run application in development mode

cd ElectronMainApp

Install local dependencies by runnning:

yarn install

How to debug the app

Debug window

Launch the application via:

yarn start

Open menu View -> Toggle Developer Tools

Debug main process

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.

Build and run in production mode

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

How to run tests

cd ElectronMainApp
yarn test

How to update translations

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>
}

Exporting translations

sh SupportingScripts/localizations/export.sh .

Importing translations

sh SupportingScripts/localizations/import.sh .

Change . to path to your project if you not in the root.