Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Implement navigator.registerProtocolHandler #1583

Closed
mrose17 opened this issue May 5, 2016 · 7 comments
Closed

Implement navigator.registerProtocolHandler #1583

mrose17 opened this issue May 5, 2016 · 7 comments
Assignees
Labels

Comments

@mrose17
Copy link
Member

mrose17 commented May 5, 2016

cf., https://html.spec.whatwg.org/multipage/webappapis.html#dom-navigator-registerprotocolhandler

needed for things like the Bitcoin URI

thanks!

/mtr

@diracdeltas
Copy link
Member

could you explain in more detail what is needed? are you saying that any site should be able to register itself as a bitcoin handler, or just whitelisted sites, or just the background page context?

window.navigator.registerProtocolHandler is implemented already but presumably only works for same-origin registrations. i am against allowing it in general for security reasons.

@mrose17
Copy link
Member Author

mrose17 commented May 5, 2016

thanks. i don't think it works in the browset at the moment...

if you go to one of the bitcoin sites, and click on the button to setup the site to handle bitcoin payments, e.g., https://www.coinbase.com/settings/preferences (for coinbase) folks, then it's a no-op on the brave browser.

if i do the same thing in either chrome or firefox, i get a dialog asking for permission and if i click accept, then the protocol handler is registered with that browser.

with the brave browser, i don't get either the dialog nor does is the handler registered...

@diracdeltas
Copy link
Member

The dialog is a chrome-specific feature, so not surprising that it doesn't appear. window.navigator.registerProtocolHandler('bitcoin', 'https://www.coinbase.com/handler?u=%s', 'coinbase') in Brave doesn't throw any errors but it also doesn't seem to work. seems like an electron bug.

@diracdeltas diracdeltas changed the title implement registerProtocolHandler navigator.registerProtocolHandler doesn't do anything May 5, 2016
@mrose17
Copy link
Member Author

mrose17 commented May 6, 2016

i believe that chrome, firefox, and opera all support it... otherwise, i agree that it does seem like an electron issue... either that, or we aren't hooking into electron properly in terms of a callback/option enabling the feature.

@aekeus
Copy link
Member

aekeus commented Jun 13, 2016

@diracdeltas can we confirm this is an Electron issue?

@bbondy bbondy added this to the Ledger alpha 7 milestone Jul 8, 2016
@bbondy bbondy self-assigned this Jul 8, 2016
@bbondy
Copy link
Member

bbondy commented Jul 8, 2016

I have this working but need it to persist on session restart and need to test with packaged builds and work out some other corner cases.

Attached backup WIP electron patch.

out.patch.zip

@bbondy
Copy link
Member

bbondy commented Jul 10, 2016

Implemented here:
5d6584e
brave/muon@7d126de

Still need to fix a crash with command+click and shift+click though. Otherwise good to go.
Settings persist and register with OS as default as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants