What's the difference between protocol.register*Protocol and protocol.intercept*Protocol?

#1

In the Electron protocol docs, there are method like registerFileProtocol and interceptFileProtocol.

What is the difference between registerFileProtocol and interceptFileProtocol? When would I want to use one over the other?

#2

I haven’t used either of them in practice (except via Atom), but I suspect that you might need to register a protocol before you can intercept it. It shouldn’t be hard to test what happens if you try to intercept a protocol that doesn’t exist or try to register one twice.