-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Introduction to basic filtering syntax
gwarser edited this page Aug 15, 2019
·
5 revisions
Example DOM tree:
<div id="unique-identifier" class="first-class second-class" data-storage="123-456">
<div class="first-class">
-
##
- this is always present in cosmetic filters - this means this is cosmetic filter -
##div
- selecting by element type -
###unique-identifier
- selecting byid
,##
+#
- this should be very efficient, because there should be only one unique identifier for page -
##.first-class
- selecting byclass
,##
+.
- will match other elements with same class, so: -
##.first-class.second-class
- use both classes to select only first line from example DOM.
Using dot for classes automatically split value of the class attribute on space characters.
Selecting by attribute:
-
##[data-storage="123-456"]
- will match exactly -
##[data-storage^="123-"]
- will match from the beginning -
##[data-storage$="-456"]
- will match from the end -
##[data-storage*="3-4"]
- will match in the middle -
##[id="unique-identifier"]
equivalent of###unique-identifier
-
##[class="first-class"]
equivalent of##.first-class
, but will match only second line from example DOM - class attribute is compared literally, no splitting on space characters.
uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
- Wiki home
- About the Wiki documentation
- Permissions
- Privacy policy
- Info:
- The toolbar icon
- The popup user interface
- The context menu
-
Dashboard
- Settings pane
- Filter lists pane
- My filters pane
- My rules pane
- Trusted sites pane
- Keyboard shortcuts
- The logger
- Element picker
- Element zapper
-
Blocking mode
- Very easy mode
- Easy mode (default)
- Medium mode (optimal for advanced users)
- Hard mode
- Nightmare mode
- Strict blocking
- Few words about re-design of uBO's user interface
- Reference answers to various topics seen in the wild
- Overview of uBlock's network filtering engine
- uBlock's blocking and protection effectiveness:
- uBlock's resource usage and efficiency:
- Memory footprint: what happens inside uBlock after installation
- uBlock vs. ABP: efficiency compared
- Counterpoint: Who cares about efficiency, I have 8 GB RAM and|or a quad core CPU
- Debunking "uBlock Origin is less efficient than Adguard" claims
- Myth: uBlock consumes over 80MB
- Myth: uBlock is just slightly less resource intensive than Adblock Plus
- Myth: uBlock consumes several or several dozen GB of RAM
- Various videos showing side by side comparison of the load speed of complex sites
- Own memory usage: benchmarks over time
- Contributed memory usage: benchmarks over time
- Can uBO crash a browser?
- Tools, tests
- Deploying uBlock Origin
- Proposal for integration/unit testing
- uBlock Origin Core (Node.js):
- Troubleshooting:
- Good external guides:
- Scientific papers