omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    URL scheme is not working

    Pythonista
    url scheme
    3
    7
    5053
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Richard
      Richard last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

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

        Works as expected for me.

        Richard 1 Reply Last reply Reply Quote 0
        • Richard
          Richard @ccc last edited by

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

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by 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 1 Reply Last reply Reply Quote 0
            • Richard
              Richard @ccc last edited by 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.

              1 Reply Last reply Reply Quote 0
              • omz
                omz last edited by

                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 1 Reply Last reply Reply Quote 0
                • Richard
                  Richard @omz last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors