Open lemanschik opened 6 months ago
@ayushmanchhabra thats correct that looks at last ok in the 5 min that i reviewed it but i am not sure if it Handels all supported Platforms eg: MacOS, Windows and so on but general ya you got the right idea.
But you did not fully read and understand the issue there are diffrent types of protocol handlers
and the most importent type is not integrate able client side in js. the BiDirectional HTTP Like stream thats why i choosed the Issue text from brave to make that clear.
Issue Type
Before opening an issue, please search and see if it has already been raised.
[ ] Bug Report
[x] Feature Request
[x] Successfully reproduced against the latest version of NW.js?
Current/Missing Behavior
Electron like custom url handler registration
Expected/Proposed Behavior
Lets add the patches from brave to implement custom url handling fast.
We currently have 3 different types of protocol handlers in Brave:
External protocol handler used for handling magnet URLs External protocol handlers used for oauth flows (cryptocurrency exchanges at the time of writing) brave:// being an alias for chrome:// Below is a description of changes and patching we've had to do for schemes:
AddAdditionalSchemes is only used for adding brave:// to the same list of URLs as chrome://. Example
GrantRequestScheme - Allows a webui to access it so no reason for that. Example
RegisterURLSchemeAsNotAllowingJavascriptURLs - Registers an URL scheme to not allow manipulation of the loaded page by bookmarklets or javascript: URLs typed in the omnibox. Example
RegisterURLSchemeAsDisplayIsolated - Registers a URL scheme to be treated as display-isolated. This means that pages cannot display these URLs unless they are from the same scheme. For example, pages in another origin cannot create iframes or hyperlinks to URLs with the scheme. Example
CanAddURLToHistory - Prevents a URL from being added to history, note that redirects do not appear in history. So this is probably not needed for oauth related schemes. Example
IsHandledProtocol - Needed for protocol handlers, but not needed for external protocol handlers. Example
ExtensionTabUtil::IsKillURL - This is only needed because brave:// is an alias for chrome:// and an explicit check is made. Example
taken from: https://github.com/brave/brave-browser/wiki/Adding-a-protocol-scheme-to-Brave
Additional Info
Closes