Jump to content

Open URL does not open URL without https or www?


Recommended Posts

Posted (edited)

I am passing URL to Open URL and the logs show that, but it does nothing. When I use it to open the URL in chrome, it opens a page with  "about:blank" as its address, with FireFox, it does nothing and the application throws an error saying "cannot open..." or something similar

 

URL1: github.com/deanishe/alfred-sublime-text

URL2: www.github.com/deanishe/alfred-sublime-text

 

Am I missing something here?

 

For now, I added 2 replace utilities and removing https://www or www. But that doesn't seem right to me

 

LOGS

`[16:11:04.139] Google Search[Fallback Search] Passing output 'github.com/deanishe/alfred-sublime-text' to Open URL`

Edited by andy4222
Posted
10 hours ago, andy4222 said:

Am I missing something here?

 

It ain't a URL if it doesn't have a scheme.

 

You can type "www.google.com" into a browser's URL bar because that's specifically designed for entering web addresses and will try lots of things to convert your input into a valid URL (such as adding the scheme HTTPS:// if you don't specify one).

 

But anything that isn't a browser's URL bar (or a browser in general) expects you to provide a valid URL to begin with, which requires a scheme.

Posted

Thanks

 

I wanted it work irrespective of it having a prefixes (http:// or www) or not. I'm just removing all prefixes first (if it has any) and then adding the correct scheme before calling open URL. It works now

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...