Added rel="noopener noreferrer" to external links.

This commit is contained in:
orangemug 2017-10-16 15:01:35 +01:00
parent d502d9b1bb
commit 3f350c30da
2 changed files with 5 additions and 4 deletions

View file

@ -32,7 +32,8 @@ function ToolbarLink(props) {
return <a return <a
className={classnames('maputnik-toolbar-link', props.className)} className={classnames('maputnik-toolbar-link', props.className)}
href={props.href} href={props.href}
target={"blank"} rel="noopener noreferrer"
target={"_blank"}
> >
{props.children} {props.children}
</a> </a>

View file

@ -126,7 +126,7 @@ class Gist extends React.Component {
const user = gist.user || 'anonymous'; const user = gist.user || 'anonymous';
const preview = !!gist.files['index.html']; const preview = !!gist.files['index.html'];
if(preview) { if(preview) {
return <span><a target="_blank" href={"https://bl.ocks.org/"+user+"/"+gist.id}>Preview</a>,{' '}</span> return <span><a target="_blank" rel="noopener noreferrer" href={"https://bl.ocks.org/"+user+"/"+gist.id}>Preview</a>,{' '}</span>
} }
return null; return null;
} }
@ -144,7 +144,7 @@ class Gist extends React.Component {
<p> <p>
Latest saved gist:{' '} Latest saved gist:{' '}
{this.renderPreviewLink(this)} {this.renderPreviewLink(this)}
<a target="_blank" href={"https://gist.github.com/" + user + "/" + gist.id}>Source</a> <a target="_blank" rel="noopener noreferrer" href={"https://gist.github.com/" + user + "/" + gist.id}>Source</a>
</p> </p>
<p> <p>
<CopyToClipboard text={maputnikStyleLink}> <CopyToClipboard text={maputnikStyleLink}>
@ -177,7 +177,7 @@ class Gist extends React.Component {
value={(this.props.mapStyle.metadata || {})['maputnik:openmaptiles_access_token']} value={(this.props.mapStyle.metadata || {})['maputnik:openmaptiles_access_token']}
onChange={this.changeMetadataProperty.bind(this, "maputnik:openmaptiles_access_token")}/> onChange={this.changeMetadataProperty.bind(this, "maputnik:openmaptiles_access_token")}/>
</InputBlock> </InputBlock>
<a target="_blank" href="https://openmaptiles.com/hosting/">Get your free access token</a> <a target="_blank" rel="noopener noreferrer" href="https://openmaptiles.com/hosting/">Get your free access token</a>
</div> </div>
: null} : null}
{this.renderLatestGist()} {this.renderLatestGist()}