Skip to content

maximtop/SampleAdBlocker

Repository files navigation

SampleAdBlocker

Development

Be sure you have installed make utility

Setup

To setup project run: make setup

Build

To build run: make build

Lint

To lint run: make lint

What I have learned building simple content blocker with dynamic rules list and web extension for macOS

  • To log url with NSLog better use .path method instead of .absoluteString or .absoluteURL, otherwise log won't print the whole path if it meet the space in the pathname

  • In order to launch debugger for content blocker do not forget to check the Debugging Tool checkbox image

  • Do not forget to add correct app group,otherwise content blocker won't be able to load rules (/Users/<username>/Library/Group Containers/group.SampleAdBlocker/customBlockerList.json) image

  • To debug content blocker you can attach to the process name or pid image with the name of the content blocker image

  • Log messages from content blocker you can see in the Console.app if you call NSLog("debug message") in the content blocker code image

  • Check that you have allowed unsigned extensions, if your extension is not signed image

About

Sample AdBlocker for Safari

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages