Support atom protocol links when links are handled

This commit is contained in:
BoykoAlex
2018-03-12 20:53:38 -04:00
parent e8ee444f71
commit c61b27ba5c
2 changed files with 25 additions and 4 deletions

View File

@@ -242,8 +242,12 @@ class WindowEventHandler {
handleLinkClick (event) {
event.preventDefault()
const uri = event.currentTarget && event.currentTarget.getAttribute('href')
if (uri && (uri[0] !== '#') && /^https?:\/\//.test(uri)) {
this.applicationDelegate.openExternal(uri)
if (uri && uri[0] !== '#') {
if (/^https?:\/\//.test(uri)) {
this.applicationDelegate.openExternal(uri)
} else if (uri.startsWith('atom://')) {
this.atomEnvironment.uriHandlerRegistry.handleURI(uri);
}
}
}