From 4bcb9f12d49eff93551b546d2e86ba6f98903314 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 24 Jan 2019 16:19:18 +0000 Subject: [PATCH] Add target="_blank" to links that don't have it This is now more of a problem in the Electron app because of https://github.com/electron/electron/issues/8841 but is still annoying in the webapp if you're taken away from your chat client. Exception is the SSO link, as commented (issue filed at https://github.com/vector-im/riot-web/issues/8247). Fixes https://github.com/vector-im/riot-web/issues/8226 --- src/components/structures/UserSettings.js | 2 +- src/components/structures/auth/Login.js | 12 ++++++++++-- src/components/views/auth/AuthFooter.js | 2 +- src/components/views/auth/CaptchaForm.js | 6 +++++- src/components/views/settings/ChangePassword.js | 6 +++++- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 65e1897137..e757001e90 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -605,7 +605,7 @@ module.exports = React.createClass({

Referral

- { _t("Refer a friend to Riot:") } { href } + { _t("Refer a friend to Riot:") } { href }
); diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index cac17554c8..2d4732e9c5 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -446,7 +446,7 @@ module.exports = React.createClass({ "Either use HTTPS or enable unsafe scripts.", {}, { 'a': (sub) => { - return + return { sub } ; }, @@ -460,7 +460,7 @@ module.exports = React.createClass({ "is not blocking requests.", {}, { 'a': (sub) => { - return { sub }; + return { sub }; }, }, ) } @@ -508,6 +508,14 @@ module.exports = React.createClass({ }, _renderSsoStep: function(url) { + // XXX: This link does *not* have a target="_blank" because single sign-on relies on + // redirecting the user back to a URI once they're logged in. On the web, this means + // we use the same window and redirect back to riot. On electron, this actually + // opens the SSO page in the electron app itself due to + // https://github.com/electron/electron/issues/8841 and so happens to work. + // If this bug gets fixed, it will break SSO since it will open the SSO page in the + // user's browser, let them log into their SSO provider, then redirect their browser + // to vector://vector which, of course, will not work. return ( { _t('Sign in with single sign-on') } ); diff --git a/src/components/views/auth/AuthFooter.js b/src/components/views/auth/AuthFooter.js index ea43bf322c..98359b9650 100644 --- a/src/components/views/auth/AuthFooter.js +++ b/src/components/views/auth/AuthFooter.js @@ -26,7 +26,7 @@ module.exports = React.createClass({ render: function() { return (
- { _t("powered by Matrix") } + { _t("powered by Matrix") }
); }, diff --git a/src/components/views/auth/CaptchaForm.js b/src/components/views/auth/CaptchaForm.js index eba1682b03..01715b397c 100644 --- a/src/components/views/auth/CaptchaForm.js +++ b/src/components/views/auth/CaptchaForm.js @@ -71,7 +71,11 @@ module.exports = React.createClass({ ReactDOM.render(_t( "Robot check is currently unavailable on desktop - please use a web browser", {}, - { 'a': (sub) => { return { sub }; }}), warning); + { + 'a': (sub) => { + return { sub }; + }, + }), warning); this.refs.recaptchaContainer.appendChild(warning); } else { const scriptTag = document.createElement('script'); diff --git a/src/components/views/settings/ChangePassword.js b/src/components/views/settings/ChangePassword.js index 77c7810436..3634d6c238 100644 --- a/src/components/views/settings/ChangePassword.js +++ b/src/components/views/settings/ChangePassword.js @@ -114,7 +114,11 @@ module.exports = React.createClass({ 'making encrypted chat history unreadable, unless you first export your room keys ' + 'and re-import them afterwards. ' + 'In future this will be improved.', - ) } (https://github.com/vector-im/riot-web/issues/2671) + ) } + {' '} + + https://github.com/vector-im/riot-web/issues/2671 + , button: _t("Continue"), extraButtons: [