Forum Archive

URL scheme is not working

Richard

When I am running below code under IOS 9.2, I can't make quora run:
import webbrowser
webbrowser.open('quora://')

I tried 'quora://' in Launcher, it worked. So the URL should be right.
I remembered long ago(maybe IOS 8.x, not sure) the URL scheme worked.
I'm using Pythonista 1.5 on iPhone 6S.
Will anybody help? Thanks

ccc
import webbrowser
webbrowser.open('quora://')

Works as expected for me.

Richard

@ccc May I have your Pythonista version, IOS version and device type? Thanks

ccc

Pythonista version 1.6 (160037) on iOS 9.2 on an iPad3,4.

generated by https://github.com/cclauss/Ten-lines-or-less/blob/master/pythonista_version.py

Richard

@ccc Thanks. I tried the code on my friend's IOS9.2 IPhone, it also worked.
Tried to uninstall Pythonista and reinstall, with no luck. I even reseted my phone's settings, still with no luck.
Notice there is change on URL scheme on IOS9:Querying URL Schemes With canOpenURL.
With bellow code:

import webbrowser
print webbrowser.can_open('pythonista://')
webbrowser.open('pythonista://')

I got False result to any known URLs. Seems the result matches with that been told in the link.
I remember I used a loop to check 'com.slovoed.api.%d' % i URL some time ago. This may cause False result of webbrowser.can_open(), but it should not cause webbrowser.open() fail.

omz

In version 1.5, webbrowser.open() uses can_open() internally. can_open is "throttled" on iOS 9, so if you previously used it in a loop, it's possible that Pythonista got "blacklisted", and can_open() always returns False – in which case open() also fails. In the next update, can_open() is deprecated, and open() should not be affected by this "blacklisting".

Richard

@omz Thanks for the information. That should be the cause.