Skip to content

Instantly share code, notes, and snippets.

@christian-fei
Last active October 23, 2016 18:28
Show Gist options
  • Save christian-fei/aacdd9a98118b2092233a572e9461743 to your computer and use it in GitHub Desktop.
Save christian-fei/aacdd9a98118b2092233a572e9461743 to your computer and use it in GitHub Desktop.
'use strict';
const isExternalLink = (url) => {
const isInternalLink = /^https:\/\/pomodoro\.cc/.test(url) && url !== 'https://pomodoro.cc/docs';
return !isInternalLink;
}
const openUrlInExternalWindow = (event, url) => {
if (isExternalLink(url)) {
return false;
}
event.preventDefault();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment