Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Geremia on April 25, 2013, 05:01:47 PM



Title: Bitcoin custom URI integration with bitcoin-qt
Post by: Geremia on April 25, 2013, 05:01:47 PM
BIP 0021 (https://en.bitcoin.it/wiki/BIP_0021) introduced the Bitcoin URI scheme:
Code:
bitcoin:<address>[?amount=<amount>][?label=<label>][?message=<message>]
How do I integrate this into, e.g., the Firefox browser or KDE so they will open bitcoin-qt, as this (https://en.bitcoin.it/wiki/BIP_0021#Bitcoin_clients) says is possible?

thank you


Title: Spesmilo
Post by: Geremia on April 25, 2013, 10:03:34 PM
From the URI Scheme Bitcoin wiki page (https://en.bitcoin.it/wiki/URI_Scheme), I found this: Spesmilo (https://en.bitcoin.it/wiki/Spesmilo), which "supports all valid Bitcoin URIs, with Windows and KDE integration." But, then again, so does bitcoin-qt…


Title: custom URI scheme in KDE
Post by: Geremia on April 25, 2013, 11:20:48 PM
Here (http://superuser.com/questions/91611/picasa-links-in-google-chrome-linux/93419#93419)'s how to setup custom URI scheme (https://en.wikipedia.org/wiki/URI_scheme) in KDE, which can be modified for the Bitcoin scheme.

Here's what I have in my ~/.kde/share/kde4/services :
Code:
[Protocol]
exec=/usr/local/bin/bitcoin-qt "%u"
protocol=bitcoin
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false
, where "/usr/local/bin/bitcoin-qt" is your path to bitcoin-qt. This enables, e.g., Konquerer browser to open "bitcoin:<address>" links. I'm sure you could get Firefox linked up, too.


Title: Firefox, Chcrome bitcoin-qt custom URI integration
Post by: Geremia on April 26, 2013, 01:28:39 AM
Here's what to do for Firefox (source: http://electrum.org/bitcoin_URIs.html ):
Quote
Firefox (version 3.5 and above)
  • Visit about:config
  • Create a new boolean (mouse right click -&gt; new -&gt; boolean)
  • Enter this name: network.protocol-handler.expose.bitcoin
  • Select the value: false
  • Next time you click on a Bitcoin URI, a dialog will ask you to enter the path of your Bitcoin client. Make sure it is executable

Chrome:
To configure Chrome on Ubuntu 10.04 or maybe later versions to handle bitcoin URIs, do this first on the command-line:
$ gconftool-2 -t string -s /desktop/gnome/url-handlers/bitcoin/command "/path/to/electrum.py %s"
$ gconftool-2 -t bool -s /desktop/gnome/url-handlers/bitcoin/needs_terminal false
$ gconftool-2 -t bool -s /desktop/gnome/url-handlers/bitcoin/enabled true
This tells Gnome what to do with bitcoin URLs, and Chrome picks that up from Gnome.
The site (http://electrum.org/bitcoin_URIs.html) also has many good detailed descriptions of the Bitcoin custom URI protocol.