-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
155 lines (139 loc) · 7.3 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>AdBlock Filter Analyzer</title>
<link rel="stylesheet" href="style.css" />
<script type="module" src="adblock-filter-analyzer.js"></script>
</head>
<body>
<h1>
AdBlock Filter Analyzer
</h1>
<p>
This is a tool into which you can copy/paste AdBlock filters (also known as Static Filter Syntax). It'll color code and it'll give you an explanation of what every piece of syntax does. Good for learning. Best viewed on desktop/laptop so you can hover over code and see the definition.
</p>
<p>
<button id="clear">Clear</button>
<select id="filter-list">
<option value="">New Filter List</option>
<option value="./tests/test-good-filters.txt" selected>
Test List 1 - Should Always Pass (No Errors) (373)</option>
<option value="./tests/test-bad-filters.txt">
Test List 2 - Should Always Fail (Errors) (137)</option>
<option value="./tests/test-regex.txt">
Test List 3 - RegEx</option>
<option value="https://raw.githubusercontent.com/gorhill/uBlock/master/docs/tests/static-filtering-parser-checklist.txt">
ubo Test List</option>
<option value="https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssets@master/filters/filters.txt">
uBlock filters (23,503)</option>
<option value="https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt">
uBlock filters - Badware risks (860)</option>
<option value="https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt">
uBlock filters - Privacy (207)</option>
<option value="https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt">
uBlock filters - Resource abuse (117)</option>
<option value="https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/unbreak.txt">
uBlock filters - Unbreak (1,463)</option>
<option value="https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt">
AdGuard Base (37,577)</option>
<option value="https://filters.adtidy.org/extension/ublock/filters/11.txt">
AdGuard Mobile Ads</option>
<option value="https://easylist.to/easylist/easylist.txt">
EasyList (84,037)</option>
<option value="https://filters.adtidy.org/extension/ublock/filters/3.txt">
AdGuard Tracking Protection</option>
<option value="https://easylist.to/easylist/easyprivacy.txt">
EasyPrivacy (17,912)</option>
<option value="https://www.fanboy.co.nz/enhancedstats.txt">
Fanboy's Enhanced Tracking List</option>
<option value="https://glcdn.githack.com/curben/urlhaus-filter/raw/master/urlhaus-filter-online.txt">
Online Malicious URL Blocklist (5,586)</option>
<option value="https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt">
Spam404</option>
<option value="https://filters.adtidy.org/extension/ublock/filters/14.txt">
AdGuard Annoyances (30,038)</option>
<option value="https://filters.adtidy.org/extension/ublock/filters/4.txt">
AdGuard Social Media (11,057)</option>
<option value="https://fanboy.co.nz/fanboy-antifacebook.txt">
Anti-Facebook (68)</option>
<option value="https://easylist-downloads.adblockplus.org/easylist-cookie.txt">
EasyList Cookie (17,339)</option>
<option value="https://easylist.to/easylist/fanboy-annoyance.txt">
Fanboy's Annoyance (55,065)</option>
<option value="https://easylist.to/easylist/fanboy-social.txt">
Fanboy's Social (23,862)</option>
<option value="https://gitcdn.xyz/repo/uBlockOrigin/uAssets/master/filters/annoyances.txt">
uBlock filters - Annoyances (3,468)</option>
<option value="https://someonewhocares.org/hosts/hosts">
Dan Pollock's hosts file</option>
<option value="https://winhelp2002.mvps.org/hosts.txt">
MVPS HOSTS</option>
<option value="https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext">
Peter Lowe's Ad and tracking server list</option>
<option value="https://easylist-downloads.adblockplus.org/Liste_AR.txt">
ara: Liste AR</option>
<option value="https://easylist-downloads.adblockplus.org/easylistchina.txt">
CHN: EasyList China (中文)</option>
<option value="https://raw.githubusercontent.com/easylist/EasyListHebrew/master/EasyListHebrew.txt">
ISR: EasyList Hebrew</option>
<option value="https://raw.githubusercontent.com/yous/YousList/master/youslist.txt">
KOR: YousList</option>
<option value="https://easylist-downloads.adblockplus.org/advblock+cssfixes.txt">
RUS: RU AdList</option>
<option value="https://raw.githubusercontent.com/yourduskquibbles/webannoyances/master/ultralist.txt">
Web Annoyances Ultralist (33,634)</option>
<option value="https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt">
ABP Anti Circumvention</option>
<option value="https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/AnnoyancesFilter/sections/antiadblock.txt">
AdGuard Anti Adblock</option>
<option value="https://raw.githubusercontent.com/bogachenko/fuckfuckadblock/master/fuckfuckadblock.txt">
F Anti Adblock</option>
</select>
LineCount: <span id="line-count"></span>
ProcessTime: <span id="timer"></span>
ErrorCount: <span id="error-count"></span>
</p>
<div id="flex-container">
<div id="rich-text" contenteditable="true"></div>
<div id="definition">Hover over code with your mouse to see definition.</div>
</div>
<p id="show-json-container">
<a href="javascript:;" onclick="
document.getElementById('json-container').style.display = 'block';
document.getElementById('show-json-container').style.display = 'none';
">Show Error Details</a>
</p>
<p id="json-container">
Error Details:<br />
<textarea id="json" disabled></textarea>
</p>
<p>
<a href="tooltips.php">List Of Categories</a>
</p>
<p>
Want to report a bug or request a feature? <a href="https://github.com/RedDragonWebDesign/adblock-filter-analyzer/issues">Create an issue</a> on our GitHub.
</p>
<h2>
Reference Documents
</h2>
<ul>
<li><a href="https://help.eyeo.com/en/adblockplus/how-to-write-filters">AdBlockPlus - How To Write Filters</a></li>
<li><a href="https://github.com/gorhill/uBlock/wiki/Static-filter-syntax">uBlockOrigin - uBlock Origin's additions to the AdBlock language</a></li>
<li><a href="https://github.com/gorhill/uBlock/wiki/Resources-Library">uBlockOrigin - uBlock Origin's JavaScript Scriptlet Syntax</a></li>
<li><a href="https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters">uBlockOrigin - uBlock Origin's cosmetic filters</a></li>
<li><a href="https://adblockplus.org/en/filter-cheatsheet">AdBlockPlus - Filter Cheat Sheet</a></li>
<li><a href="https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters">AdGuard - How to create your own ad filters</a></li>
</ul>
<h2>Features</h2>
<ul>
<li>Mainly a code coloring and learning tool. But does some validation too.</li>
<li>Handles very large files (30,000 lines will take a couple of seconds, but will parse)</li>
<li>Gives an error count and detailed error report</li>
<li>Colors 29 different kinds of syntax</li>
<li>Checks for some common errors</li>
<li>Validates RegEx</li>
<li>Checks options and uboScriptlets against a list of valid functions, marks as error if not found.</li>
<li>Colors and error checks as you type</li>
</ul>
</body>
</html>