Commit Graph

62 Commits (3aa9ca785f230720ffc3ee90e6a0fa8fdf72e62d)

Author SHA1 Message Date
lilia 76e170686a Make getBackground async 10 years ago
lilia bf2bf4cfd9 Remove redirect to index from registration.done() 10 years ago
lilia fd6e2954f7 Curtail over-zealous websocket reconnects
Closes #173

Previously, in the event of a failed websocket auth, we would attempt to
reconnect once a second ad infinitum. This changeset ensures that we
only reconnect automatically if the socket closed 'normally' as
indicated by the code on the socket's CloseEvent. Otherwise, show a
'Websocket closed' error on the inbox view.

Ideally we would show a more contextual error (ie, 'Unauthorized'), but
unfortunately the actual server response code is not available to our
code. It can be observed in the console output from the background page,
but programmatically, we only receive the WebSocket CloseEvent codes
listed here:
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes

The websocket error message is displayed by a normally-hidden but ever
present socket status element. Clicking this element will immediately
refresh the background page, which will try again to open the websocket
connection.
10 years ago
lilia 607d5d3307 Abstract chrome browser action and windows stuff 10 years ago
lilia 5762e59c41 DRY up registration event callbacks
This was just a special case of the extension.on/trigger interface.
10 years ago
lilia 470346c9c4 Save incoming messages and pass to frontend asynchronously
After a message is saved asynchronsly, fire an event and pass the
message attributes to frontend listeners via the chrome-runtime API.

This behavior is similar to the 'storage' event fired by localStorage.
11 years ago
lilia 5a0e199fc5 Namespace registration helpers 11 years ago
Sumit Bindal d537d6a91f Fixing lint errors
Fixing JSLint Problems
11 years ago
lilia 13446e9c17 "Fix dirty hack" (runtime.reload) in chromium.js
Runtime reload is overkill and causes a jarring ux. Instead, send and
receive messages across the runtime. Also, if we need to jump between
the main ui and options pages, simply navigate within the current tab
rather than spawning a new one.
11 years ago
Marco 69ba6581b0 moved some chromium-specific code into chromium.js (using extension.navigator namespace) 11 years ago
Matt Corallo aec36468bc Request new keys (largely untested) 11 years ago
Matt Corallo d9bf0a41fb textsecure.storage, chromium.js 11 years ago