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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
|
//////////////////////////////////////////////////////////////////////////////
//
// John's No-ADS proxy auto configuration script
// http://www.schooner.com/~loverso/no-ads/
// loverso@schooner.com
// Questions/help web forum at http://www.network54.com/Hide/Forum/223428
//
// Copyright 1996-2004, John LoVerso. All Rights Reserved.
//
// Permission is given to use and distribute this file, as long as this
// copyright message and author notice are not removed.
//
// No responsibility is taken for any errors on inaccuracies inherent
// either to the comments or the code of this program, but if reported
// to me, then an attempt will be made to fix them.
//
// ("no monies exchanged" in Copyright clause removed 11/2001)
//
var noadsver = "$Id: no-ads.pac,v 5.70 2007/05/11 16:56:01 loverso Exp loverso $";
// ****
// **** If you do not use a proxy to access the Internet, then the following
// **** line is already fine.
// ****
// **** If you use an a proxy to access the Internet, as required by your
// **** ISP or firewall, then change the line below, replacing
// **** "DIRECT" with "PROXY hostname:port", using the correct hostname:port
// **** for your proxy server.
// ****
var normal = "DIRECT";
// ***
// *** If you are not using a blackhold proxy, then you can leave this
// *** setting as is.
// ***
// *** Otherwise, update the next line with the correct hostname:port
// *** of your blackhole proxy server. If you are using Larry Wang's
// *** BHP for Windows, you need to change the "0.0.0.0" to "127.0.0.1"
// ***
var blackhole = "PROXY 0.0.0.0:3421";
// ***
// *** If you need a different proxy to access local/internal hosts vs.
// *** the rest of the Internet, set 'localproxy' to that value. Otherwise,
// *** 'localproxy' defaults to the same value as 'normal', so you do
// *** not need to change anything in the normal case.
// ***
// *** Some typical cases:
// *** - 'normal' might be one proxy, and 'localproxy' might be another
// *** - 'normal' might be a proxy, and 'localproxy' might be "DIRECT"
// ***
// *** You will also need to change the LOCAL section below by adding
// *** rules to match your local/internal hosts.
// ***
var localproxy = normal;
// ***
// *** 'bypass' is the preferred proxy setting for when no-ads is inactive.
// *** Either use '= normal' or '= localproxy' (or perhaps just "DIRECT").
// *** This only matters when you need to use a localproxy.
// *** (You probably don't need to care about this)
// ***
var bypass = normal;
///////////////////////////////////////////////////////////////////////////////
//
// This simple kludge uses a mechanism built into most browsers (IE, Netscape,
// Mozilla, Firefox, and Opera) on most platforms to block connections to
// banner ad servers.
//
// This mechanism uses the "proxy auto configuration" to blackhole requests
// to load ad images without forcing all your traffic through an ad-blocking
// proxy server. Of course, unlike ad-blocking proxy servers, this does not
// otherwise not strip cookies.
//
// "Proxy auto configuration" invokes the JavaScript FindProxyForURL function
// below each time your browser requests a URL. This works even if you have
// JavaScript otherwise disabled in your browser! (Which you should!)
//
//
// Send me your additions or comments. I'll credit you in the file.
// (But I've removed all email addresses to stop spam harvesters).
//
///////////////////////////////////////////////////////////////////////////////
//
// These are the basic steps needed to use "no-ads.pac".
// Detailed instructions follow below!
//
// 1. Save this as a file (no-ads.pac) on your local disk
// (or, add it to your home page, if you have one)
// 2. Select a no-ads "blackhole".
// 3. Configure your browser to use this file as its auto proxy configuration.
// 4. Clear your browser's cache
// (or else it may still show you ads it has saved on your disk).
//
///////////////////////////////////////////////////////////////////////////////
//
// 1. SAVE THIS FILE
//
// Copy this file to your local machine; use your home directory (UNIX)
// or your Desktop or C:\ directory (Windows).
//
///////////////////////////////////////////////////////////////////////////////
//
// 2. SELECT A NO-ADS BLACKHOLE
//
// You can skip this section if you are using any version of Internet Explorer.
// You can also skip this section for Netscape 7.1, Mozilla 1.4, or
// Firefox 1.0 (or later), as they include PAC failover support (but do
// read the note in section "2a" below).
//
//
// The basic trick of no-ads is to match the site or URL of annoying web content
// and tell your browser to use a proxy that will deny loading of that resource
// (image, page, etc).
//
// A "black-hole" proxy server is one that always denies loading a web page.
// ("send it off to a blackhole").
//
// When you initially get "no-ads.pac", it is using this as the blackhole:
//
// "PROXY 0.0.0.0:3421"
//
// This says to use the local host at a port which nothing should be listening
// on. Thus, this is "a server that doesn't repond."
//
// This is a good default for all systems, and especially Windows.
// However, if you are using the Blackhole Proxy Server on Windows,
// be sure to change it to "PROXY 127.0.0.1:3421"
//
//
// Some possibilities for the blackhole:
//
// a. A server that doesn't respond.
//
// *** This works for all versions of Internet Explorer.
// *** This mostly works for Mozilla, Firefox, and Netscape.
//
// If you do nothing, then this is configured to direct annoying
// content to the proxy running on your own host at port 3421.
// Since you shouldn't have anything running on that port, that
// connection will timeout and the annoying content will never be
// loaded.
//
// Older versions of Netscape wait to connect to the proxy server
// (usually it needs to load part of the image to layout the web
// page), and then asks if you want to disable the proxy that
// doesn't answer.
//
// Older versions of Mozilla will give an alert saying it couldn't
// connect to the proxy server.
//
// Mozilla 1.4+, Firefox 1.0+ and Netscape 7.1 will only give
// you this alert if the whole page being display is blocked,
// rather than just an image on that page. Thus, I still
// recommend a blackhole proxy even though it isn't needed.
//
// Opera will disable your auto proxy config if the proxy server
// doesn't respond.
//
// IE doesn't care that the proxy server isn't responding. As
// this avoids a connection for annoying content, it is fastest.
//
// b. A simple, blackhole server
//
// When needed, I run a simple "server" at port 3421 that denies
// all requests. Some options you can use for this:
//
// - On Windows, you can try Larry Wang's black-hole proxy program:
//
// http://leisuresuit10.tripod.com/BlackHoleProxy/
//
// I can not vouch that his binaries are virus free, but he does
// offer the source code.
//
// - I use this shell script on UNIX; it is invoked via inetd.
// /usr/local/lib/noproxy:
//
// #!/bin/sh
// read a
// read b
// echo HTTP/1.0 501 No Ads Accepted
// echo ""
// exit
//
// Add this line to inetd.conf ('kill -HUP' inetd afterwards):
//
// 3421 stream tcp nowait nobody /usr/local/lib/noproxy noproxy
//
// This simple script doesn't work on Linux because of the
// (IMHO) broken way its TCP stack works. See the bottom of
// http://www.schooner.com/~loverso/no-ads/ for a complete copy
// of the `noproxy' shell script.
//
// If always exec'ing a shell was expensive on your computer
// (it isn't on mine), then you could use a "wait"-style Perl
// script that would accept() incoming connections.
//
// - Sean Burke has a black-hole proxy written in Perl script:
//
// http://www.speech.cs.cmu.edu/~sburke/pub/black_hole_http_server.pl
// (This is a standalone server, not run from inetd).
//
// e. A trick: use an HTTP/1.0 non-proxy server
//
// An HTTP/1.0 non-proxy server will return a 501 error when
// given a proxy request. Thus, just use the address of your
// local intranet web server as your blackhole PROXY.
// The downside of this is that it will probably also log an
// error, which wastes a small amount of resources.
//
// ***
// *** Be sure to update the "blackhole" variable above with a setting of
// *** "PROXY hostname:port" that matches your blackhole server!!
// ***
//
// ***
// *** If you already use a proxy server to access the WWW,
// *** change the "normal" variable above from "DIRECT" to
// *** be "PROXY proxy:port" to match your proxy server.
// ***
///////////////////////////////////////////////////////////////////////////////
//
// 3. TO CONFIGURE YOUR BROWSER
//
// The Proxy Auto Configuration file can be either on the local disk or
// accessed from a web server, with the following constraints:
//
// a. IE4 can only load the PAC from a web server (http:// URL)
// b. Netscape, Mozilla, Firefox and IE (5 or later) can load the
// PAC from anywhere.
// c. Netscape, Mozilla, Firefox and (probably) Opera require the correct
// MIME type when loading the PAC from a web server.
//
//
// To set the Proxy Auto Configuration with Netscape, Mozilla, or Firefox:
//
// 1. Enable Proxy Auto Config:
//
// For Netsacpe/Mozilla:
//
// Open "Edit->Preferences"
// Select "Advanced"
// Select "Proxies"
//
// For Firefox (1.0):
//
// Open "Tools->Options"
// Select "Coonection Settings" on the General tab:
//
// Select the "Auto proxy configuration URL" option.
// Enter URL or path of where you've saved this file, such as:
//
// http://yourserver/no-ads.pac
//
// If you place this on your local disk, you should use a
// file: URL such as:
//
// file:/home/loverso/no-ads.pac (UNIX)
// file:///c:/windows/desktop/no-ads.pac (Windows)
//
// (file:/ and file:// will work in Mozilla, but file:/// is correct
// required for Firefox)
//
// 2. If you are serving this from a web server, these browsers require
// the correct MIME type on the file before using it. You must configure
// your web server to provide a "application/x-ns-proxy-autoconfig"
// MIME type.
//
// a. For Apache, name the file with a ".pac" extension and add this
// line to the http.conf (or the .htaccess file in the same directory):
//
// AddType application/x-ns-proxy-autoconfig .pac
//
// b. For IIS (instructions from Kevin Roth)
//
// Open Internet Services Manager
// Right click on the web site (or directory) you wish to change.
// Choose Properties
// Click the "HTTP Headers" tab
// Click the "File Types" button in the "MIME Map" section
// Click the "New Type..." button
// Enter "pac" for "Associated Extension"
// Enter "application/x-ns-proxy-autoconfig" for "Content Type (MIME)"
// Click OK to close the Add type dialog, the MIME types dialog,
// and the main properties dialog.
//
// (This is definately needed for NS, but not for IE)
//
//
// To set the Proxy Auto Configuration with IE:
//
// 1. Enable Proxy Auto Config:
//
// Open "Tools->Internet Options"
// Select "Connections" tab
// Click "LAN Settings"
// or Choose an entry from "Dial-up settings" and click "Settings"
//
// On the settings dialog, select "Use automatic configuration script"
// Enter the URL of this file in Address field.
//
// http://yourserver/no-ads.pac
// file:///c:/windows/desktop/no-ads.pac (Windows)
//
// You can only use a file: URL with IE5 (or later).
// ("file:///" with with IE versions after 5.0 SP2)
//
// 2. Fix Security Settings (IMPORTANT):
//
// Select "Security" tab
// Select "Local intranet"
// Click "Sites" box
// Unselect "include all sites that bypass the proxy server" option
//
// 3. Disable "Auto Proxy Caching" (IMPORTANT):
// (thanks to Kevin Roth for alerting me of this!)
//
// IE contains a proxy result caching mechanism that will defeat the
// ability to block servers that server both ad and non-ad content.
// To prevent this, add the registry key described in this MS KB article:
//
// http://support.microsoft.com/?kbid=271361
//
// You can do so by downloading this file and clicking on it to load
// it into the registry. This must be done on a per-user basis.
// http://www.schooner.com/~loverso/no-ads/IE-no-auto-proxy-cache.reg
//
// IE doesn't currently check the MIME type of the PAC file.
//
// To see some notes from MS on PAC in IE, see
// http://msdn.microsoft.com/library/periodic/period99/faq0599.htm
// (they seem to have removed this URL)
//
//
// To set the Proxy Auto Configuration with Opera 6 (6.04 on Windows tested):
//
// 1. Enable Proxy Auto Config:
// Open the Preferences (Alt-P)
// Select "Network"
// Click the "Proxy servers" box
// Select "Use automatic proxy configuration"
// Enter the URL of this file as
//
// http://yourserver/no-ads.pac
// file://c:/windows/desktop/no-ads.pac
//
// (file:/// might be needed; I've not tested Opera lately)
//
// 2. You must use a blackhole proxy for Opera (it will not work with an
// address of a server that does not respond).
//
// 3. Be sure to clear the cache and exit/restart Opera.
//
///////////////////////////////////////////////////////////////////////////////
//
// 4. CLEAR YOUR BROWSER'S CACHE
//
// For Internet Explorer:
//
// Open "Tools->Internet Options"
// Select "Delete Files" under "Temporary Internet Files"
// Click "OK"
//
// For Mozilla/Netscape Navigator:
//
// Open "Edit->Preferences"
// Select "Advanced"
// Select "Proxies"
// Click "Clear Disk Cache"
// Click "Clear Memory Cache"
//
// For Firefox:
//
// Open "Tools->Options"
// Select the "Privay" tab
// Scroll down or go to the "Cache" section
// Click "Clear"
//
// For Opera:
//
// Open "File->Preferences"
// Select "History and cache"
// Click "Empty now"
//
///////////////////////////////////////////////////////////////////////////////
//
// To see the definition of this page's JavaScript contents, see
//
// http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
//
// Microsoft includes this in their KB article:
//
// http://support.microsoft.com/support/kb/articles/Q209/2/66.ASP
//
// Special PAC functions:
// Hostname:
// isPlainHostName(host)
// dnsDomainIs(host, domain)
// localHostOrDomainIs(host, hostdom)
// isResolvable(host)
// isInNet(host, pattern, mask)
// Utility:
// dnsResolve(host)
// myIpAddress()
// dnsDomainLevels(host)
// URL:
// shExpMatch(str, shexp)
// Time:
// weekdayRange(wd1, wd2, gmt)
// dateRange(...)
// timeRange(...)
//
// Other functions and methods that may work:
// http://developer.netscape.com/docs/manuals/communicator/jsref/win1.htm
// Note that "alert()" only works with Netscape4 and IE, and Mozilla 1.4+.
//
// NOTE:
// isInNet() will resolve a hostname to an IP address, and cause
// hangs on Mozilla/Firefox. Currently, these are stubbed out and replaced
// with shExpMatch(host, "a.b.c.*"), which doesn't do the same thing,
// but is sufficient for these purposes.
//
// Additional Mozilla/Firefox comments:
//
// All the above PAC functions are implemented in JavaScript,
// and are added to the body of your PAC file when it is loaded.
// See the "components/nsProxyAutoConfig.js" browser install
// directory.
//
// - shExpMatch() is implemented as three pattern.replaces()
// followed by a call to RegExp() (SLOW)
// - isPlainHostname() just checks for lack of "." in the string
// - dnsDomainIs() just matches strings exactly
// - alert() is bound to this.proxyAlert(), which displays a message
// in the JavaScript console window
///////////////////////////////////////////////////////////////////////////////
//
// Regular Expressions
//
// Angus Turnbull pointed out the JavaScript 1.2 RE operators to me.
// These should work in NS4 and IE4 (or later), but I have only tested on
// Mozilla (1.3), IE5.5, and IE6. PLEASE TELL ME IF IT WORKS FOR YOU!
//
// A good introduction is at:
// http://www.evolt.org/article/Regular_Expressions_in_JavaScript/17/36435/
// Some references:
// (old Netscape documentation is gone)
// http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/regexp.html
// http://developer.netscape.com/docs/manuals/js/client/jsref/regexp.htm
// http://www.webreference.com/js/column5/
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsobjRegExpression.asp
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsgrpRegExpSyntax.asp
// Real-time evaluator:
// http://www.cuneytyilmaz.com/prog/jrx/
//
// I'm slowly replacing multiple glob patterns with regexps.
// By using RE literals of /.../ rather than the constructor 'new RegExp()',
// the regexps should be compiled as no-ads.pac is loaded.
//
// Important notes:
// - if using the constructor, \ needs to be quoted; thus "\\." is used
// to match a literal '.'. In the RE literal form, I need to end up
// quoting any / for a URL path.
// - Avoid these for now; they are broken or not supported in "older"
// browsers such as NS4 and IE4:
// - look-aheads (?=pat)
// - non-greedy ? - a ? that follows *,+,?, and {}; (s)? is NOT non-greedy
//
// matches several common URL paths for ad images:
// such as: /banner/ /..._banner/ /banner_...
// but matches several words and includes plurals
var re_banner = /\/(.*_){0,1}(ad|adverts?|adimage|adframe|adserver|admentor|adview|banner|popup|popunder)(s)?[_.\/]/i;
// matches host names staring with "ad" but not (admin|add|adsl)
// or any hostname starting with "pop", "clicks", and "cash"
// or any hostname containing "banner"
// ^(ad(s)?.{0,4}\.|pop|click|cash|[^.]*banner|[^.]*adserv)
// ^(ad(?!(min|sl|d\.))|pop|click|cash|[^.]*banner|[^.]*adserv)
// ^(ad(?!(min|sl|d\.))|pop|click|cash|[^.]*banner|[^.]*adserv|.*\.ads\.)
var re_adhost = /^(www\.)?(ad(?!(ult|obe.*|min|sl|d|olly.*))|tology|pop|click|cash|[^.]*banner|[^.]*adserv|.+\.ads?\.)/i;
// neg:
// admin.foobar.com
// add.iahoo.com
// adsl.allow.com
// administration.all.net
// pos:
// fire.ads.ighoo.com
// ads.foo.org
// ad0121.aaaa.com
// adserver.goo.biz
// popup.foo.bar
///////////////////////////////////////////////////////////////////////////////
var isActive = 1;
function FindProxyForURL(url, host)
{
// debug
// alert("checking: url=" + url + ", host=" + host);
// Excellent kludge from Sean M. Burke:
// Enable or disable no-ads for the current browser session.
//
// To disable, visit this URL: http://no-ads.int/off
// To re-enable, visit this URL: http://no-ads.int/on
//
// (this will not work with Mozilla or Opera if the alert()s are present)
//
// This happens before lowercasing the URL, so make sure you use lowercase!
//
if (shExpMatch(host, "no-ads.int")) {
if (shExpMatch(url, "*/on*")) {
isActive = 1;
//alert("no-ads is enabled.\n" + url);
} else if (shExpMatch(url, "*/off*")) {
isActive = 0;
//alert("no-ads has been disabled.\n" + url);
} else if (shExpMatch(url, "*no-ads.int/")) {
alert("no-ads is "+(isActive ? "enabled" : "disabled")+".\n" + url);
} else {
alert("no-ads unknown option.\n" + url);
}
return blackhole;
}
if (!isActive) {
// alert("allowing (not active): return " + bypass);
return bypass;
}
// Suggestion from Quinten Martens
// Make everything lower case.
// WARNING: all shExpMatch rules following MUST be lowercase!
url = url.toLowerCase();
host = host.toLowerCase();
//
// Local/Internal rule
// matches to this rule get the 'local' proxy.
// Adding rules here enables the use of 'local'
//
if (0
// LOCAL
// add rules such as:
// || dnsDomainIs(host, "schooner.com")
// || isPlainHostName(host)
// or for a single host
// || (host == "some-local-host")
) {
// alert("allowing (local): return " + localproxy);
return localproxy;
}
//
// Whitelist section from InvisiBill
//
// Add sites here that should never be matched for ads.
//
if (0
// WHITELIST
// To add whitelist domains, simple add a line such as:
// || dnsDomainIs(host, "schooner.com")
// or for a single host
// || (host == "some-host-name")
// Note: whitelisting schooner.com will defeat the "is-it-working"
// test page at http://www.schooner.com/~loverso/no-ads/ads/
// Apple.com "Switch" ads
|| shExpMatch(url, "*.apple.com/switch/ads/*")
// SprintPCS
|| dnsDomainIs(host, ".sprintpcs.com")
// Lego
|| dnsDomainIs(host, ".lego.com")
// Dell login popups
|| host == "ecomm.dell.com"
|| host == "click2tab.mozdev.org"
|| host == "addons.mozilla.org"
// Uncomment for metacrawler
// || (host == "clickit.go2net.com")
// Wunderground weather station banners
|| shExpMatch(url, "*banners.wunderground.com/cgi-bin/banner/ban/wxbanner*")
|| shExpMatch(url, "*banners.wunderground.com/weathersticker/*")
) {
// alert("allowing (whitelist): return " + normal);
return normal;
}
// To add more sites, simply include them in the correct format.
//
// The sites below are ones I currently block. Tell me of others you add!
if (0
// BLOCK
// Block IE4/5 "favicon.ico" fetches
// (to avoid being tracked as having bookmarked the site)
|| shExpMatch(url, "*/favicon.ico")
//////
//
// Global Section
// tries to match common names
//
// RE for common URL paths
|| re_banner.test(url)
// RE for common adserver hostnames.
// The regexp matches all hostnames starting with "ad" that are not
// admin|add|adsl
// (replaces explicit shExpMatch's below)
|| re_adhost.test(host)
// || (re_adhost.test(host)
// && !(
// shExpMatch(host, "add*")
// || shExpMatch(host, "admin*")
// || shExpMatch(host, "adsl*")
// )
// )
// // or any subdomain "ads"
// || (dnsDomainLevels(host) > 2 && shExpMatch(host, "*.ads.*"))
//////
//
// banner/ad organizations
// Just delete the entire namespace
//
// doubleclick
|| dnsDomainIs(host, ".doubleclick.com")
|| dnsDomainIs(host, ".doubleclick.net")
|| dnsDomainIs(host, ".rpts.net")
|| dnsDomainIs(host, ".2mdn.net")
|| dnsDomainIs(host, ".2mdn.com")
// these set cookies
|| dnsDomainIs(host, ".globaltrack.com")
|| dnsDomainIs(host, ".burstnet.com")
|| dnsDomainIs(host, ".adbureau.net")
|| dnsDomainIs(host, ".targetnet.com")
|| dnsDomainIs(host, ".humanclick.com")
|| dnsDomainIs(host, ".linkexchange.com")
|| dnsDomainIs(host, ".fastclick.com")
|| dnsDomainIs(host, ".fastclick.net")
// one whole class C full of ad servers (fastclick)
// XXX this might need the resolver
// || isInNet(host, "205.180.85.0", "255.255.255.0")
|| shExpMatch(host, "205.180.85.*")
// these use 1x1 images to track you
|| dnsDomainIs(host, ".admonitor.com")
|| dnsDomainIs(host, ".focalink.com")
|| dnsDomainIs(host, ".websponsors.com")
|| dnsDomainIs(host, ".advertising.com")
|| dnsDomainIs(host, ".cybereps.com")
|| dnsDomainIs(host, ".postmasterdirect.com")
|| dnsDomainIs(host, ".mediaplex.com")
|| dnsDomainIs(host, ".adtegrity.com")
|| dnsDomainIs(host, ".bannerbank.ru")
|| dnsDomainIs(host, ".bannerspace.com")
|| dnsDomainIs(host, ".theadstop.com")
|| dnsDomainIs(host, ".l90.com")
|| dnsDomainIs(host, ".webconnect.net")
|| dnsDomainIs(host, ".avenuea.com")
|| dnsDomainIs(host, ".flycast.com")
|| dnsDomainIs(host, ".engage.com")
|| dnsDomainIs(host, ".imgis.com")
|| dnsDomainIs(host, ".datais.com")
|| dnsDomainIs(host, ".link4ads.com")
|| dnsDomainIs(host, ".247media.com")
|| dnsDomainIs(host, ".hightrafficads.com")
|| dnsDomainIs(host, ".tribalfusion.com")
|| dnsDomainIs(host, ".rightserve.net")
|| dnsDomainIs(host, ".admaximize.com")
|| dnsDomainIs(host, ".valueclick.com")
|| dnsDomainIs(host, ".adlibris.se")
|| dnsDomainIs(host, ".vibrantmedia.com")
|| dnsDomainIs(host, ".coremetrics.com")
|| dnsDomainIs(host, ".vx2.cc")
|| dnsDomainIs(host, ".webpower.com")
|| dnsDomainIs(host, ".everyone.net")
|| dnsDomainIs(host, ".zedo.com")
|| dnsDomainIs(host, ".bigbangmedia.com")
|| dnsDomainIs(host, ".ad-annex.com")
|| dnsDomainIs(host, ".iwdirect.com")
|| dnsDomainIs(host, ".adlink.de")
|| dnsDomainIs(host, ".bidclix.net")
|| dnsDomainIs(host, ".webclients.net")
|| dnsDomainIs(host, ".linkcounter.com")
|| dnsDomainIs(host, ".sitetracker.com")
|| dnsDomainIs(host, ".adtrix.com")
|| dnsDomainIs(host, ".netshelter.net")
|| dnsDomainIs(host, ".rn11.com")
// http://vpdc.ru4.com/content/images/66/011.gif
|| dnsDomainIs(host, ".ru4.com")
// no '.' for rightmedia.net
|| dnsDomainIs(host, "rightmedia.net")
|| dnsDomainIs(host, ".casalemedia.com")
|| dnsDomainIs(host, ".casalemedia.com")
// C-J
|| dnsDomainIs(host, ".commission-junction.com")
|| dnsDomainIs(host, ".qkimg.net")
// emjcd.com ... many others
// */adv/*
|| dnsDomainIs(host, ".bluestreak.com")
// Virtumundo -- as annoying as they get
|| dnsDomainIs(host, ".virtumundo.com")
|| dnsDomainIs(host, ".treeloot.com")
|| dnsDomainIs(host, ".memberprize.com")
// internetfuel and _some_ of the sites they redirect to
// (more internetfuel - from Sam G)
|| dnsDomainIs(host, ".internetfuel.net")
|| dnsDomainIs(host, ".internetfuel.com")
|| dnsDomainIs(host, ".peoplecaster.com")
|| dnsDomainIs(host, ".cupidsdatabase.com")
|| dnsDomainIs(host, ".automotive-times.com")
|| dnsDomainIs(host, ".healthy-lifetimes.com")
|| dnsDomainIs(host, ".us-world-business.com")
|| dnsDomainIs(host, ".internet-2-web.com")
|| dnsDomainIs(host, ".my-job-careers.com")
|| dnsDomainIs(host, ".freeonline.com")
|| dnsDomainIs(host, ".exitfuel.com")
|| dnsDomainIs(host, ".netbroadcaster.com")
|| dnsDomainIs(host, ".spaceports.com")
|| dnsDomainIs(host, ".mircx.com")
|| dnsDomainIs(host, ".exitchat.com")
|| dnsDomainIs(host, ".atdmt.com")
|| dnsDomainIs(host, ".partner2profit.com")
|| dnsDomainIs(host, ".centrport.net")
|| dnsDomainIs(host, ".centrport.com")
|| dnsDomainIs(host, ".rampidads.com")
//////
//
// banner servers
// (typically these set cookies or serve animated ads)
//
|| dnsDomainIs(host, "commonwealth.riddler.com")
|| dnsDomainIs(host, "banner.freeservers.com")
|| dnsDomainIs(host, "usads.futurenet.com")
|| dnsDomainIs(host, "banners.egroups.com")
|| dnsDomainIs(host, "ngadclient.hearme.com")
|| dnsDomainIs(host, "affiliates.allposters.com")
|| dnsDomainIs(host, "adincl.go2net.com")
|| dnsDomainIs(host, "webads.bizservers.com")
|| dnsDomainIs(host, ".addserv.com")
|| dnsDomainIs(host, ".falkag.net")
|| (host == "promote.pair.com")
// marketwatch.com (flash ads), but CSS get loaded
|| (dnsDomainIs(host, ".mktw.net")
&& !shExpMatch(url, "*/css/*"))
|| dnsDomainIs(host, ".cjt1.net")
|| dnsDomainIs(host, ".bns1.net")
// "undergroundonline"
// comes from iframe with this url: http://mediamgr.ugo.com/html.ng/size=728x90&affiliate=megagames&channel=games&subchannel=pc&Network=affiliates&rating=g
|| dnsDomainIs(host, "image.ugo.com")
|| dnsDomainIs(host, "mediamgr.ugo.com")
// web ads and "cheap Long Distance"
|| dnsDomainIs(host, "zonecms.com")
|| dnsDomainIs(host, "zoneld.com")
// AOL
|| dnsDomainIs(host, ".atwola.com")
|| dnsDomainIs(host, "toolbar.aol.com")
// animated ads shown at techbargains
|| (dnsDomainIs(host, ".overstock.com")
&& shExpMatch(url, "*/linkshare/*"))
|| (dnsDomainIs(host, ".supermediastore.com")
&& shExpMatch(url, "*/lib/supermediastore/*"))
|| (dnsDomainIs(host, ".shop4tech.com")
&& shExpMatch(url, "*/assets/*"))
|| (dnsDomainIs(host, ".softwareandstuff.com")
&& shExpMatch(url, "*/media/*"))
|| (dnsDomainIs(host, ".buy.com")
&& shExpMatch(url, "*/affiliate/*"))
|| (dnsDomainIs(host, "pdaphonehome.com")
&& (shExpMatch(url, "*/pocketpcmagbest.gif")
|| shExpMatch(url, "*/link-msmobiles.gif")))
|| (dnsDomainIs(host, "ppc4you.com")
&& shExpMatch(url, "*/ppc_top_sites.gif"))
// more animated ads... these really drive me crazy
|| (dnsDomainIs(host, ".freewarepalm.com")
&& shExpMatch(url, "*/sponsors/*"))
//////
//
// popups/unders
//
|| dnsDomainIs(host, "remotead.cnet.com")
|| dnsDomainIs(host, ".1st-dating.com")
|| dnsDomainIs(host, ".mousebucks.com")
|| dnsDomainIs(host, ".yourfreedvds.com")
|| dnsDomainIs(host, ".popupsavings.com")
|| dnsDomainIs(host, ".popupmoney.com")
|| dnsDomainIs(host, ".popuptraffic.com")
|| dnsDomainIs(host, ".popupnation.com")
|| dnsDomainIs(host, ".infostart.com")
|| dnsDomainIs(host, ".popupad.net")
|| dnsDomainIs(host, ".usapromotravel.com")
|| dnsDomainIs(host, ".goclick.com")
|| dnsDomainIs(host, ".trafficwave.net")
|| dnsDomainIs(host, ".popupad.net")
|| dnsDomainIs(host, ".paypopup.com")
// Popups from ezboard
|| dnsDomainIs(host, ".greenreaper.com")
|| dnsDomainIs(host, ".spewey.com")
|| dnsDomainIs(host, ".englishharbour.com")
|| dnsDomainIs(host, ".casino-trade.com")
|| dnsDomainIs(host, "got2goshop.com")
// more ezboard crud (from Miika Asunta)
|| dnsDomainIs(host, ".addynamix.com")
|| dnsDomainIs(host, ".trafficmp.com")
|| dnsDomainIs(host, ".makingmoneyfromhome.net")
|| dnsDomainIs(host, ".leadcart.com")
// http://www.power-mark.com/js/popunder.js
|| dnsDomainIs(host, ".power-mark.com")
//////
//
// User tracking (worse than ads) && hit counting "services"
//
// "web trends live"
|| dnsDomainIs(host, ".webtrendslive.com")
|| dnsDomainIs(host, ".wtlive.com")
// 1x1 tracking images
// ** (but also used in some pay-for-clicks that I want to follow,
// ** so disabled for now. 9/2001)
// || dnsDomainIs(host, "service.bfast.com")
// one whole class C full of ad servers
// XXX this might need the resolver
// || isInNet(host, "66.40.16.0", "255.255.255.0")
|| shExpMatch(host, "66.40.16.*")
|| dnsDomainIs(host, ".web-stat.com")
|| dnsDomainIs(host, ".superstats.com")
|| dnsDomainIs(host, ".allhits.ru")
|| dnsDomainIs(host, ".list.ru")
|| dnsDomainIs(host, ".counted.com")
|| dnsDomainIs(host, ".rankyou.com")
|| dnsDomainIs(host, ".clickcash.com")
|| dnsDomainIs(host, ".clickbank.com")
|| dnsDomainIs(host, ".paycounter.com")
|| dnsDomainIs(host, ".cashcount.com")
|| dnsDomainIs(host, ".clickedyclick.com")
|| dnsDomainIs(host, ".clickxchange.com")
|| dnsDomainIs(host, ".sitestats.com")
|| dnsDomainIs(host, ".site-stats.com")
|| dnsDomainIs(host, ".hitbox.com")
|| dnsDomainIs(host, ".exitdirect.com")
|| dnsDomainIs(host, ".realtracker.com")
|| dnsDomainIs(host, ".etracking.com")
|| dnsDomainIs(host, ".livestat.com")
|| dnsDomainIs(host, ".spylog.com")
|| dnsDomainIs(host, ".freestats.com")
|| dnsDomainIs(host, ".addfreestats.com")
|| dnsDomainIs(host, ".topclicks.net")
|| dnsDomainIs(host, ".mystat.pl")
|| dnsDomainIs(host, ".hitz4you.de")
|| dnsDomainIs(host, ".hitslink.com")
|| dnsDomainIs(host, ".thecounter.com")
|| dnsDomainIs(host, ".roiservice.com")
|| dnsDomainIs(host, ".overture.com")
|| dnsDomainIs(host, ".xiti.com")
|| dnsDomainIs(host, ".cj.com")
|| dnsDomainIs(host, ".anrdoezrs.net")
|| dnsDomainIs(host, ".hey.it")
|| dnsDomainIs(host, ".ppctracking.net")
|| dnsDomainIs(host, ".darkcounter.com")
|| dnsDomainIs(host, ".2o7.com")
|| dnsDomainIs(host, ".2o7.net")
|| dnsDomainIs(host, ".gostats.com")
|| dnsDomainIs(host, ".everstats.com")
|| dnsDomainIs(host, ".onestat.com")
|| dnsDomainIs(host, ".statcounter.com")
|| dnsDomainIs(host, ".trafic.ro")
|| dnsDomainIs(host, ".exitexchange.com")
// clickability, via CNN
|| dnsDomainIs(host, ".clickability.com")
|| dnsDomainIs(host, ".savethis.com")
//////
//
// Dead domain parking
//
|| dnsDomainIs(host, ".netster.com")
//////
//
// Search engine "optimizers"
//
|| dnsDomainIs(host, ".searchmarketing.com")
//////
//
// Spyware/worms
//
|| dnsDomainIs(host, ".friendgreetings.com")
|| dnsDomainIs(host, ".permissionedmedia.com")
|| dnsDomainIs(host, ".searchbarcash.com")
//////
//
// "Surveys"
//
|| dnsDomainIs(host, ".zoomerang.com")
//////
//
// "Casino" ads (scams)
//
|| dnsDomainIs(host, ".aceshigh.com")
|| dnsDomainIs(host, ".idealcasino.net")
|| dnsDomainIs(host, ".casinobar.net")
|| dnsDomainIs(host, ".casinoionair.com")
|| (dnsDomainIs(host, ".go2net.com")
&& shExpMatch(url, "*adclick*")
)
//////
//
// Spammers
//
|| dnsDomainIs(host, ".licensed-collectibles.com")
|| dnsDomainIs(host, ".webdesignprofessional.com")
//////
//
// Directed at extra annoying places
//
// Attempts to download ad-supported spyware without asking first
|| dnsDomainIs(host, ".gator.com")
// ebay
|| ((dnsDomainIs(host, "pics.ebay.com")
|| dnsDomainIs(host, "pics.ebaystatic.com"))
&& shExpMatch(url, "*/pics/mops/*/*[0-9]x[0-9]*")
)
|| (dnsDomainIs(host, "ebayobjects.com")
&& shExpMatch(url, "*search/keywords*")
)
|| dnsDomainIs(host, "admarketplace.com")
|| dnsDomainIs(host, "admarketplace.net")
// Bravenet & Ezboard
|| (dnsDomainIs(host, ".ezboard.com")
&& shExpMatch(url, "*/bravenet/*")
)
|| (dnsDomainIs(host, ".bravenet.com")
&& ( shExpMatch(host, "*counter*")
|| shExpMatch(url, "*/jsbanner*")
|| shExpMatch(url, "*/bravenet/*")
)
)
// GeoCities
// (checking "toto" from Prakash Persaud)
|| (( dnsDomainIs(host,"geo.yahoo.com")
|| dnsDomainIs(host,".geocities.com"))
&& (
shExpMatch(url,"*/toto?s*")
|| shExpMatch(url, "*geocities.com/js_source*")
|| dnsDomainIs(host, "visit.geocities.com")
)
)
// Yahoo ads (direct and via Akamai)
// http://us.a1.yimg.com/us.yimg.com/a/...
|| (dnsDomainIs(host,"yimg.com")
&& ( shExpMatch(url,"*yimg.com/a/*")
|| shExpMatch(url,"*yimg.com/*/adv/*")
)
)
// "eyewonder" ads at Yahoo
|| dnsDomainIs(host,"qz3.net")
|| dnsDomainIs(host,".eyewonder.com")
// background ad images
|| dnsDomainIs(host,"buzzcity.com")
// FortuneCity - ads and tracking
|| (dnsDomainIs(host,".fortunecity.com")
&& ( shExpMatch(url,"*/js/adscript*")
|| shExpMatch(url,"*/js/fctrack*")
)
)
// zdnet
// tracking webbugs:
// http://gserv.zdnet.com/clear/ns.gif?a000009999999999999+2093
|| (dnsDomainIs(host, ".zdnet.com")
&& ( dnsDomainIs(host, "ads3.zdnet.com")
|| host == "gserv.zdnet.com"
|| shExpMatch(url, "*/texis/cs/ad.html")
|| shExpMatch(url, "*/adverts")
)
)
// cnet
// web bugs and ad redirections
// taken care of by hostname rules:
// http://adimg.com.com/...
// http://adlog.com.com/...
// http://dw.com.com/clear/c.gif
// http://dw.com.com/redir?astid=2&destUrl=http%3A%2F%2Fwww.buy ...
// http://mads.com.com/mac-ad?...
|| (host == "dw.com.com" || host == "mads.com.com")
|| (dnsDomainIs(host, ".com.com")
&& ( host == "dw.com.com"
|| host == "mads.com.com"
)
)
// nytimes
|| (dnsDomainIs(host, ".nytimes.com")
&& shExpMatch(url,"*/adx/*")
)
// pop-after
|| dnsDomainIs(host, ".unicast.net")
// Be Free affiliate ads
|| dnsDomainIs(host, ".reporting.net")
|| dnsDomainIs(host, ".affliate.net")
|| (dnsDomainIs(host, ".akamai.net")
&& shExpMatch(url, "*.affiliate.net/*")
)
// Infospace.com popunder
// for "webmarket.com" & "shopping.dogpile.com" -- just say no!
|| (dnsDomainIs(host, ".infospace.com")
&& shExpMatch(url, "*/goshopping/*")
)
|| dnsDomainIs(host, ".webmarket.com")
|| dnsDomainIs(host, "shopping.dogpile.com")
// goto.com popunder for information.gopher.com
|| dnsDomainIs(host, "information.gopher.com")
// About.com popunder and floating ad bar
|| (dnsDomainIs(host, ".about.com")
&& (0
|| shExpMatch(url, "*/sprinks/*")
|| shExpMatch(url, "*about.com/0/js/*")
|| shExpMatch(url, "*about.com/f/p/*")
)
)
// Dell
|| (dnsDomainIs(host, ".dell.com")
&& shExpMatch(url, "*/images/affiliates/*")
)
// IFilm iframes
|| (dnsDomainIs(host, ".ifilm.com")
&& (shExpMatch(url, "*/partners/*")
|| shExpMatch(url, "*/redirect*")
)
)
// tomshardware
// they are most annoying:
// - cookies on their background images to track you
// - looping shockwave ads
// this kills most of the crud
// || isInNet(host, "216.92.21.0", "255.255.255.0")
|| ((dnsDomainIs(host, ".tomshardware.com")
|| shExpMatch(host, "216.92.21.*"))
&& ( shExpMatch(url, "*/cgi-bin/banner*")
|| shExpMatch(url, "*/cgi-bin/bd.m*")
|| shExpMatch(url, "*/images/banner/*")
)
)
|| shExpMatch(url, "*mapsonus.com/ad.images*")
// Slashdot: added these when I saw hidden 1x1 images with cookies
|| dnsDomainIs(host, "adfu.blockstackers.com")
|| (dnsDomainIs(host, "slashdot.org")
&& (
shExpMatch(url, "*/slashdot/pc.gif*")
|| shExpMatch(url, "*/pagecount.gif*")
|| shExpMatch(url, "*/adlog.pl*")
)
)
|| dnsDomainIs(host, "googlesyndication.com")
|| dnsDomainIs(host, "google-analytics.com")
// it-aint-cool.com
|| (dnsDomainIs(host, "aintitcool.com")
&& (
shExpMatch(url, "*/newline/*")
|| shExpMatch(url, "*/drillteammedia/*")
|| shExpMatch(url, "*/foxsearchlight/*")
|| shExpMatch(url, "*/media/aol*")
|| shExpMatch(url, "*swf")
)
)
// Staples & CrossMediaServices
|| (dnsDomainIs(host, ".staples.com")
&& shExpMatch(url, "*/pixeltracker/*")
)
|| dnsDomainIs(host, "pt.crossmediaservices.com")
// OfficeMax affiliate art (affArt->affart because of toLowerCase)
|| (dnsDomainIs(host, ".officemax.com")
&& shExpMatch(url, "*/affart/*")
)
// complicated JavaScript for directed ads!
// 1/5/2004: allow /js/ as they now use it for graphs
// || (dnsDomainIs(host, ".anandtech.com")
// && (shExpMatch(url,"*/js/*")
// || shExpMatch(url,"*/bnr_*")
// )
// )
// hardocp
// http://65.119.30.151/UploadFilesForNewegg/onlineads/newegg728hardocp.swf
|| (host == "hera.hardocp.com")
|| shExpMatch(url,"*/onlineads/*")
// complicated JavaScript for gliding ads!
|| (dnsDomainIs(host, ".fatwallet.com")
&& shExpMatch(url,"*/js/*")
)
// cnet ads
|| dnsDomainIs(host, "promo.search.com")
// IMDB celeb photos
// (Photos/CMSIcons->photos/cmsicons because of toLowerCase)
|| (dnsDomainIs(host, "imdb.com")
&& ( shExpMatch(url, "*/photos/cmsicons/*")
|| shExpMatch(url, "*/icons/*/celeb/*")
|| shExpMatch(url, "*.swf")
)
)
// incredibly annoying IMDB shock/flash ads
|| dnsDomainIs(host, "kliptracker.com")
|| dnsDomainIs(host, "klipmart.com")
|| host == "spinbox.techtracker.com"
// Amazon affiliate 'search'. retrieves a JS that writes new HTML
// that references one or more images "related to your search".
// (If there is a real use for rcm.amazon.com, let me know)
// http://rcm.amazon.com/e/cm?t=starlingtechnolo&l=st1&search=cynicism&mode=books&p=11&o=1&bg1=CEE7FF&fc1=000000&lc1=083194&lt1=_blank
|| host == "rcm.amazon.com"
//////
//
// "Other Scum And Villainry"
//
// Popup from "reserved" domains at register.com
// (I considered blocking all of register.com)
|| (dnsDomainIs(host, ".register.com")
&& (shExpMatch(url,"*.js")
|| shExpMatch(host, "searchtheweb*")
|| shExpMatch(host, "futuresite*")
)
)
|| dnsDomainIs(host, ".oingo.com")
|| dnsDomainIs(host, ".namingsolutions.com")
// "Data collection"
|| dnsDomainIs(host, ".coremetrics.com")
// Sets your home page
|| dnsDomainIs(host, ".firehunt.com")
// tracking
|| dnsDomainIs(host, ".appliedsemantics.com")
// Scum who buy ad space from the above
// || dnsDomainIs(host, ".hartfordrents.com")
// || dnsDomainIs(host, ".chicagocomputerrentals.com")
// || dnsDomainIs(host, ".ccrsolutions.com")
// || dnsDomainIs(host, ".rushcomputer.com")
// || dnsDomainIs(host, ".localesimates.com")
// || dnsDomainIs(host, ".unitedvision.com")
// XXX this might need the resolver
// || isInNet(host, "216.216.246.31", "255.255.255.255")
|| (host == "216.216.246.31")
// avsforum ads
// || isInNet(host, "216.66.21.35", "255.255.255.255")
|| (host == "216.66.21.35")
|| dnsDomainIs(host, ".avsads.com")
// bogus "search" sites at non-existent sites
|| dnsDomainIs(host, ".search411.com")
// palmgear.com
|| (dnsDomainIs(host, ".palmgear.com")
&& ( shExpMatch(url, "*/adsales/*")
|| shExpMatch(url, "*/emailblast*")
)
)
//////
//
// Contributed adult sites
//
|| dnsDomainIs(host, ".porntrack.com")
|| dnsDomainIs(host, ".sexe-portail.com")
|| dnsDomainIs(host, ".sextracker.com")
|| dnsDomainIs(host, ".sexspy.com")
|| dnsDomainIs(host, ".offshoreclicks.com")
|| dnsDomainIs(host, ".exxxit.com")
|| dnsDomainIs(host, "private-dailer.biz")
|| shExpMatch(url, "*retestrak.nl/misc/reet.gif")
|| shExpMatch(url, "*dontstayin.com/*.swf")
// debug
// || (alertmatch("NOT:" + url) && 0)
) {
// alert("blackholing: " + url);
// deny this request
return blackhole;
} else {
// debug
// alert("allowing: " + url);
// all other requests go direct and avoid any overhead
return normal;
}
}
///////////////////////////////////////////////////////////////////////////////
//
// This line is just for testing; you can ignore it. But, if you are having
// problems where you think this PAC file isn't being loaded, then change this
// to read "if (1)" and the alert box should appear when the browser loads this
// file.
//
// This works for IE4, IE5, IE5.5, IE6 and Netscape 2.x, 3.x, and 4.x.
// (For IE6, tested on Win2K)
// This does not work for Mozilla before 1.4 (and not for Netscape 6.x).
// In Mozilla 1.4+ and Fireox, this will write to the JavaScript console.
//
if (0) {
alert("no-ads.pac: LOADED:\n" +
" version: "+noadsver+"\n" +
" normal: "+normal+"\n" +
" blackhole: "+blackhole+"\n" +
" localproxy: "+localproxy+"\n" +
" bypass: "+bypass+"\n"
// MSG
);
}
// The above should show you that this JavaScript is executed in an
// unprotected global context. NEVER point at someone elses autoconfig file;
// always load from your own copy!
// an alert that returns true
function alertmatch(str)
{
// alert("match: "+str);
return 1;
}
///////////////////////////////////////////////////////////////////////////////
//
// Replacement function for dnsDomainIs(). This is to replace the
// prefix problem, which a leading '.' used to be used for.
//
// dnsDomainIs("bar.com", "bar.com") => true
// dnsDomainIs("www.bar.com", "bar.com") => true
// dnsDomainIs("www.foobar.com", "bar.com") => true <<< incorrect
//
// isInDomain("bar.com", "bar.com") => true
// isInDomain("www.bar.com", "bar.com") => true
// isInDomain("www.foobar.com", "bar.com") => false <<< correct
//
function isInDomain(host, domain) {
if (host.length > domain.length) {
return (host.substring(host.length - domain.length - 1) == "."+domain);
}
return (host == domain);
}
///////////////////////////////////////////////////////////////////////////////
//
// Tired of reading boring comments? Try reading today's comics:
// http://www.schooner.com/~loverso/comics/
//
// or getting a quote from my collection:
// http://www.schooner.com/~loverso/quote/
//
// eof
//intelliserv.net
//intellisrv.net
//rambler.ru
//rightmedia.net
//calloffate.com
//fairmeasures.com
|