Skip to content

Commit 15c730a

Browse files
committed
Add rel="noopener" to context menu links.
1 parent cf33ed5 commit 15c730a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/components/views/context_menus/MessageContextMenu.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = React.createClass({
7474
if (this.props.onFinished) this.props.onFinished();
7575
},
7676

77-
onLinkClick: function() {
77+
closeMenu: function() {
7878
if (this.props.onFinished) this.props.onFinished();
7979
},
8080

@@ -147,7 +147,7 @@ module.exports = React.createClass({
147147
permalinkButton = (
148148
<div className="mx_MessageContextMenu_field">
149149
<a href={ "https://matrix.to/#/" + this.props.mxEvent.getRoomId() +"/"+ this.props.mxEvent.getId() }
150-
target="_blank" onClick={ this.onLinkClick }>Permalink</a>
150+
target="_blank" rel="noopener" onClick={ this.closeMenu }>Permalink</a>
151151
</div>
152152
);
153153

@@ -161,8 +161,8 @@ module.exports = React.createClass({
161161
if( typeof(this.props.mxEvent.event.content.external_url) === "string") {
162162
externalURLButton = (
163163
<div className="mx_MessageContextMenu_field">
164-
<a target="_blank" href={ this.props.mxEvent.event.content.external_url }
165-
onClick={ this.onLinkClick }>Source URL</a>
164+
<a href={ this.props.mxEvent.event.content.external_url }
165+
rel="noopener" target="_blank" onClick={ this.closeMenu }>Source URL</a>
166166
</div>
167167
);
168168
}

0 commit comments

Comments
 (0)