7

I have tried to port a Chrome extension that uses this API:

chrome.webRequest.onBeforeRequest.addListener(
afunction, 
{ urls: someblockedurls},
["blocking"]);

When a URL is blocked in the system, it won't be shown at all in the browsers, but with the extension instead a page defined in afunction will be shown, if the URL is in someblockedurls.

Is it possible to do the same in a Safari extension? Usually this API would be used to replace a URL with another, but it does never seem to be trigged if the URL is blocked, so anotherfunction is not called:

safari.application.addEventListener("beforeNavigate", anotherfunction, false);

0 Answers0