There's been mention here previously that the Adblock Plus extension may not function properly under Safari 12. The problem described there ("fails to install and will not function") is fixed, but not everything functions as it should.
(I don't think I'm saying anything new here, but it took me a couple hours of searching and reading to pull the several threads here together, and I'm hoping at least to save others that frustration.)
There are a few failure modes, and I don't think that they're all necessarily related to each other.
- Immediately after [re-]installing the extension, Safari displays an error dialog with the header "Adblock Plus" and the text "Rule list compilation failed: Empty extension." That looks like this:
I'm really not sure what underlying problem this error message indicates. Thoughts?
- After loading a page that has some ads historically blocked by Adblock Plus, a few moments later, Safari displays an error dialog with the header "Adblock Plus" and the text "Rule list compilation failed: Too many rules in JSON array." That looks like this:
It appears that some (all?) ads are still blocked as intended, although the count of ads blocked in the Adblock Plus extension icon (to the left of the address field) does not appear. I'm aware that testing actual ad-blocking in this way isn't very reliable; more on that below. (See item 4.)
I think that this is the same behavior previously reported in this forum here, where the triggering event was an upgrade to Adblock Plus 1.12.5 under an unspecified version of Safari on what appears to be macOS 10.14 (Mojave), here (without any version context), and plausibly more.
This behavior's been reported as (at least) https://issues.adblockplus.org/ticket/6071 (Adblock Plus 1.12.4 Safari 11.0.1) and https://issues.adblockplus.org/ticket/6961 (Adblock Plus 1.12.5, Safari 12.0 (13606.2.11)).
On the surface, this sounds like it's related to the Safari 11-era (I think?) limitation to "50k rules" (see commentary in https://issues.adblockplus.org/ticket/5571), but I'm seeing it on Safari 12 now with only EasyList active, and I was not seeing it with that and a couple other subscriptions active under Safari 11, so I don't think that this is that same problem.
In fact, I'm pretty sure that https://issues.adblockplus.org/ticket/6961 is exactly the same thing I'm seeing (only my OS version differs, and that issue was opened ~4 hours ago at time of writing).
- By default, the Adblock Plus extension includes subscriptions to "Adblock Warning Removal List" (not enabled) and "EasyList" (enabled). Based on the "too many rules" error message, I tried disabling "EasyList" (so that NO subscriptions are enabled), disabling the Adblock Plus extension, re-enabling the extension, and loading a page known to have ads. In this case, Safari displays an error dialog with the header "Adblock Plus" and the text "Rule list compilation failed: A list cannot have if-domain and unless-domain mixed with if-top-url and unless-top-url" That looks like this:
This is the same behavior reported as https://issues.adblockplus.org/ticket/5571. That is, Safari's native Content Blocking does not permit both *-domain and *-top-url properties in the same list. It doesn't sound like this has been addressed in AdBlock Plus because it's not possible to meet Apple's requirements and also satisfy all the types of rules that ABP supports (see that trac history for the details).
I'm not sure, but I think that, under Adblock Plus 1.12.5 and Safari 12, the error message in 2 just shows up before this gets hit if substantial rule subscriptions are selected, and that the underlying problem reported in trac #5571 is still relevant, but exacerbated with Safari 12, as it's no longer possible to uncheck "Use Safari's native Content Blocking (experimental)": the checkbox is marked, and greyed out for me.
- Actually testing whether Adblock Plus is blocking ads as intended, regardless of error message dialogs, can be somewhat complicated. A place to start with this is https://testpages.adblockplus.org/. For me, under Safari 12, with the Testpages filter subscription added and only "ABP Testcase Subscription", I hit case 3 above, and then none of the test ads are filtered. Under Safari 11.1.2 (12605.3.8.1), with the same filter configuration, the test ads are blocked as expected.
Edit: Upon further review, some of the test cases do get blocked properly with "ABP Testcase Subscription" enabled, but many do not. For example, the test cases on https://testpages.adblockplus.org/en/fi ... ent-hiding are handled correctly with the testcase subscription but those on https://testpages.adblockplus.org/en/filters/blocking are not. Adding the relevant filters manually, however, does block the elements. At no point does the 'ads blocked" counter ever get incremented, however, even when elements are getting blocked, which makes testing confusing.
- It's not directly related to this problem, but when I was searching for other people seeing the same error messages I am, I found that Apple's various restrictions on what Safari extensions can do and how they can be installed, as well as there existing both Adblock Plus and AdBlock, which two things are not the same thing, and which are disparately available as extensions for Safari, leads to some confusion (see, for example, this post here).
As I understand it, that other thing, AdBlock, is available in the Apple App Store, which is not the same as the Safari Extensions Gallery, and relies on some of the same underlying (third-party) block lists, but does not, in its current version, provide the same level of granularity of block list subscription. It is, however, possible to install AdBlock in what seems to be the way that Apple "wants you to" under Safari 12 (that is, through the App Store), while AdBlock Plus is not (yet?) available that way.
(I hope that I managed to write all of that in a way that simply states fact, rather than ascribes blame to anybody, excepting maybe Apple. I'm not trying to say either "Adblock Plus" or "AdBlock" is "better", but personally I prefer the control that Adblock Plus provides, and it looks to me like at least one other person intending to use Adblock Pluse has been confused by this into installing AdBlock instead.)
(I don't think it's relevant to the Safari versions, but I'm still running macOS 10.12.6 for unrelated software compatibility reasons.)