Commit graph

803 commits

Author SHA1 Message Date
Arlo Breault
1867a3f121 Lightly massage some of the generated JavaScript 2019-07-10 10:49:53 +02:00
Arlo Breault
31ad9566e6 Compile coffee files and remove them
With,

  ./node_modules/.bin/coffee -b -c Cakefile `find . -path ./node_modules -prune -o -name '*.coffee'`
2019-07-10 10:49:36 +02:00
Arlo Breault
82562fb21d Bump coffeescript to 2.x
After auditing for breaking changes [0] so that the output produced uses
ES2015 classes.

[0] https://coffeescript.org/#breaking-changes)
2019-07-10 10:44:23 +02:00
Arlo Breault
359600ddc5 Fix pcConfig from compiling to a global
But note that maybe we should be constructing a new PCConfig each time
Config is instantiated, rather than sharing it on the prototype.
2019-07-10 10:39:12 +02:00
Arlo Breault
1fd6cb870e Can't reference 'this' before calling super in derived class constructors
From https://coffeescript.org/#breaking-changes-super-this
2019-07-10 10:39:12 +02:00
Cecylia Bocovich
dcea8b74fa Update required version of websocket dependency 2019-07-08 13:15:44 -04:00
Cecylia Bocovich
2cf0c73b22 Version bump because of missing icons
The webextension icons were missing in the Mozilla addons upload. We
need a newer version to update it.
2019-07-05 17:10:15 -04:00
Cecylia Bocovich
92af224676 Bumping version again
Messed up the git tag so just going for v0.0.3
2019-07-05 15:52:09 -04:00
Cecylia Bocovich
a618ab4c18 Updated version number in manifest.json 2019-07-05 15:34:24 -04:00
Arlo Breault
e6f9211d13 Update webext manifest descriptionn 2019-07-05 20:57:03 +02:00
Arlo Breault
453bf0611c Cleanup popup onMessage handler 2019-07-05 20:53:47 +02:00
Arlo Breault
6ab6e489f6 Fix comprehension in Parse.cookie
So that it compiles to,

```
if (!(name in result)) {
  result[name] = value;
}
```

instead of,

```
if (!(indexOf.call(result, name) >= 0)) {
  result[name] = value;
}
```

since `result` is an object, not an array.
2019-07-05 13:28:25 +02:00
Arlo Breault
095f4a0510 Warn when WebRTC isn't detected in the webext
Trac 31067
2019-07-05 06:58:40 +02:00
Cecylia Bocovich
4494dbd3ca Move toggle initiation init-webext.coffee
Prevents repeat calls to update() on startup
2019-07-04 17:01:27 -04:00
Cecylia Bocovich
6210b5ea7f Check returns properly for receiving offer
Now that we're setting the active attribute of pair to true before
accepting a client offer, we should be careful to reset it to false if
receiving the offer fails
2019-07-04 17:01:27 -04:00
Cecylia Bocovich
f6f37c7e68 Enable snowflake extension by default 2019-07-04 17:01:27 -04:00
Cecylia Bocovich
d1bcc3cc3e Fix linting errors 2019-07-04 17:01:27 -04:00
Cecylia Bocovich
2cd69f6f25 Save webextension toggle state
Save whether the snowflake extension is currently enabled in local
storage so that users do not need to opt-in again every time the browser
is restarted
2019-07-04 17:01:27 -04:00
Cecylia Bocovich
e93584029a Added a new snowflake colour for active cons
If there is an active connection through your snowflake proxy, your
snowflake will turn to green
2019-07-04 17:01:27 -04:00
Arlo Breault
526e42a443 Fix ref to undefined global in the badge
Introduced in ead579a, `config` is only a global in the webextension.
2019-07-03 15:40:05 +02:00
Arlo Breault
7090316e5c getClientOffer can return after snowflake is disabled 2019-07-02 10:03:44 -04:00
Arlo Breault
51bc1cf3ed Include a local copy of the arrow icon
From https://design.firefox.com/icons/icons/desktop/arrowhead-right-12.svg
2019-07-02 10:03:44 -04:00
Arlo Breault
b1116a1c35 Stop resetting after every pair closes 2019-07-02 10:03:44 -04:00
Cecylia Bocovich
58d07788c7 Fix whitespace to match conventions 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
f890739a38 Updated popup icon to be purple when it's enabled 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
651dca464f Remove unecessary logging 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
6f01a6bfc4 Removed unecessary permissions from manifest 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
788f2a595f Fixed linting errors/warnings and tests
The test failure was due to pollBorker waiting the full 5 seconds before
polling for the first time.

The lint errors were some trailing whitespace and unecessary fat arrows
2019-07-02 10:01:34 -04:00
Cecylia Bocovich
799a13d385 Add toggle functionality to web extension 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
ead579a6e9 Refactored poll loop
This enables breaking the loop from the outside and cleans up the
countdown
2019-07-02 10:01:34 -04:00
Antonela D
eeae741262 Update to popup UI and addition of toggle 2019-07-02 10:01:34 -04:00
Cecylia Bocovich
19244c7146 Merge branch 'ticket21315' 2019-06-28 17:31:02 -04:00
Arlo Breault
fdc10fd08a Bump the webextension to 0.0.1 2019-06-26 18:52:46 -04:00
Arlo Breault
055d5f1824 Appease validation warning about "Unsafe assignment to innerHTML"
This doesn't apply to the webextension but hasn't been factored out in
the build step yet.
2019-06-26 18:30:24 -04:00
Cecylia Bocovich
908cf3fc64 Updated tests to check new stats
Updated the tests to pass with our new snowflake-ips-total stat
2019-06-25 10:06:00 -04:00
Cecylia Bocovich
8f2dc3563b Added a metric that sums available snowflakes
Added another metrics item that counts the total availabel snowflakes
(unique by IP address)
2019-06-25 09:33:45 -04:00
Arlo Breault
ff6f91f3da Make the doorhanger narrower in FF 2019-06-24 16:07:03 -04:00
Arlo Breault
a70f5b9181 Use system font stack in the webextension 2019-06-24 13:25:51 -04:00
David Fifield
77aac03b7e Documentation links for loading an unpacked extension. 2019-06-21 15:02:24 -06:00
Arlo Breault
85625e19f9 Count the number of clients the webext has served 2019-06-19 17:50:05 -04:00
Cecylia Bocovich
f779013b2d Fixed small formatting errors of log output
- removed trailing ","s
- removed unecessary space before seconds
2019-06-14 17:09:06 -04:00
Cecylia Bocovich
0767a637c1 Changed variable names/types to be more reasonable
Also moved the geoip check to occur after we've make sure the proxy IP
hasn't yet been recorded. This is will cut down on unecessary
computation.
2019-06-14 17:00:31 -04:00
Cecylia Bocovich
92d61f2555 Added a comment for the metrics specification 2019-06-12 10:17:55 -04:00
Cecylia Bocovich
fe3356a54d Unit tests for metrics code
Added unit tests for metrics logging. Refactored the logMetrics()
function to allow for easier testing
2019-06-12 10:14:21 -04:00
Cecylia Bocovich
25f059f4c4 Log geoip stats of proxies by unique IP
Change it so that we log the geoip country code of proxies if they poll
within the current metrics epoch. We make sure we log by unique IP
address
2019-06-11 15:43:59 -04:00
Cecylia Bocovich
c782ebdcea Format output to meet specification
Output is now printed out in Tor Directory Protocol Format, as specified
in https://trac.torproject.org/projects/tor/ticket/21315#comment:19.
2019-06-11 15:01:05 -04:00
Cecylia Bocovich
175b8efb04 Bin metrics to nearest mult of 8 2019-06-11 14:27:42 -04:00
Cecylia Bocovich
0293674e38 Zero out counts for next time step 2019-06-11 14:19:14 -04:00
Cecylia Bocovich
d57cd07599 Implemented count metrics for broker events
Added three new metrics:
- proxyIdleCount counts the number of times a proxy polls and receives
no snowflakes
- clientDeniedCount counts the number of times a client requested a
snowflake but none were available
- clientProxyMatchCount counts the number of times a client successfully
received a snowflake
2019-06-11 14:16:01 -04:00
Cecylia Bocovich
64ce7dff1b Changed time resolution for metrics collection
Set the resolution of metrics data collection to be every 24 hours
2019-06-11 13:44:59 -04:00