Commit Graph

404 Commits

Author SHA1 Message Date
Travis Ralston
e7bf643d8b Don't repackage the ValidatedDiscoveryConfig
It's usable as-is, and we can add things to it when we need to (ie: integrations).
2019-05-03 11:06:32 -06:00
Travis Ralston
c8caf6797d Move bulk of discovery processing to react-sdk 2019-05-03 11:06:32 -06:00
Travis Ralston
51941eae49 Add note to self 2019-05-03 11:06:32 -06:00
Travis Ralston
5445632026 Use new js-sdk properties for getting discovery errors
Requires https://github.com/matrix-org/matrix-js-sdk/pull/899
2019-05-03 11:06:32 -06:00
Travis Ralston
f08491cee8 Validate default homeserver config before loading the app
Implements the process described here: https://github.com/vector-im/riot-web/issues/9290#issuecomment-481966910

The expectation is that later layers (like the react-sdk) will make use of the `validated_discovery_config` option instead of interpreting the config themselves.

We intentionally block the UI from loading here to avoid races between discovery and the app loading.
2019-05-03 11:06:32 -06:00
J. Ryan Stinnett
d4de7f5df3 Delay creating the Favico instance
This avoids a canvas permission prompt from appearing on page load for users in
Firefox's resist fingerprinting mode. The prompt will still happen once you log
in and receive a notification, but at least this prevents it from happening
during the initial app experience.

Fixes https://github.com/vector-im/riot-web/issues/9605
2019-05-02 13:29:25 +01:00
Nad Chishtie
c70a2925a8 More responsive styling. 2019-04-09 17:05:41 +02:00
Nad Chishtie
17788b2027 Improved responsive styling. 2019-04-09 16:40:41 +02:00
Nad Chishtie
527dc1982e Updated branding. 2019-04-09 16:40:04 +02:00
Travis Ralston
b72ae197e5 Use a different cookie to expire any cookies people may already have
We also check for a specific value in case people set it to `true` for some reason.
2019-04-03 18:11:25 -06:00
Travis Ralston
0d2668f2b1 Step cookie down to 4 hours 2019-04-03 18:01:09 -06:00
Travis Ralston
b1c885a266 Expire mobile guide cookie after 24 hours
See https://github.com/vector-im/riot-web/issues/9360

This is to prevent it from always working. Cookies without an expiration are supposed to expire at the end of the session, however the nature of mobile browsers means that the session is unlikely to ever end.
2019-04-02 11:18:05 -06:00
Michael Telatynski
5a3b9ae454 more matching
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:38:21 +00:00
Michael Telatynski
717495c4e0 specify return types to match superclass
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:21:18 +00:00
Michael Telatynski
714570443d Allow configuration of whether closing window closes or minimizes to tray
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-24 01:08:01 +00:00
Bruno Windels
2e60037d9f add cache busting for app icons and msapp config xml 2019-02-15 16:11:33 +01:00
J. Ryan Stinnett
01f9e48b79 Re-enable theme setting at startup 2019-02-13 10:47:51 +00:00
J. Ryan Stinnett
3eb550a15c Spell homeserver correctly 2019-01-31 18:52:49 -06:00
J. Ryan Stinnett
b96fa43376 Tweak auth overflow on Windows and Linux 2019-01-29 10:20:11 -06:00
David Baker
03de7f9901 Cache-bust olm.wasm
In the same way as we now do images/fonts
2019-01-28 14:09:28 +00:00
David Baker
0022834af4
Merge pull request #8241 from vector-im/dbkr/fix_platform_name
Fix device names on desktop
2019-01-23 17:15:56 +00:00
David Baker
9aad7042a2 Fix device names on desktop
Apparently I really had a bad day with includes / indexOf
2019-01-23 16:53:50 +00:00
David Baker
9aa8b32df8
Merge pull request #8238 from vector-im/dbkr/lt_gt_desktop_notifs
Fix literal &lt/&gt in notifications
2019-01-23 16:14:39 +00:00
David Baker
25ef0913bb Fix registration nextLink on desktop
Another instance of detecting the file: protocol

Fixes https://github.com/vector-im/riot-web/issues/8235
2019-01-23 15:25:04 +00:00
David Baker
a5ed5be3cf Fix literal &lt/&gt in notifications
Apparently I couldn't decide whether I was writing indexOf(...) > -1
or .includes()

Fixes https://github.com/vector-im/riot-web/issues/8230
2019-01-23 14:47:31 +00:00
J. Ryan Stinnett
7a3df1c7d6 Support image URLs in HTML templates
Expands the image build process to also support the right paths when used in
HTML templates.
2019-01-18 08:39:16 -06:00
J. Ryan Stinnett
05f9cf453d Fix SdkConfig import to use transformed module
This was originally added in #7755, which pulled in the original source for the
module, breaking ancient browsers without support for classes (#8082).
2019-01-11 17:37:20 -06:00
David Baker
373c587ef8
Merge pull request #8003 from vector-im/develop
Merge develop into experimental
2019-01-03 18:56:03 +00:00
David Baker
9e085511fd
Merge pull request #7943 from vector-im/dbkr/electron_custom_protocol
Electron: Load app from custom protocol
2019-01-03 10:09:31 +00:00
David Baker
751a1dc543 Add tool to migrate logins between origins
App checks at startup for an existing session, if there isn't one,
it will start the tool to check for a login in the file:// origin.
If there is one, it will copy the login over to the vector://vector
origin.

In principle this could also be used to migrate logins between
other origins on the web if this were ever required.

This includes a minified copy of the browserified js-sdk with
a getAllEndToEndSessions() function added to the crypto store
(https://github.com/matrix-org/matrix-js-sdk/pull/812). This is
not great, but for a short-lived tool this seems better than
introducing more entry points into webpack only used for the
electron app.
2018-12-21 19:14:25 +00:00
David Baker
4274c7287a Fix the IndexedDB worker
Looks like this was broken in the webpack 4 upgrade due to the
worker script setter and the bundle being re-ordered in index.html.

 * Remove the loop: we only use two scripts now, so import them
   explicitly
 * Remove outdated olm import code.
 * Stop generating a script import for each theme: we were pulling
   in 3 js files that did absolutely nothing.
 * Fix worker 'onmessage' scope (set it as a global rather than
   trying to make it an ES6 module which it isn't).
 * Fail hard if the indexeddb worker script isn't set to avoid
   this happening again.
2018-12-20 11:11:52 +00:00
David Baker
baf3df5736
Merge pull request #7920 from vector-im/dbkr/fix_indexeddb_worker
Fix the IndexedDB worker
2018-12-20 07:49:29 +00:00
David Baker
7527bdd2c7 Fix the IndexedDB worker
Looks like this was broken in the webpack 4 upgrade due to the
worker script setter and the bundle being re-ordered in index.html.

 * Remove the loop: we only use two scripts now, so import them
   explicitly
 * Remove outdated olm import code.
 * Stop generating a script import for each theme: we were pulling
   in 3 js files that did absolutely nothing.
 * Fix worker 'onmessage' scope (set it as a global rather than
   trying to make it an ES6 module which it isn't).
 * Fail hard if the indexeddb worker script isn't set to avoid
   this happening again.
2018-12-19 22:05:04 +00:00
J. Ryan Stinnett
8cd37d28da Clarify line number instructions
Signed-off-by: J. Ryan Stinnett <jryans@gmail.com>
2018-12-19 15:04:54 +00:00
David Baker
ff45dc6430 Remove unused commented line 2018-12-19 09:29:05 +00:00
David Baker
0c428efea0 lint 2018-12-18 18:03:47 +00:00
David Baker
19f1489c92 Run the Desktop app in a sandbox
* Turn off node integration in the electron renderer process
 * Enable the chromium sandbox to put the renderer into its own process
 * Expose just the ipc module with a preload script
 * Introduce a little IPC call wrapper so we can call into the
   renderer process and await on the result.
 * Use this in a bunch of places we previously used direct calls
   to electron modules.
 * Convert other uses of node, eg. use of process to derive the
   platform (just look at the user agent)
 * Strip out the desktopCapturer integration which doesn't appear
   to have ever worked (probably best to just wait until
   getDisplayMedia() is available in chrome at this point:
   https://github.com/vector-im/riot-web/issues/4880).
2018-12-18 17:42:55 +00:00
Travis Ralston
373f850002 Safely bind console.log and default withLogs to true 2018-11-29 13:13:46 -07:00
Travis Ralston
ac34ca11df Appease the linter 2018-11-27 16:11:58 -07:00
Travis Ralston
710e295b44 Add a function to send a rageshake from the console
This is mostly useful for cases when the UI is broken or the user can't access the button because they aren't logged in. This is particularly helpful for troubleshooting issues with .well-known discovery if/when they come up.

Ref: https://github.com/vector-im/riot-web/issues/4802
2018-11-27 16:03:37 -07:00
Bruno Windels
22a1a7343b Merge branch 'develop' into experimental 2018-11-26 13:11:03 +01:00
David Baker
704a599811 Put back modernizr import
In a way that hopefully makes the linter happy and makes it implicit
that it's side-effecting a global.
2018-11-22 18:27:53 +00:00
David Baker
1dfaf70562
Revert "Revert "Run lint on travis builds and use modern node versions"" 2018-11-22 18:25:55 +00:00
David Baker
f701e2601a
Revert "Run lint on travis builds and use modern node versions" 2018-11-22 18:17:09 +00:00
David Baker
a7a5679bfa
Merge pull request #7490 from aaronraimist/lint
Run lint on travis builds and use modern node versions
2018-11-22 18:01:04 +00:00
David Baker
092ae7ef2f Fix missing js-sdk logging
Some of the js-sdk logging was going missing due to js-sdk's
loglevel library being initialised before the rageshake logging.

Fix by doing the rageshake setup within an import, as commented.
2018-11-22 16:21:55 +00:00
Bruno Windels
18daa186b0 Merge branch 'develop' into experimental 2018-10-26 15:33:57 +02:00
Travis Ralston
10efaaa078 Merge branch 'develop' into lint 2018-10-25 16:06:02 -06:00
David Baker
9b80aa76ce
Merge pull request #7385 from vector-im/dbkr/wasm
Support WebAssembly version of Olm
2018-10-25 15:58:24 +01:00
Bruno Windels
c68770c0aa ignore setting and always show dharma theme for now 2018-10-23 15:51:06 +02:00
Aaron Raimist
c470e2dcfb
Actually I'll just fix the errors myself and get rid of lintwithexclusions
I seemingly need babel-eslint version 8 for VectorHomePage.js but might as well just upgrade to version 10

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-19 21:04:55 -05:00
Aaron Raimist
fe11ae73db
Run lintwithexclusions on travis builds
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-19 20:59:07 -05:00
Aaron Raimist
6abd1de8b8
eslint --fix on src/
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-19 20:59:06 -05:00
David Baker
2854c0969b Don't set tags on notifications
They are to suppress notifications that don't want to be shown in
addition to each other. This makes no sense for our notifications:
they're each for independent messages. Also settings tags on
notifications makes electron crash on windows when you close the
notif, as per https://github.com/vector-im/riot-web/issues/7512
2018-10-18 19:07:59 +01:00
David Baker
47493fa7d9 Merge branch 'master' into develop 2018-10-18 18:43:58 +01:00
David Baker
bb907d49c9 Typo 2018-10-18 18:35:01 +01:00
David Baker
231ca253f2 Stop electron crashing
Workaround temporarily by not closing notifs on win32 as per
comment.

Fixes https://github.com/vector-im/riot-web/issues/7512
2018-10-18 18:31:06 +01:00
Travis Ralston
47ade14e07
Merge pull request #6831 from MTRNord/patch-8
Fix Tinter.setTheme to not fire using Firefox
2018-10-12 13:55:43 -06:00
Aaron Raimist
d836ad8dbc
Undo turning warnings back on (#7409)
I guess that turns on warnings for everything, not just riot-web

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 11:05:25 -05:00
Aaron Raimist
d035efb14e
Fix lint warnings and turn warnings back on (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:41:45 -05:00
Aaron Raimist
401c85ad5b
Fix Promise.defer warnings in WebPlatform.js (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:23:06 -05:00
Aaron Raimist
54c46df0dc
Fix Promise.defer warnings in index.js (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:23:06 -05:00
Aaron Raimist
a5fb33de02
Fix Promise.defer warnings in getconfig.js (#7409)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2018-10-05 10:23:05 -05:00
David Baker
e277d02f83 Merge remote-tracking branch 'origin/develop' into dbkr/wasm 2018-10-05 14:04:43 +01:00
David Baker
e28180f3d5
Merge pull request #7462 from vector-im/dbkr/gone_away_is_the_bluebird
Silence bluebird warnings
2018-10-05 13:25:26 +01:00
David Baker
bccccb2758 Silence bluebird warnings 2018-10-05 12:15:29 +01:00
David Baker
c5ee92f4c3 Fall back to legacy asm.js Olm 2018-10-04 20:11:34 +01:00
David Baker
a356264801 Fix double-closed tags 2018-10-04 10:49:28 +01:00
David Baker
30f0a7932b Merge remote-tracking branch 'origin/develop' into dbkr/wasm 2018-10-02 16:58:31 +01:00
David Baker
894e31fe73 Don't show mobile guide if deep linking
Other part of https://github.com/vector-im/riot-web/issues/7378
2018-09-28 11:23:46 +01:00
David Baker
ac81080185
Merge pull request #7408 from vector-im/dbkr/unnecessary_custom_server
Don't show custom server bit on matrix.org
2018-09-28 10:32:06 +01:00
David Baker
bc8323f96b Don't show custom server bit on matrix.org
On mobile guide

Part of https://github.com/vector-im/riot-web/issues/7378
2018-09-27 18:19:33 +01:00
David Baker
1f34d2d644 Kill off olm-loader
Now that Olm needs to be inited asynchronously anyway, we can just
pass the options to Olm.init(), and as long as we do that before we
start the js-sdk, we're all good.

This will means the olm js is now part of the main bundle but since
it's now just a wrapper around the wasm, this is probably faster.

Also add the directwatch flag to olm.wasm because otherwise it
doesn't seem to copy the file in watch mode...
2018-09-26 16:44:52 +01:00
Matthew Hodgson
c57c653535 Merge branch 'develop' into matthew/webpack4 2018-09-26 00:15:56 +01:00
David Baker
c511902356 Support WebAssembly version of Olm.
* Olm no longer supports setting the stack/memory size at runtime,
   so don't (they're now set to be that in the Olm build).
 * Copy the wasm file from the Olm library (see multiple comments
   about it being in the wrong place and webpack being awful).
2018-09-25 17:55:41 +01:00
Bruno Windels
d10fda36af fix config not loading correctly anymore 2018-09-05 16:38:00 +02:00
David Baker
e23195fd86 Conditionally show custom server bit 2018-09-04 10:08:52 +01:00
David Baker
9c8ef4240c Instructions for installing mobile apps
Replace the native js dialog with a page telling you how to
download the apps and how to set your HS URL.
2018-09-03 20:38:30 +01:00
David Baker
e2bad5bdc8 Tidy up index.js
Non-functional changes (before I start messing with it).

Switch to import, move code out of the top level, switch to one
consistent way of declaring functions, keep imports at the top.
2018-09-03 13:01:52 +01:00
David Baker
dcde74bc09
Revert "Remove package-lock.json for now" 2018-08-02 10:02:09 +01:00
David Baker
10ed13acc0 Add package-lock to .gitignore 2018-08-01 15:08:12 +01:00
Marcel
5b32ecb719
[Tinter.setTheme fix] add missing comment and move old to correct position 2018-07-24 13:38:49 +02:00
Marcel
58de839621
Fix Tinter.setTheme to not fire using Firefox
This if checks if we got a Firefox using a variable that is undefined everywhere except in Firefox. In Firefox because of how it renders the DOM ensure that css is always loaded before it loads/runs the js code. Therefor onload 1. never triggers and 2. we can just call setTheme.
2018-05-31 22:32:29 +02:00
David Baker
8f4953c182
Merge branch 'develop' into webpack4 2018-05-11 16:27:50 +01:00
Luke Barnard
7f50fb3023 Merge branch 'master' into develop 2018-05-09 13:32:06 +01:00
Luke Barnard
9b055171ab Enforce loading babel-polyfill first
This is to avoid loading anything before loading the polyfill, otherwise
we risk loading dependencies (such as React) before it.

This was causing the compatibility page to fail somehow.

See https://github.com/facebook/react/issues/8379

Fixes https://github.com/vector-im/riot-web/issues/6562
2018-04-27 13:32:09 +01:00
MTRNord
02a185f2fe
Update Webpack to version 4 2018-04-27 11:32:59 +02:00
David Baker
981bd94615 Change CSS dependencies to not hardcoded paths
Add add direct dependencies on the packages they come from, because
referring to them by path like this doesn't work in a frash
checkout / npm install because of how npm lays out the packages.
2018-04-25 17:33:18 +01:00
Matthew Hodgson
df3fb83da3 move deps to sdk for stuff now in the sdk 2018-04-18 10:53:17 +01:00
Matthew Hodgson
d6931252c1 move rageshake to sdk 2018-04-13 01:35:55 +01:00
Matthew Hodgson
3d20a64502 export enum via method for convenience from matrix-react-sdk 2018-04-13 01:25:00 +01:00
Matthew Hodgson
3ecbfae371 move everything not explicitly riot (or status) branded into matrix-react-sdk 2018-04-11 23:49:52 +01:00
Luke Barnard
527e8306b2
Merge pull request #6317 from vector-im/dbkr/og_image_sort_of_configurable
Remove og:image with status.im URL
2018-03-15 09:21:12 +00:00
David Baker
96f374ed69 Remove og:image with status.im URL
And make it configurable, albeit only at buuld time, as hopefully
explained in the README.
2018-03-14 18:34:26 +00:00
Luke Barnard
647c7d7629 Fix themeing bug with Firefox where "disabled" ignored
A bug in firefox means "disabled" isn't honoured when set in the
HTML. Doing `a.disabled = false` does work however, and Chrome
also appears to honour this.
2018-03-12 16:15:17 +00:00
Matthew Hodgson
aa54032500 force refresh when updating the app 2018-03-09 01:45:44 +00:00
Matthew Hodgson
c315a59717
remove doubly-closed tag 2018-02-23 16:27:34 +00:00
rugk
e3dcaebe9b
Merge branch 'develop' into patch-2 2018-02-15 13:16:34 +01:00
rugk
ba7991deba
Fix syntax error of wrong use of self-closing HTML tag
Firefox complaint about this in the source code view:
2018-02-15 02:36:05 +01:00
Matthew Hodgson
2a402985aa
Merge pull request #5685 from aidalgol/root-lang-attrib-fix
Set html lang attribute from language setting
2017-11-30 10:12:40 +00:00