New #?# syntax for advanced element hiding rules · 2017-06-19 17:21 by Hubert Figuière
Starting with Adblock Plus 1.13.3 for Chrome and Opera (and development builds as of 220.127.116.112) there is a new and improved syntax which can be used for advanced element hiding filters. It allows for elements to be hidden based upon their contents using
:-abp-has. CSS property filters have also being adjusted to be consistent with the new syntax, so both those and
:-abp-has filters now use the
#?# option separator.
So for example here’s a standard element hiding filter:
Which with the new advanced syntax could be written as:
The overall syntax is the same, but
#?# filters have access to a few extensions implemented as CSS pseudo classes. This extra power comes with a cost however, the new
#?# filters are much slower and should only be used where necessary. The above example is bad therefore, since none of those extensions are being used. Filters using the new syntax must also be restricted to as few domains as possible, without any domain restrictions they are rejected outright.
So which CSS pseudo classes are supported?
:-abp-properties() (CSS property filters)
:-abp-properties() is a reworked syntax for the CSS property filter. The value of the
-abp-properties attribute becomes the argument passed to the pseudo-class selector. Your old filters will be converted automatically when loading the filter lists, and will work the same way. For example:
domain.com##[-abp-properties='background-color: rgb(0, 0, 0)']
domain.com#?#:-abp-properties(background-color: rgb(0, 0, 0))
Note the lack of quotes. As before, you can combine this into a more complex CSS selector.
With this change we introduced a new pseudo-class:
:-abp-has(selector). Inspired by the CSS Level 4 draft :has(), this pseudo-class selects an element if it contains something that matches the selector passed an argument.
domain.com#?#div.sidebar > div:-abp-has(> video.ad)
On the site “domain.com”, hide the element that has as direct descendant a
<video> element with the class “ad” and is a direct descendent of a
<div> that has the class “sidebar”. We want the enclosing element because it contain other things with want to hide.
domain.com#?#div.sidebar > div:-abp-has(> div.sidebartitle) > .adtext
On the site domain.com, hide the elements with the class “adtext”, that are direct descendent of a
<div> element that also has a direct descendent a
<div> with the class “sidebartitle”, and that is a direct descendent of a
<div> that has the class “sidebar”.
Note: It is recommended to not nest
:-abp-has() where possible, as that will further slow down element hiding. Also it is recommended that the selector inside a
:-abp-has() starts with a combinator like
~. Otherwise a lot of elements will be needlessly selected as more that one ancestor will match.
New filter type option for WebRTC connections · 2017-04-12 12:08 by Dave Barker
Starting with Adblock Plus 1.13.3 for Chrome and Opera (and development builds as of 18.104.22.1681) the blocking of WebRTC connections is supported. Those connections will have the new request type of “webrtc” and so filters can be made to target them by adding the
$webrtc type option.
WebRTC is an experimental browser technology which is supposed to be used for things like video conferencing. Unfortunately despite still being in active development it’s already being misused to serve adverts! Since Chrome does not yet allow WebRTC connections to be blocked by extensions directly (Chromium issue 707683), we’ve had to implement a workaround to achieve this.
Support for other platforms such as Firefox should follow soon, we’ll keep you posted.
Adblock Plus 1.13.2 for Chrome and Opera released · 2017-03-21 16:50 by Jon Sonesen
This is an emergency release, fixing a regression and preventing installation on unsupported Opera versions.
- Fixed a regression with the “Hide targeted messages?” notifications, which prevented the notification text from being displayed (issue 5014).
- Adblock Plus can no longer be installed on Opera 35 and older versions, which are incompatible (issue 4787).
Adblock Plus 1.13.1 for Chrome and Opera released · 2017-03-17 18:21 by Dave Barker
This is an emergency release, fixing overly eager popup blocking.
- Fixed a bug whereby popup windows containing iframes were sometimes blocked by mistake (issue 5009). While this was a pre-existing bug, it was made more serious by our recent popup blocking improvements (issue 4834).
Adblock Plus 1.13 for Chrome and Opera released · 2017-03-15 13:18 by Dave Barker
This is a major release containing some user interface improvements and more changes behind the scenes.
- Further improved our WebSocket (issue 4643, 4807) and popup (issue 4834) blocking capabilities.
- Improved the “Block element” tool, fixing a bug where the dialog window would sometimes fail to open (issue 4714) and another which very rarely caused the currently targeted element(s) not to be highlighted (issue 4603).
- Improved the “Add your own filters” interface in the Options page. Extremely large filters are now displayed properly (issue 1121), and the interface is much more responsive when dealing with large numbers of custom filters (issue 4752).
- Improved the Adblock Plus developer tools pane. Chrome’s dark theme is now supported (issue 4136), the Control-F search interface now works (issue 4644) and elements hidden by CSS property filters are now listed (issue 3596).
- Worked around a limitation with Chrome’s onCommitted event which caused many problems (issue 4598, 4599, 4647, 4804). Most notably this caused some requests to be improperly blocked / not blocked.
CSS property matching improvements · 2016-11-14 13:05 by Felix Dahlke
About a year ago, we introduced CSS property filters as a means of hiding elements based on their styles. Today, we have landed two improvements to this:
Case insensitive matching
This is a change in semantics; CSS properties will now always be matched in a case insensitive manner, to make it consistent with the way Adblock Plus matches URLs. This is unlikely to result in undesired behaviour as there shouldn’t be many use cases for case sensitive property matching.
Regular expression matching
Until now, CSS properties could only be matched using the simple URL matching syntax, which made it difficult to match property values in a fine-grained manner. To address this, properties can now optionally be matched using regular expressions. The default matching behaviour is still the same, to use regular expressions, a matching expression needs to start and end with
/, for example:
These improvements are available in Adblock Plus for Firefox as of 22.214.171.12429 and Adblock Plus for Chrome and Opera as of 126.96.36.1992, and will presumably be released with the next stable version on each platform respectively.
Please note that we still consider CSS property filters an experimental feature, and therefore subject to change. Considering this, and the fact that CSS property filters are slower than regular element hiding rules, they should only be used as a last resort.
Adblock Plus 1.12.4 for Chrome, Opera and Safari released · 2016-10-26 14:06 by Dave Barker
- Stopped the “Block Element” dialog from suggesting filters based on huge URLs, since they often made Adblock Plus become unresponsive (issue 4330).
- WebSocket connections are now considered to be of type
$other(issue 4448). For more information see Wladimir’s blog post.
- Removed the features section from the first-run page (issue 4295, issue 4294).
- Fixed a bug relating to how the document domain is determined, especially after redirects (issue 4386).
- Added a workaround to fix
$sitekeywhitelisting for requests made directly after a redirection (issue 4483).
- Improved WebSocket blocking capabilities (issue 4372).
- Fixed YouTube ad blocking on Safari 6 (issue 4351).
Adblock Plus 1.12.2 for Chrome, Opera and Safari released · 2016-08-23 17:51 by Dave Barker
This is a minor release, focused on stability and preventing circumvention.
- Prevent websites from abusing WebSockets to serve adverts (issue 1727).
- Improved Element Hiding protections against circumvention (issue 4191, 4298).
- Fixed a bug that caused content in anonymous frames to be blocked even when the parent frame was whitelisted (issue 4150).
- Worked around an issue with MutationObservers which caused older versions of Chrome and Opera to hang for some websites (issue 4101).
- Added more versions of our icons that look sharper with the new Material Design (issue 4218).
- Removed an outdated workaround that caused some whitelisted elements to be hidden in anonymous frames (issue 4210).
- Fixed a bug that caused the options page to be sometimes opened multiple times when the experimental Content Blocking feature was enabled (issue 4199).
- Improved the conversion from Adblock Plus filters to Content Blocking rules for the experimental Content Blocking feature, making sure to block/whitelist all subdomains for filters starting with
- Fixed a typo that broke key-based whitelisting (issue 4300).
Adblock Plus 1.12.1 for Chrome, Opera and Safari released · 2016-06-28 12:56 by Dave Barker
This is a minor release, including some bug fixes and performance improvements.
- Further improved element hiding performance, reducing overall page load times (issue 4075).
- Fixed a bug that stopped Adblock Plus filter subscription links from working for old versions of Chrome and Opera (issue 4065).
- Fixed a regression, introduced with the previous release, that stopped adverts from being blocked on YouTube when using older versions of Safari that still relied on the Flash player (issue 4141).
- Fixed a minor bug when converting
$documentexception rules to Safari Content Blocking rules (issue 4076, issue 4072).
Adblock Plus 1.12 for Chrome, Opera and Safari released · 2016-06-01 15:03 by Sebastian Noack
This release features experimental Safari Content Blocking support. So if you’re on Safari 9, you can try out the new (faster) blocking mechanism now by enabling it in the options. But please read the announcement first; as that feature is still experimental and Content Blockers have some limitations, there are some caveats. However, Content Blockers will eventually completely replace the old mechanism we relied on so far on Safari.
There also have been some bug fixes and other improvements for all platforms which are listed below, and some changes under the hood which aren’t visible to the user.
- Improved performance of element hiding, reducing page load times (issue 235, issue 4038, issue 4036).
- Fixed a regression, introduced with the previous release, which caused the Adblock Warning Removal List to not be added anymore (issue 3772).
- Prevent websites from circumventing element hiding by removing or disabling the stylesheet (issue 3699).
- Prevent websites from showing previously blocked elements (issue 3840).
- Added an option to hide the Adblock Plus developer tools panel (issue 3796).
- Prevent websites from tricking users into adding subscriptions by simulating clicks on abp:subscribe links (issue 3828).
- Worked around a Chrome bug that broke the feedback functionality on blogger.com (issue 2687).
- Administrators deploying Adblock Plus via group policy can now configure additional subscriptions (issue 3801).
- Starting with this release, there are unified builds for Chrome and Opera, using the exact same code on both browsers (issue 3760).
- Added experimental support for Safari Content Blocking (see above, issue 3687).
- Fixed: Wrong domain was whitelisted by icon menu after navigating through the history (issue 3924).