docs: move protocol-ns to protocol.md (#23883)

* docs: move protocol-ns to protocol.md

* chore: fix up tests and implement missing pieces required for tests
This commit is contained in:
Samuel Attard 2020-06-02 09:46:18 -07:00 committed by GitHub
parent edc5050a2e
commit d3fa5ed1e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 285 additions and 733 deletions

View file

@ -897,13 +897,9 @@ app.whenReady().then(() => {
callback({ url: request.url, method: request.method })
})
protocol.unregisterProtocol('atom', (error) => {
console.log(error ? error.message : 'ok')
})
protocol.unregisterProtocol('atom')
protocol.isProtocolHandled('atom').then(handled => {
console.log(handled)
})
const registered: boolean = protocol.isProtocolRegistered('atom')
})
// tray
@ -1195,10 +1191,6 @@ app.whenReady().then(function () {
protocol.registerFileProtocol('atom', function (request, callback) {
const url = request.url.substr(7)
callback(path.normalize(__dirname + '/' + url))
}, function (error) {
if (error) {
console.error('Failed to register protocol')
}
})
})