Merge pull request #16940 from BoykoAlex/atom-links

Support `atom` protocol links when links are handled
This commit is contained in:
David Wilson
2018-09-06 07:32:49 -07:00
committed by GitHub
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)
}
}
}