Be sure you have installed make utility
To setup project run:
make setup
To build run:
make build
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
-
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
) -
To debug content blocker you can attach to the process name or pid
with the name of the content blocker
-
Log messages from content blocker you can see in the Console.app if you call NSLog("debug message") in the content blocker code
-
Check that you have allowed unsigned extensions, if your extension is not signed