protocol: cleanup

This commit is contained in:
Robo 2015-07-05 23:23:07 +05:30
parent d661099322
commit da00329d78
6 changed files with 138 additions and 74 deletions

View file

@ -28,7 +28,7 @@ was emitted.
* `handler` Function
Registers a custom protocol of `scheme`, the `handler` would be called with
`handler(request)` when the a request with registered `scheme` is made.
`handler(error, request)` when the a request with registered `scheme` is made.
You need to return a request job in the `handler` to specify which type of
response you would like to send.
@ -45,11 +45,12 @@ Unregisters the custom protocol of `scheme`.
`value` is an array of custom schemes to be registered to the standard.
## protocol.isHandledProtocol(scheme)
## protocol.isHandledProtocol(scheme, callback)
* `scheme` String
* `callback` Function
Returns whether the `scheme` can be handled already.
`callback` returns a boolean whether the `scheme` can be handled already.
## protocol.interceptProtocol(scheme, handler)