mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
Add tests for packages with URI handlers
This commit is contained in:
@@ -323,15 +323,15 @@ class Package
|
||||
registerUrlHandler: ->
|
||||
handlerConfig = @getUrlHandler()
|
||||
if methodName = handlerConfig?.method
|
||||
@urlHandlerSubscription = @packageManager.registerUrlHandlerForPackage @name, (url) =>
|
||||
@handleUrl(url, methodName)
|
||||
@urlHandlerSubscription = @packageManager.registerUrlHandlerForPackage @name, (args...) =>
|
||||
@handleUrl(methodName, args)
|
||||
|
||||
unregisterUrlHandler: ->
|
||||
@urlHandlerSubscription?.dispose()
|
||||
|
||||
handleUrl: (url, methodName) ->
|
||||
handleUrl: (methodName, args) ->
|
||||
@activate().then =>
|
||||
@mainModule[methodName]?(url)
|
||||
@mainModule[methodName]?.apply(@mainModule, args)
|
||||
unless @mainActivated
|
||||
@activateNow()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user