Stacks.js: redirectUserToSignIn doesn't work on Safari

Created on 8 May 2017  路  8Comments  路  Source: blockstack/stacks.js

redirectUserToSignIn in 0.2.22 doesn't do anything on the following browsers:

  • Safari 10.1 on macOS 10.12.4
  • iOS 10.3
bug

Most helpful comment

This is still an issue with all Blockstack apps it would seem.

screen shot 2018-11-14 at 3 31 23 pm

Just try and sign in here https://app.graphitedocs.com on Safari Version 12.0.1 (14606.2.104.1.1)

All 8 comments

Neither callback is gets called in protocolCheck on Safari.

@larrysalibra how do you think we should address this?

custom-protocol-detection provides protocolCheck and there are a number of limitations.

One of which is that it doesn't work on Safari: https://github.com/ismailhabib/custom-protocol-detection/issues/2

I like to think this is to protect privacy of the users so that random websites can't tell which apps you have installed on your iPhone or if you have a bitcoin wallet installed on your mac.

It reportedly doesn't work on Edge either - Edge will always say that the protocol is available and then try to search for something appropriate in the Windows App Store.

I propose:

  • We call protocolCheck when blockstack.js loads and store the result as a property protocolHandlerExists: yes or no. If neither of protocolCheck callbacks return, the value will be unknown.

If protocolHandlerExists is unknown, we fall back to our original solution of trying to use the blockstack: protocol handler and having a timeout that opens the blockstack.org/auth page.

@shea256 thoughts?

We call protocolCheck when blockstack.js loads and store the result as a property protocolHandlerExists: yes or no. If neither of protocolCheck callbacks return, the value will be unknown.

Isn't this what we're already doing? If the protocol handler exists, a redirect is initiated to a URL with the protocol handler. If it doesn't exist, a redirect is initiated to blockstack.org.

Isn't this what we're already doing?
We're calling protocolCheck(uri, failCallback, successCallback):

In my testing on Safari, neither fallCallback nor successCallback are called, nor is the uri opened.

a redirect is initiated to blockstack.org

This only happens if the failCallback is called.

I see. Seems like an error with the library. The callbacks are always supposed to return. Maybe we can edit the library and see what's going on there. The case for Safari should be handled properly.

I fixed this so that it always tries the blockstack: handler in safari.

This is still an issue with all Blockstack apps it would seem.

screen shot 2018-11-14 at 3 31 23 pm

Just try and sign in here https://app.graphitedocs.com on Safari Version 12.0.1 (14606.2.104.1.1)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

muneebm picture muneebm  路  5Comments

timstackblock picture timstackblock  路  6Comments

yknl picture yknl  路  5Comments

friedger picture friedger  路  9Comments

zone117x picture zone117x  路  6Comments