To detect if a user has already installed Phantom, a web application should check for the existence of a phantom object.
phantom
object into the window of any web application the user visits, provided that site is using https://
, on localhost
, or is 127.0.0.1.
Phantom will not inject the provider into iframes or sites using http://
.
If a phantom
object exists, Bitcoin and Ordinals dapps can interact with Phantom via the API found at window.phantom.bitcoin
. To detect if Phantom is installed, an application should check for an additional isPhantom
flag like so:
https://phantom.com/
. Altogether, this may look like the following: