Open gavofyork opened 8 years ago
@tomusdrw do we have an .parity
endpoint to ping to test for proxy?
On it's way: https://github.com/ethcore/parity/pull/1543
@tomusdrw I thought about wrapping Home and Topbar in a component that will manage the state for all this.
we r already using topbar as a 'kinda store', so maybe we'll do #16 first?
This refers to the home screen of Parity (127.0.0.1:8080/home/, home.parity). This ensure that the user does not get told to install any proxy when they could reasonably have our extension(s) look after it.
We need to know a few things:
HAVE_PROXY
: ishome.parity
functional? (i.e. is there a proxy in place somehow?)HAVE_EXT
: is the extension installed?HAVE_CHROME
: are we in the Chrome browser?HAVE_UGLYURL
: are we using a 127.0.0.1:8080 URL?Once in place, the logic is simple:
(!HAVE_PROXY && HAVE_CHROME) || (HAVE_PROXY && !HAVE_EXT && HAVE_CHROME)
=>get-extension
!HAVE_PROXY && !HAVE_CHROME
=>install-proxy
HAVE_PROXY && HAVE_UGLY_URL
=>redirect
The actions based upon the logic are:
get-extension
: A notice is shown "Complete Parity integration is available for the Chrome browser. Click here for more information."; Clicking takes the user directly to the extension install page.install-proxy
: A notice is shown "We do not yet have full integration for your chosen browser, but you can improve your Parity browsing experience by configuring a proxy. Click here for more information." Clicking shows the existing proxy-installation popup.redirect
: The page is redirected tohome.parity
. In all other cases, no notices are shown.