Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit bb1b185

Browse files
committed
lots of changes: preparing for 0.5.0
1 parent cd76a3b commit bb1b185

30 files changed

+1601
-899
lines changed

assets/httpsb-blacklist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# For those domain names which are not found in other blacklists
33

44
2mdn.net # "2mdn.net is a domain used by Doubleclick which is an advertising company..."
5+
adextent.com # "We are an advertising technology company - we build technologies that improve ads performance"
56
adgear.com # "AdGear is an online advertising technologies company based in Montreal, Canada"
67
adnxs.com # "Adnxs.com is run by AppNexus, a company that provides technology, data and analytics to help companies buy and sell online display advertising" (Ref.: http://www.theguardian.com/technology/2012/apr/23/adnxs-tracking-trackers-cookies-web-monitoring)
78
adobetag.com # "Adobe Announces Adobe Tag Manager for the Online Marketing Suite"
89
aimatch.com # "Ad Server, SAS® Intelligent Advertising for Publishers"
910
axf8.net # https://www.eff.org/deeplinks/2013/06/third-party-resources-nsa-leaks
11+
betrad.com # "Evidon: Home | Online Marketing Intelligence, Web Analytics, Privacy" (which also publishes "Ghostery" add-on..)
1012
bizographics.com # "Business Audience Marketing"
1113
bkrtx.com
1214

@@ -23,9 +25,11 @@ krxd.net # https://www.eff.org/deeplinks/2013/06/third-party-resource
2325
lijit.com # "We provide online advertising services, audience analytics"
2426
llnwd.net # http://en.wikipedia.org/wiki/Limelight_Networks
2527
lduhtrp.net
28+
mathtag.com # "domain used by MediaMath to place cookies, on behalf of its customers, on the computers of visitors to our selected customer's websites and who may view our customer's display advertisements"
2629
moatads.com # https://www.eff.org/deeplinks/2013/06/third-party-resources-nsa-leaks
2730
mookie1.com # "Specializing in online digital advertising, search marketing"
2831
msads.net # Sounds like ads, and no home web page...
32+
omtrdc.net # Redirect to Omniture
2933
outbrain.com # https://www.eff.org/deeplinks/2013/06/third-party-resources-nsa-leaks
3034
parsely.com # http://en.wikipedia.org/wiki/Parse.ly
3135
peer39.net # https://www.eff.org/deeplinks/2013/06/third-party-resources-nsa-leaks

background.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
<body>
77
<script src="lib/uri.min.js"></script>
88

9+
<script src="js/types.js"></script>
910
<script src="js/async.js"></script>
11+
<script src="js/lists.js"></script>
1012
<script src="js/background.js"></script>
13+
<script src="js/httpsb.js"></script>
14+
<script src="js/reqstats.js"></script>
1115
<script src="js/cacher.js"></script>
1216
<script src="js/cookies.js"></script>
1317
<script src="js/inject.js"></script>
14-
<script src="js/lists.js"></script>
1518
<script src="js/profiler.js"></script>
1619
<script src="js/storage.js"></script>
1720
<script src="js/tab.js"></script>

css/fonts.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@font-face {
22
font-family: 'httpsb';
33
font-style: normal;
4-
font-weight: 400;
4+
font-weight: normal;
55
src: local('httpsb'), url(fonts/Roboto_Condensed/RobotoCondensed-Regular.ttf) format('truetype');
66
}
77
@font-face {
@@ -13,7 +13,7 @@
1313
@font-face {
1414
font-family: 'httpsb';
1515
font-style: italic;
16-
font-weight: 400;
16+
font-weight: normal;
1717
src: local('httpsb'), url(fonts/Roboto_Condensed/RobotoCondensed-Light.ttf) format('truetype');
1818
}
1919
@font-face {
@@ -22,4 +22,10 @@
2222
font-weight: bold;
2323
src: local('httpsb'), url(fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf) format('truetype');
2424
}
25+
@font-face {
26+
font-family: 'httpsb';
27+
font-style: normal;
28+
font-weight: 100;
29+
src: local('httpsb'), url(fonts/Roboto_Condensed/RobotoCondensed-Light.ttf) format('truetype');
30+
}
2531

img/add-page-permissions.png

317 Bytes
Loading

img/dialog-information.png

-10 Bytes
Loading

img/remove-page-permissions.png

445 Bytes
Loading

img/system-run-symbolic.png

-17 Bytes
Loading

img/view-refresh-symbolic.png

-8 Bytes
Loading

js/async.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ function updateBadgeCallback(pageUrl) {
107107
return;
108108
}
109109
var pageStats = pageStatsFromTabId(tabId);
110+
111+
// If turned off, used special key in order to warn user
110112
var count = pageStats ? pageStats.requestCount : 0;
111-
var countStr = count.toString();
113+
var countStr = count.toFixed(0);
112114
if ( count >= 1000 ) {
113115
if ( count < 10000 ) {
114116
countStr = countStr.slice(0,1) + '.' + countStr.slice(1,-2) + 'K';
@@ -120,6 +122,7 @@ function updateBadgeCallback(pageUrl) {
120122
countStr = countStr.slice(0,-6) + 'M';
121123
}
122124
}
125+
123126
chrome.browserAction.setBadgeText({ tabId: tabId, text: countStr });
124127
chrome.browserAction.setBadgeBackgroundColor({ tabId: tabId, color: '#000' });
125128
}
@@ -181,6 +184,10 @@ function onMessageHandler(request, sender, callback) {
181184
startWebRequestHandler(request.from);
182185
break;
183186

187+
case 'gotoURL':
188+
chrome.tabs.update(request.tabId, { url: request.url });
189+
break;
190+
184191
case 'gotoExtensionUrl':
185192
chrome.tabs.create({'url': chrome.extension.getURL(request.url)});
186193
break;

js/background.js

Lines changed: 12 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ var HTTPSB = {
3131
strictBlocking: false
3232
},
3333

34-
// memo:
35-
// unicode for hourglass: &#x231B;
36-
3734
runtimeId: 1,
3835

3936
inlineFieldSeparator: '#',
@@ -59,32 +56,26 @@ var HTTPSB = {
5956

6057
// tabs are used to redirect stats collection to a specific url stats
6158
// structure.
62-
pageUrlToTabId: {},
63-
tabIdToPageUrl: {},
59+
pageUrlToTabId: { },
60+
tabIdToPageUrl: { },
6461

6562
// map["{type}/{domain}"]true
6663
// effective lists
67-
whitelist: { },
68-
blacklist: { '*/*': true },
69-
graylist: { },
70-
// user lists
71-
whitelistUser: {},
72-
blacklistUser: {},
73-
graylistUser: {}, // this will override preset blacklists
64+
// whitelist: new PermissionList(),
65+
// blacklist: new PermissionList(['*|*']),
66+
// graylist: new PermissionList(), // only purpose is to override preset blacklists
67+
68+
// domain => PermissionLists
69+
temporaryScopes: null,
70+
permanentScopes: null,
7471

75-
// Current entries from remote blacklists
76-
blacklistReadonly: {},
72+
// Current entries from remote blacklists --
73+
// just hostnames, '*/' is implied, this saves significantly on memory.
74+
blacklistReadonly: { },
7775

7876
// https://github.com/gorhill/httpswitchboard/issues/19
7977
excludeRegex: /^https?:\/\/chrome\.google\.com\/(extensions|webstore)/,
8078

81-
// constants
82-
GRAY: 0,
83-
DISALLOWED_DIRECT: 1,
84-
ALLOWED_DIRECT: 2,
85-
DISALLOWED_INDIRECT: 3,
86-
ALLOWED_INDIRECT: 4,
87-
8879
// various stats
8980
requestStats: new WebRequestStats(),
9081
cookieRemovedCounter: 0,
@@ -103,46 +94,3 @@ var HTTPSB = {
10394

10495
/******************************************************************************/
10596

106-
function _WebRequestStats() {
107-
this.all =
108-
this.main_frame =
109-
this.sub_frame =
110-
this.script =
111-
this.image =
112-
this.object =
113-
this.xmlhttprequest =
114-
this.other =
115-
this.cookie = 0;
116-
}
117-
118-
_WebRequestStats.prototype.reset = function() {
119-
this.all =
120-
this.main_frame =
121-
this.sub_frame =
122-
this.script =
123-
this.image =
124-
this.object =
125-
this.xmlhttprequest =
126-
this.other =
127-
this.cookie = 0;
128-
};
129-
130-
function WebRequestStats() {
131-
this.allowed = new _WebRequestStats();
132-
this.blocked = new _WebRequestStats();
133-
}
134-
135-
WebRequestStats.prototype.record = function(type, blocked) {
136-
if ( blocked ) {
137-
this.blocked[type] += 1;
138-
this.blocked.all += 1;
139-
} else {
140-
this.allowed[type] += 1;
141-
this.allowed.all += 1;
142-
}
143-
};
144-
145-
WebRequestStats.prototype.reset = function() {
146-
this.blocked.reset();
147-
this.allowed.reset();
148-
};

0 commit comments

Comments
 (0)