mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge pull request #4113 from matrix-org/t3chguy/fix_downloading
Handle file downloading locally in electron rather than sending to browser
This commit is contained in:
commit
72e5313a5a
35 changed files with 68 additions and 61 deletions
|
@ -160,7 +160,7 @@ const transformTags = { // custom to matrix
|
||||||
delete attribs.target;
|
delete attribs.target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
attribs.rel = 'noopener'; // https://mathiasbynens.github.io/rel-noopener/
|
attribs.rel = 'noreferrer noopener'; // https://mathiasbynens.github.io/rel-noopener/
|
||||||
return { tagName, attribs };
|
return { tagName, attribs };
|
||||||
},
|
},
|
||||||
'img': function(tagName, attribs) {
|
'img': function(tagName, attribs) {
|
||||||
|
|
|
@ -136,7 +136,7 @@ export default class Markdown {
|
||||||
// thus opening in a new tab.
|
// thus opening in a new tab.
|
||||||
if (externalLinks) {
|
if (externalLinks) {
|
||||||
attrs.push(['target', '_blank']);
|
attrs.push(['target', '_blank']);
|
||||||
attrs.push(['rel', 'noopener']);
|
attrs.push(['rel', 'noreferrer noopener']);
|
||||||
}
|
}
|
||||||
this.tag('a', attrs);
|
this.tag('a', attrs);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -821,10 +821,10 @@ export default createReactClass({
|
||||||
{_t(
|
{_t(
|
||||||
"Want more than a community? <a>Get your own server</a>", {},
|
"Want more than a community? <a>Get your own server</a>", {},
|
||||||
{
|
{
|
||||||
a: sub => <a href={hostingSignupLink} target="_blank" rel="noopener">{sub}</a>,
|
a: sub => <a href={hostingSignupLink} target="_blank" rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
<a href={hostingSignupLink} target="_blank" rel="noopener">
|
<a href={hostingSignupLink} target="_blank" rel="noreferrer noopener">
|
||||||
<img src={require("../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
<img src={require("../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
||||||
</a>
|
</a>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
|
@ -1375,7 +1375,8 @@ export default createReactClass({
|
||||||
cancelButton: _t('Dismiss'),
|
cancelButton: _t('Dismiss'),
|
||||||
onFinished: (confirmed) => {
|
onFinished: (confirmed) => {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
window.open(consentUri, '_blank');
|
const wnd = window.open(consentUri, '_blank');
|
||||||
|
wnd.opener = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}, null, true);
|
}, null, true);
|
||||||
|
|
|
@ -481,7 +481,7 @@ export default createReactClass({
|
||||||
"Either use HTTPS or <a>enable unsafe scripts</a>.", {},
|
"Either use HTTPS or <a>enable unsafe scripts</a>.", {},
|
||||||
{
|
{
|
||||||
'a': (sub) => {
|
'a': (sub) => {
|
||||||
return <a target="_blank" rel="noopener"
|
return <a target="_blank" rel="noreferrer noopener"
|
||||||
href="https://www.google.com/search?&q=enable%20unsafe%20scripts"
|
href="https://www.google.com/search?&q=enable%20unsafe%20scripts"
|
||||||
>
|
>
|
||||||
{ sub }
|
{ sub }
|
||||||
|
@ -496,11 +496,10 @@ export default createReactClass({
|
||||||
"<a>homeserver's SSL certificate</a> is trusted, and that a browser extension " +
|
"<a>homeserver's SSL certificate</a> is trusted, and that a browser extension " +
|
||||||
"is not blocking requests.", {},
|
"is not blocking requests.", {},
|
||||||
{
|
{
|
||||||
'a': (sub) => {
|
'a': (sub) =>
|
||||||
return <a target="_blank" rel="noopener" href={this.props.serverConfig.hsUrl}>
|
<a target="_blank" rel="noreferrer noopener" href={this.props.serverConfig.hsUrl}>
|
||||||
{ sub }
|
{ sub }
|
||||||
</a>;
|
</a>,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
) }
|
) }
|
||||||
</span>;
|
</span>;
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default createReactClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<div className="mx_AuthFooter">
|
<div className="mx_AuthFooter">
|
||||||
<a href="https://matrix.org" target="_blank" rel="noopener">{ _t("powered by Matrix") }</a>
|
<a href="https://matrix.org" target="_blank" rel="noreferrer noopener">{ _t("powered by Matrix") }</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -331,7 +331,7 @@ export const TermsAuthEntry = createReactClass({
|
||||||
checkboxes.push(
|
checkboxes.push(
|
||||||
<label key={"policy_checkbox_" + policy.id} className="mx_InteractiveAuthEntryComponents_termsPolicy">
|
<label key={"policy_checkbox_" + policy.id} className="mx_InteractiveAuthEntryComponents_termsPolicy">
|
||||||
<input type="checkbox" onChange={() => this._togglePolicy(policy.id)} checked={checked} />
|
<input type="checkbox" onChange={() => this._togglePolicy(policy.id)} checked={checked} />
|
||||||
<a href={policy.url} target="_blank" rel="noopener">{ policy.name }</a>
|
<a href={policy.url} target="_blank" rel="noreferrer noopener">{ policy.name }</a>
|
||||||
</label>,
|
</label>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -604,6 +604,7 @@ export const FallbackAuthEntry = createReactClass({
|
||||||
this.props.authSessionId,
|
this.props.authSessionId,
|
||||||
);
|
);
|
||||||
this._popupWindow = window.open(url);
|
this._popupWindow = window.open(url);
|
||||||
|
this._popupWindow.opener = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onReceiveMessage: function(event) {
|
_onReceiveMessage: function(event) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ export default class ModularServerConfig extends ServerConfig {
|
||||||
"Enter the location of your Modular homeserver. It may use your own " +
|
"Enter the location of your Modular homeserver. It may use your own " +
|
||||||
"domain name or be a subdomain of <a>modular.im</a>.",
|
"domain name or be a subdomain of <a>modular.im</a>.",
|
||||||
{}, {
|
{}, {
|
||||||
a: sub => <a href={MODULAR_URL} target="_blank" rel="noopener">
|
a: sub => <a href={MODULAR_URL} target="_blank" rel="noreferrer noopener">
|
||||||
{sub}
|
{sub}
|
||||||
</a>,
|
</a>,
|
||||||
},
|
},
|
||||||
|
|
|
@ -46,7 +46,7 @@ export const TYPES = {
|
||||||
label: () => _t('Premium'),
|
label: () => _t('Premium'),
|
||||||
logo: () => <img src={require('../../../../res/img/modular-bw-logo.svg')} />,
|
logo: () => <img src={require('../../../../res/img/modular-bw-logo.svg')} />,
|
||||||
description: () => _t('Premium hosting for organisations <a>Learn more</a>', {}, {
|
description: () => _t('Premium hosting for organisations <a>Learn more</a>', {}, {
|
||||||
a: sub => <a href={MODULAR_URL} target="_blank" rel="noopener">
|
a: sub => <a href={MODULAR_URL} target="_blank" rel="noreferrer noopener">
|
||||||
{sub}
|
{sub}
|
||||||
</a>,
|
</a>,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -420,7 +420,7 @@ export default createReactClass({
|
||||||
onClick={this.onPermalinkClick}
|
onClick={this.onPermalinkClick}
|
||||||
href={permalink}
|
href={permalink}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noreferrer noopener"
|
||||||
>
|
>
|
||||||
{ mxEvent.isRedacted() || mxEvent.getType() !== 'm.room.message'
|
{ mxEvent.isRedacted() || mxEvent.getType() !== 'm.room.message'
|
||||||
? _t('Share Permalink') : _t('Share Message') }
|
? _t('Share Permalink') : _t('Share Message') }
|
||||||
|
@ -445,7 +445,7 @@ export default createReactClass({
|
||||||
element="a"
|
element="a"
|
||||||
className="mx_MessageContextMenu_field"
|
className="mx_MessageContextMenu_field"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noreferrer noopener"
|
||||||
onClick={this.closeMenu}
|
onClick={this.closeMenu}
|
||||||
href={mxEvent.event.content.external_url}
|
href={mxEvent.event.content.external_url}
|
||||||
>
|
>
|
||||||
|
|
|
@ -68,10 +68,11 @@ export default class TopLeftMenu extends React.Component {
|
||||||
{_t(
|
{_t(
|
||||||
"<a>Upgrade</a> to your own domain", {},
|
"<a>Upgrade</a> to your own domain", {},
|
||||||
{
|
{
|
||||||
a: sub => <a href={hostingSignupLink} target="_blank" rel="noopener" tabIndex={-1}>{sub}</a>,
|
a: sub =>
|
||||||
|
<a href={hostingSignupLink} target="_blank" rel="noreferrer noopener" tabIndex={-1}>{sub}</a>,
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
<a href={hostingSignupLink} target="_blank" rel="noopener" role="presentation" aria-hidden={true} tabIndex={-1}>
|
<a href={hostingSignupLink} target="_blank" rel="noreferrer noopener" role="presentation" aria-hidden={true} tabIndex={-1}>
|
||||||
<img src={require("../../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
<img src={require("../../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
||||||
</a>
|
</a>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default class ChangelogDialog extends React.Component {
|
||||||
_elementsForCommit(commit) {
|
_elementsForCommit(commit) {
|
||||||
return (
|
return (
|
||||||
<li key={commit.sha} className="mx_ChangelogDialog_li">
|
<li key={commit.sha} className="mx_ChangelogDialog_li">
|
||||||
<a href={commit.html_url} target="_blank" rel="noopener">
|
<a href={commit.html_url} target="_blank" rel="noreferrer noopener">
|
||||||
{commit.commit.message.split('\n')[0]}
|
{commit.commit.message.split('\n')[0]}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1046,7 +1046,7 @@ export default class InviteDialog extends React.PureComponent {
|
||||||
"If you can't find someone, ask them for their username, share your " +
|
"If you can't find someone, ask them for their username, share your " +
|
||||||
"username (%(userId)s) or <a>profile link</a>.",
|
"username (%(userId)s) or <a>profile link</a>.",
|
||||||
{userId},
|
{userId},
|
||||||
{a: (sub) => <a href={makeUserPermalink(userId)} rel="noopener" target="_blank">{sub}</a>},
|
{a: (sub) => <a href={makeUserPermalink(userId)} rel="noreferrer noopener" target="_blank">{sub}</a>},
|
||||||
);
|
);
|
||||||
buttonText = _t("Go");
|
buttonText = _t("Go");
|
||||||
goButtonFn = this._startDm;
|
goButtonFn = this._startDm;
|
||||||
|
@ -1055,7 +1055,10 @@ export default class InviteDialog extends React.PureComponent {
|
||||||
helpText = _t(
|
helpText = _t(
|
||||||
"If you can't find someone, ask them for their username (e.g. @user:server.com) or " +
|
"If you can't find someone, ask them for their username (e.g. @user:server.com) or " +
|
||||||
"<a>share this room</a>.", {},
|
"<a>share this room</a>.", {},
|
||||||
{a: (sub) => <a href={makeRoomPermalink(this.props.roomId)} rel="noopener" target="_blank">{sub}</a>},
|
{
|
||||||
|
a: (sub) =>
|
||||||
|
<a href={makeRoomPermalink(this.props.roomId)} rel="noreferrer noopener" target="_blank">{sub}</a>,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
buttonText = _t("Invite");
|
buttonText = _t("Invite");
|
||||||
goButtonFn = this._inviteUsers;
|
goButtonFn = this._inviteUsers;
|
||||||
|
|
|
@ -218,7 +218,7 @@ export default class ShareDialog extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_ShareDialog_social_container">
|
<div className="mx_ShareDialog_social_container">
|
||||||
{
|
{
|
||||||
socials.map((social) => <a rel="noopener"
|
socials.map((social) => <a rel="noreferrer noopener"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
key={social.name}
|
key={social.name}
|
||||||
name={social.name}
|
name={social.name}
|
||||||
|
|
|
@ -135,7 +135,7 @@ export default class TermsDialog extends React.PureComponent {
|
||||||
rows.push(<tr key={termDoc[termsLang].url}>
|
rows.push(<tr key={termDoc[termsLang].url}>
|
||||||
<td className="mx_TermsDialog_service">{serviceName}</td>
|
<td className="mx_TermsDialog_service">{serviceName}</td>
|
||||||
<td className="mx_TermsDialog_summary">{summary}</td>
|
<td className="mx_TermsDialog_summary">{summary}</td>
|
||||||
<td>{termDoc[termsLang].name} <a rel="noopener" target="_blank" href={termDoc[termsLang].url}>
|
<td>{termDoc[termsLang].name} <a rel="noreferrer noopener" target="_blank" href={termDoc[termsLang].url}>
|
||||||
<span className="mx_TermsDialog_link" />
|
<span className="mx_TermsDialog_link" />
|
||||||
</a></td>
|
</a></td>
|
||||||
<td><TermsCheckbox
|
<td><TermsCheckbox
|
||||||
|
|
|
@ -552,7 +552,7 @@ export default class AppTile extends React.Component {
|
||||||
// Using Object.assign workaround as the following opens in a new window instead of a new tab.
|
// Using Object.assign workaround as the following opens in a new window instead of a new tab.
|
||||||
// window.open(this._getSafeUrl(), '_blank', 'noopener=yes');
|
// window.open(this._getSafeUrl(), '_blank', 'noopener=yes');
|
||||||
Object.assign(document.createElement('a'),
|
Object.assign(document.createElement('a'),
|
||||||
{ target: '_blank', href: this._getSafeUrl(), rel: 'noopener'}).click();
|
{ target: '_blank', href: this._getSafeUrl(), rel: 'noreferrer noopener'}).click();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onReloadWidgetClick() {
|
_onReloadWidgetClick() {
|
||||||
|
|
|
@ -91,7 +91,7 @@ export default class ImageView extends React.Component {
|
||||||
getName() {
|
getName() {
|
||||||
let name = this.props.name;
|
let name = this.props.name;
|
||||||
if (name && this.props.link) {
|
if (name && this.props.link) {
|
||||||
name = <a href={ this.props.link } target="_blank" rel="noopener">{ name }</a>;
|
name = <a href={ this.props.link } target="_blank" rel="noreferrer noopener">{ name }</a>;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ export default class ImageView extends React.Component {
|
||||||
{ this.getName() }
|
{ this.getName() }
|
||||||
</div>
|
</div>
|
||||||
{ eventMeta }
|
{ eventMeta }
|
||||||
<a className="mx_ImageView_link" href={ this.props.src } download={ this.props.name } target="_blank" rel="noopener">
|
<a className="mx_ImageView_link" href={ this.props.src } download={ this.props.name } rel="noreferrer noopener">
|
||||||
<div className="mx_ImageView_download">
|
<div className="mx_ImageView_download">
|
||||||
{ _t('Download this file') }<br />
|
{ _t('Download this file') }<br />
|
||||||
<span className="mx_ImageView_size">{ sizeRes }</span>
|
<span className="mx_ImageView_size">{ sizeRes }</span>
|
||||||
|
|
|
@ -297,7 +297,7 @@ export default createReactClass({
|
||||||
} else if (contentUrl) {
|
} else if (contentUrl) {
|
||||||
const downloadProps = {
|
const downloadProps = {
|
||||||
target: "_blank",
|
target: "_blank",
|
||||||
rel: "noopener",
|
rel: "noreferrer noopener",
|
||||||
|
|
||||||
// We set the href regardless of whether or not we intercept the download
|
// We set the href regardless of whether or not we intercept the download
|
||||||
// because we don't really want to convert the file to a blob eagerly, and
|
// because we don't really want to convert the file to a blob eagerly, and
|
||||||
|
|
|
@ -374,7 +374,9 @@ export default createReactClass({
|
||||||
const height = window.screen.height > 800 ? 800 : window.screen.height;
|
const height = window.screen.height > 800 ? 800 : window.screen.height;
|
||||||
const left = (window.screen.width - width) / 2;
|
const left = (window.screen.width - width) / 2;
|
||||||
const top = (window.screen.height - height) / 2;
|
const top = (window.screen.height - height) / 2;
|
||||||
window.open(completeUrl, '_blank', `height=${height}, width=${width}, top=${top}, left=${left},`);
|
const features = `height=${height}, width=${width}, top=${top}, left=${left},`;
|
||||||
|
const wnd = window.open(completeUrl, '_blank', features);
|
||||||
|
wnd.opener = null;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -219,7 +219,7 @@ export default createReactClass({
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
span = (
|
span = (
|
||||||
<a href={link} target="_blank" rel="noopener">
|
<a href={link} target="_blank" rel="noreferrer noopener">
|
||||||
{ span }
|
{ span }
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
|
|
@ -136,7 +136,7 @@ export default createReactClass({
|
||||||
<div className="mx_LinkPreviewWidget" >
|
<div className="mx_LinkPreviewWidget" >
|
||||||
{ img }
|
{ img }
|
||||||
<div className="mx_LinkPreviewWidget_caption">
|
<div className="mx_LinkPreviewWidget_caption">
|
||||||
<div className="mx_LinkPreviewWidget_title"><a href={this.props.link} target="_blank" rel="noopener">{ p["og:title"] }</a></div>
|
<div className="mx_LinkPreviewWidget_title"><a href={this.props.link} target="_blank" rel="noreferrer noopener">{ p["og:title"] }</a></div>
|
||||||
<div className="mx_LinkPreviewWidget_siteName">{ p["og:site_name"] ? (" - " + p["og:site_name"]) : null }</div>
|
<div className="mx_LinkPreviewWidget_siteName">{ p["og:site_name"] ? (" - " + p["og:site_name"]) : null }</div>
|
||||||
<div className="mx_LinkPreviewWidget_description" ref={this._description}>
|
<div className="mx_LinkPreviewWidget_description" ref={this._description}>
|
||||||
{ description }
|
{ description }
|
||||||
|
|
|
@ -509,7 +509,7 @@ export default createReactClass({
|
||||||
"<issueLink>submit a bug report</issueLink>.",
|
"<issueLink>submit a bug report</issueLink>.",
|
||||||
{ errcode: this.props.error.errcode },
|
{ errcode: this.props.error.errcode },
|
||||||
{ issueLink: label => <a href="https://github.com/vector-im/riot-web/issues/new/choose"
|
{ issueLink: label => <a href="https://github.com/vector-im/riot-web/issues/new/choose"
|
||||||
target="_blank" rel="noopener">{ label }</a> },
|
target="_blank" rel="noreferrer noopener">{ label }</a> },
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -119,7 +119,7 @@ export default createReactClass({
|
||||||
'In future this will be improved.',
|
'In future this will be improved.',
|
||||||
) }
|
) }
|
||||||
{' '}
|
{' '}
|
||||||
<a href="https://github.com/vector-im/riot-web/issues/2671" target="_blank" rel="noopener">
|
<a href="https://github.com/vector-im/riot-web/issues/2671" target="_blank" rel="noreferrer noopener">
|
||||||
https://github.com/vector-im/riot-web/issues/2671
|
https://github.com/vector-im/riot-web/issues/2671
|
||||||
</a>
|
</a>
|
||||||
</div>,
|
</div>,
|
||||||
|
|
|
@ -172,7 +172,7 @@ export default class EventIndexPanel extends React.Component {
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
'nativeLink': (sub) => <a href={nativeLink} target="_blank"
|
'nativeLink': (sub) => <a href={nativeLink} target="_blank"
|
||||||
rel="noopener">{sub}</a>,
|
rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ export default class EventIndexPanel extends React.Component {
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
'riotLink': (sub) => <a href="https://riot.im/download/desktop"
|
'riotLink': (sub) => <a href="https://riot.im/download/desktop"
|
||||||
target="_blank" rel="noopener">{sub}</a>,
|
target="_blank" rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,10 +132,10 @@ export default class ProfileSettings extends React.Component {
|
||||||
{_t(
|
{_t(
|
||||||
"<a>Upgrade</a> to your own domain", {},
|
"<a>Upgrade</a> to your own domain", {},
|
||||||
{
|
{
|
||||||
a: sub => <a href={hostingSignupLink} target="_blank" rel="noopener">{sub}</a>,
|
a: sub => <a href={hostingSignupLink} target="_blank" rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
<a href={hostingSignupLink} target="_blank" rel="noopener">
|
<a href={hostingSignupLink} target="_blank" rel="noreferrer noopener">
|
||||||
<img src={require("../../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
<img src={require("../../../../res/img/external-link.svg")} width="11" height="10" alt='' />
|
||||||
</a>
|
</a>
|
||||||
</span>;
|
</span>;
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default class BridgeSettingsTab extends React.Component {
|
||||||
{
|
{
|
||||||
// TODO: We don't have this link yet: this will prevent the translators
|
// TODO: We don't have this link yet: this will prevent the translators
|
||||||
// having to re-translate the string when we do.
|
// having to re-translate the string when we do.
|
||||||
a: sub => <a href={BRIDGES_LINK} target="_blank" rel="noopener">{sub}</a>,
|
a: sub => <a href={BRIDGES_LINK} target="_blank" rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)}</p>
|
)}</p>
|
||||||
<ul className="mx_RoomSettingsDialog_BridgeList">
|
<ul className="mx_RoomSettingsDialog_BridgeList">
|
||||||
|
@ -82,7 +82,7 @@ export default class BridgeSettingsTab extends React.Component {
|
||||||
{
|
{
|
||||||
// TODO: We don't have this link yet: this will prevent the translators
|
// TODO: We don't have this link yet: this will prevent the translators
|
||||||
// having to re-translate the string when we do.
|
// having to re-translate the string when we do.
|
||||||
a: sub => <a href={BRIDGES_LINK} target="_blank" rel="noopener">{sub}</a>,
|
a: sub => <a href={BRIDGES_LINK} target="_blank" rel="noreferrer noopener">{sub}</a>,
|
||||||
},
|
},
|
||||||
)}</p>;
|
)}</p>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ export default class SecurityRoomSettingsTab extends React.Component {
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
'a': (sub) => {
|
'a': (sub) => {
|
||||||
return <a rel='noopener' target='_blank'
|
return <a rel='noreferrer noopener' target='_blank'
|
||||||
href='https://about.riot.im/help#end-to-end-encryption'>{sub}</a>;
|
href='https://about.riot.im/help#end-to-end-encryption'>{sub}</a>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@ const ghVersionLabel = function(repo, token='') {
|
||||||
} else {
|
} else {
|
||||||
url = `https://github.com/${repo}/commit/${token.split('-')[0]}`;
|
url = `https://github.com/${repo}/commit/${token.split('-')[0]}`;
|
||||||
}
|
}
|
||||||
return <a target="_blank" rel="noopener" href={url}>{ token }</a>;
|
return <a target="_blank" rel="noreferrer noopener" href={url}>{ token }</a>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class HelpUserSettingsTab extends React.Component {
|
export default class HelpUserSettingsTab extends React.Component {
|
||||||
|
@ -110,7 +110,7 @@ export default class HelpUserSettingsTab extends React.Component {
|
||||||
const legalLinks = [];
|
const legalLinks = [];
|
||||||
for (const tocEntry of SdkConfig.get().terms_and_conditions_links) {
|
for (const tocEntry of SdkConfig.get().terms_and_conditions_links) {
|
||||||
legalLinks.push(<div key={tocEntry.url}>
|
legalLinks.push(<div key={tocEntry.url}>
|
||||||
<a href={tocEntry.url} rel="noopener" target="_blank">{tocEntry.text}</a>
|
<a href={tocEntry.url} rel="noreferrer noopener" target="_blank">{tocEntry.text}</a>
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,27 +132,27 @@ export default class HelpUserSettingsTab extends React.Component {
|
||||||
<span className='mx_SettingsTab_subheading'>{_t("Credits")}</span>
|
<span className='mx_SettingsTab_subheading'>{_t("Credits")}</span>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
The <a href="themes/riot/img/backgrounds/valley.jpg" rel="noopener" target="_blank">
|
The <a href="themes/riot/img/backgrounds/valley.jpg" rel="noreferrer noopener" target="_blank">
|
||||||
default cover photo</a> is ©
|
default cover photo</a> is ©
|
||||||
<a href="https://www.flickr.com/golan" rel="noopener" target="_blank">Jesús Roncero</a>{' '}
|
<a href="https://www.flickr.com/golan" rel="noreferrer noopener" target="_blank">Jesús Roncero</a>{' '}
|
||||||
used under the terms of
|
used under the terms of
|
||||||
<a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="noopener" target="_blank">
|
<a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="noreferrer noopener" target="_blank">
|
||||||
CC-BY-SA 4.0</a>.
|
CC-BY-SA 4.0</a>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
The <a href="https://github.com/matrix-org/twemoji-colr" rel="noopener" target="_blank">
|
The <a href="https://github.com/matrix-org/twemoji-colr" rel="noreferrer noopener"
|
||||||
twemoji-colr</a> font is ©
|
target="_blank"> twemoji-colr</a> font is ©
|
||||||
<a href="https://mozilla.org" rel="noopener" target="_blank">Mozilla Foundation</a>{' '}
|
<a href="https://mozilla.org" rel="noreferrer noopener" target="_blank">Mozilla Foundation</a>{' '}
|
||||||
used under the terms of
|
used under the terms of
|
||||||
<a href="http://www.apache.org/licenses/LICENSE-2.0" rel="noopener" target="_blank">
|
<a href="http://www.apache.org/licenses/LICENSE-2.0" rel="noreferrer noopener" target="_blank">
|
||||||
Apache 2.0</a>.
|
Apache 2.0</a>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
The <a href="https://twemoji.twitter.com/" rel="noopener" target="_blank">
|
The <a href="https://twemoji.twitter.com/" rel="noreferrer noopener" target="_blank">
|
||||||
Twemoji</a> emoji art is ©
|
Twemoji</a> emoji art is ©
|
||||||
<a href="https://twemoji.twitter.com/" rel="noopener" target="_blank">Twitter, Inc and other
|
<a href="https://twemoji.twitter.com/" rel="noreferrer noopener" target="_blank">Twitter, Inc and other
|
||||||
contributors</a> used under the terms of
|
contributors</a> used under the terms of
|
||||||
<a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener" target="_blank">
|
<a href="https://creativecommons.org/licenses/by/4.0/" rel="noreferrer noopener" target="_blank">
|
||||||
CC-BY 4.0</a>.
|
CC-BY 4.0</a>.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -162,7 +162,8 @@ export default class HelpUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let faqText = _t('For help with using Riot, click <a>here</a>.', {}, {
|
let faqText = _t('For help with using Riot, click <a>here</a>.', {}, {
|
||||||
'a': (sub) => <a href="https://about.riot.im/need-help/" rel='noopener' target='_blank'>{sub}</a>,
|
'a': (sub) =>
|
||||||
|
<a href="https://about.riot.im/need-help/" rel='noreferrer noopener' target='_blank'>{sub}</a>,
|
||||||
});
|
});
|
||||||
if (SdkConfig.get().welcomeUserId && getCurrentLanguage().startsWith('en')) {
|
if (SdkConfig.get().welcomeUserId && getCurrentLanguage().startsWith('en')) {
|
||||||
faqText = (
|
faqText = (
|
||||||
|
@ -170,7 +171,7 @@ export default class HelpUserSettingsTab extends React.Component {
|
||||||
{
|
{
|
||||||
_t('For help with using Riot, click <a>here</a> or start a chat with our ' +
|
_t('For help with using Riot, click <a>here</a> or start a chat with our ' +
|
||||||
'bot using the button below.', {}, {
|
'bot using the button below.', {}, {
|
||||||
'a': (sub) => <a href="https://about.riot.im/need-help/" rel='noopener'
|
'a': (sub) => <a href="https://about.riot.im/need-help/" rel='noreferrer noopener'
|
||||||
target='_blank'>{sub}</a>,
|
target='_blank'>{sub}</a>,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default class LabsUserSettingsTab extends React.Component {
|
||||||
'<a>Learn more</a>.', {}, {
|
'<a>Learn more</a>.', {}, {
|
||||||
'a': (sub) => {
|
'a': (sub) => {
|
||||||
return <a href="https://github.com/vector-im/riot-web/blob/develop/docs/labs.md"
|
return <a href="https://github.com/vector-im/riot-web/blob/develop/docs/labs.md"
|
||||||
rel='noopener' target='_blank'>{sub}</a>;
|
rel='noreferrer noopener' target='_blank'>{sub}</a>;
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default class InlineTermsAgreement extends React.Component {
|
||||||
"Accept <policyLink /> to continue:", {}, {
|
"Accept <policyLink /> to continue:", {}, {
|
||||||
policyLink: () => {
|
policyLink: () => {
|
||||||
return (
|
return (
|
||||||
<a href={policy.url} rel='noopener' target='_blank'>
|
<a href={policy.url} rel='noreferrer noopener' target='_blank'>
|
||||||
{policy.name}
|
{policy.name}
|
||||||
<span className='mx_InlineTermsAgreement_link' />
|
<span className='mx_InlineTermsAgreement_link' />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -227,7 +227,7 @@ matrixLinkify.options = {
|
||||||
},
|
},
|
||||||
|
|
||||||
linkAttributes: {
|
linkAttributes: {
|
||||||
rel: 'noopener',
|
rel: 'noreferrer noopener',
|
||||||
},
|
},
|
||||||
|
|
||||||
target: function(href, type) {
|
target: function(href, type) {
|
||||||
|
|
|
@ -15,8 +15,7 @@ function remoteRender(event) {
|
||||||
|
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
a.id = "a";
|
a.id = "a";
|
||||||
a.rel = "noopener";
|
a.rel = "noreferrer noopener";
|
||||||
a.target = "_blank";
|
|
||||||
a.download = data.download;
|
a.download = data.download;
|
||||||
a.style = data.style;
|
a.style = data.style;
|
||||||
a.style.fontFamily = "Arial, Helvetica, Sans-Serif";
|
a.style.fontFamily = "Arial, Helvetica, Sans-Serif";
|
||||||
|
|
|
@ -78,7 +78,7 @@ export default class AutoDiscoveryUtils {
|
||||||
return <a
|
return <a
|
||||||
href="https://github.com/vector-im/riot-web/blob/master/docs/config.md"
|
href="https://github.com/vector-im/riot-web/blob/master/docs/config.md"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noreferrer noopener"
|
||||||
>{sub}</a>;
|
>{sub}</a>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -36,7 +36,7 @@ export function messageForResourceLimitError(limitType, adminContact, strings, e
|
||||||
|
|
||||||
const linkSub = sub => {
|
const linkSub = sub => {
|
||||||
if (adminContact) {
|
if (adminContact) {
|
||||||
return <a href={adminContact} target="_blank" rel="noopener">{sub}</a>;
|
return <a href={adminContact} target="_blank" rel="noreferrer noopener">{sub}</a>;
|
||||||
} else {
|
} else {
|
||||||
return sub;
|
return sub;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ describe("<TextualBody />", () => {
|
||||||
expect(wrapper.text()).toBe(ev.getContent().body);
|
expect(wrapper.text()).toBe(ev.getContent().body);
|
||||||
const content = wrapper.find(".mx_EventTile_body");
|
const content = wrapper.find(".mx_EventTile_body");
|
||||||
expect(content.html()).toBe('<span class="mx_EventTile_body" dir="auto">' +
|
expect(content.html()).toBe('<span class="mx_EventTile_body" dir="auto">' +
|
||||||
'Visit <a href="https://matrix.org/" class="linkified" target="_blank" rel="noopener">' +
|
'Visit <a href="https://matrix.org/" class="linkified" target="_blank" rel="noreferrer noopener">' +
|
||||||
'https://matrix.org/</a></span>');
|
'https://matrix.org/</a></span>');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue