2014-03-06 19:12:24 +01:00
|
|
|
TextSecure Chromium Implementation
|
|
|
|
==================================
|
|
|
|
|
2014-11-23 04:49:03 +01:00
|
|
|
[![Build Status](https://travis-ci.org/WhisperSystems/TextSecure-Browser.svg?branch=master)](https://travis-ci.org/WhisperSystems/TextSecure-Browser)
|
|
|
|
|
2014-03-06 19:12:24 +01:00
|
|
|
This is very early stuff and exists primarily to get the crypto in place.
|
2014-07-27 00:14:09 +02:00
|
|
|
*This does not currently work, dont bother trying to use it seriously yet*
|
2014-05-24 17:22:14 +02:00
|
|
|
|
2014-05-24 18:10:29 +02:00
|
|
|
Getting Started with Development
|
|
|
|
================================
|
2014-05-24 17:22:14 +02:00
|
|
|
|
2014-10-18 02:37:35 +02:00
|
|
|
These steps are for **development only**.
|
|
|
|
|
2014-05-24 17:24:15 +02:00
|
|
|
* Clone the repo
|
|
|
|
* Open Chrome
|
|
|
|
* Go to chrome://extensions/
|
|
|
|
* Enable developer mode (checkbox on the top right)
|
|
|
|
* Click "Load unpacked extension..."
|
|
|
|
* Point to the repo's directory
|
2014-05-24 18:10:29 +02:00
|
|
|
|
2014-10-30 23:05:33 +01:00
|
|
|
Note that for development, the TextSecure staging environment uses a
|
|
|
|
self-signed certificate, which Chrome will complain is insecure. So first visit
|
|
|
|
<https://textsecure-service-staging.whispersystems.org/> in your browser and
|
|
|
|
allow the certificate.
|
2014-10-18 02:37:35 +02:00
|
|
|
|
|
|
|
Now, in the extension's options, you can register for TextSecure:
|
|
|
|
|
|
|
|
* Select "Register" under "I'm new to TextSecure".
|
2014-10-30 23:05:33 +01:00
|
|
|
* Enter a real phone number (Google Voice numbers work too) and country
|
|
|
|
combination and choose to send an SMS. You will receive a real SMS.
|
2014-10-18 02:37:35 +02:00
|
|
|
* Enter the verification code you received by SMS.
|
|
|
|
|
2014-10-30 23:05:33 +01:00
|
|
|
You should now be able to use the extension. If you need to reset your
|
|
|
|
development environment, open a browser console within the extension options
|
|
|
|
page (or inspect `background.html`) and execute `localStorage.clear()` to clear
|
|
|
|
out the settings.
|
2014-10-18 02:37:35 +02:00
|
|
|
|
2014-10-30 00:04:51 +01:00
|
|
|
Dependencies
|
|
|
|
============
|
2014-10-30 22:47:20 +01:00
|
|
|
|
2014-10-30 23:05:33 +01:00
|
|
|
**Note**: Unless you need to make changes to dependencies, you can skip this
|
|
|
|
section and just use the checked in versions.
|
|
|
|
|
2015-01-09 11:46:00 +01:00
|
|
|
Dependencies are managed by [bower](http://bower.io) and built with
|
|
|
|
[grunt](http://gruntjs.com). To change them, you'll need to install node and
|
|
|
|
npm, then run `npm install` to install bower, grunt, and related plugins.
|
2014-10-30 02:32:29 +01:00
|
|
|
|
|
|
|
### Adding a bower component
|
|
|
|
|
2014-10-30 22:41:29 +01:00
|
|
|
Add the package name and version to bower.json under 'dependencies' or `bower
|
|
|
|
install package-name --save`
|
2014-10-30 02:32:29 +01:00
|
|
|
|
|
|
|
Next update the "preen" config in bower.json with the list of files we will
|
|
|
|
actually use from the new package, e.g.:
|
|
|
|
```
|
|
|
|
"preen": {
|
2014-10-30 22:41:29 +01:00
|
|
|
"package-name": [
|
|
|
|
"path/to/main.js",
|
|
|
|
"directory/**/*.js"
|
|
|
|
],
|
2014-10-30 02:32:29 +01:00
|
|
|
...
|
|
|
|
}
|
|
|
|
```
|
2014-10-31 01:57:37 +01:00
|
|
|
If you'd like to add the new dependency to js/components.js to be included on
|
|
|
|
all html pages, simply append the package name to the concat.app list in
|
|
|
|
`bower.json`. Take care to insert it in the order you would like it
|
|
|
|
concatenated.
|
2014-10-30 22:41:29 +01:00
|
|
|
|
2014-10-31 01:57:37 +01:00
|
|
|
Now, run `grunt` to delete unused package files and build `js/components.js`.
|
2014-10-30 02:32:29 +01:00
|
|
|
|
2014-10-31 01:57:37 +01:00
|
|
|
Finally, stage and commit changes to bower.json, `js/components.js`,
|
2014-10-31 00:53:08 +01:00
|
|
|
and `components/`. The latter should be limited to files we actually use.
|
2014-10-30 00:04:51 +01:00
|
|
|
|
2014-07-26 20:29:19 +02:00
|
|
|
Tests
|
|
|
|
=====
|
2014-10-30 22:41:29 +01:00
|
|
|
Please write tests! Our testing framework is
|
|
|
|
[mocha](http://visionmedia.github.io/mocha/) and our assertion library is
|
|
|
|
[chai](http://chaijs.com/api/assert/).
|
|
|
|
|
|
|
|
To run tests, open `test/index.html` in your browser. Note that
|
|
|
|
|
|
|
|
* Some tests depend on the native client module. These will fail unless you
|
|
|
|
load the test page from the `chrome-extension://` namespace (as opposed to
|
|
|
|
the `file://` namespace or via a local webserver.
|
|
|
|
* Some tests may read, write or clear localStorage. It is recommended that you
|
|
|
|
create a Chrome user profile just for running tests to avoid clobbering any
|
|
|
|
existing account and message data.
|