Jump to content

Open URL action fails to work with Firefox

Recommended Posts

Simple workflow based on the "Open custom URL in specified browser". Using a keyword, I want to launch Firefox with a custom URL, however if the "URL" field only has {query} as the input, Firefox does not open a tab with the value of {query}.

If Firefox is already running, nothing happens, if it isn't then Firefox starts and presents the default start page.


Changing the selected browser to "Default Browser" generates an OSX error asking to select the application to open the URL.

Changing the selected browser to Safari works as expected.



Firefox 57.0.4 (64-bit)

macOS 10.13.2

Alfred 3.5.1



OSX - No application error-2018-01-17.jpg

Custom URL workflow-2018-01-17.jpg

Custom URL Keyword-2018-01-17.jpg

Custom URL Default Browser-2018-01-17.jpg

Link to comment

The problem is because you need to write the complete URL for your link. I mean, you need to write the scheme of the URL to specify to the system that you are opening a web URL. So, in this case, you would need to write "http://" or "https://" in front of {query} if you don't want to write the full URL in your Workflow keyword node. With this, the OS will look and find which application can open this kind of link and use it.


In short, change your URL field of the Open URL node to " http://{query} ", then you'll be able to open a link like "alfredforum.com" or write the complete URL when you invoke your workflow using your Keyword node ( "http://alfredforum.com" instead of "alfredforum.com" )

Link to comment

I understand your solution, however why does the current format work when using Safari as the selected browser? Is this something something specific to Safari and has nothing to do with the way Alfred passes the information to the different browsers?



Link to comment

Yes, I would say this has more to do on how the application and the OS deal with the received string than how Alfred send it to the application. I mean, to give you some more examples, here are multiple times the same thing where only the "http://" string is added or not to the URL and using only AppleScript:


tell application "Safari" to open location "http://alfredforum.com" -- Works
tell application "Safari" to open location "alfredforum.com"        -- Works

tell application "Firefox" to open location "http://alfredforum.com" -- Works
tell application "Firefox" to open location "alfredforum.com"        -- Doesn't work

tell application "Google Chrome" to open location "http://alfredforum.com" -- Works
tell application "Google Chrome" to open location "alfredforum.com"        -- Doesn't work

-- Using the default web browser
open location "http://alfredforum.com" -- Works
open location "alfredforum.com"        -- Doesn't work

As you can see here, using "http://" always works but not without (it's only working without in Safari when we directly specify the URL to be open with this application as you see it in Alfred). Therefore, I would say the behaviour we are seeing is not related to Alfred, but how the OS and the specific application deal with the URL that is passed to it.


To add more to that, the difference when specifying the application we want to send the link and when using the default application, to use a default application, the OS needs to know the URL scheme to look at which application can open this kind of URL and select the one that is set to be the default. Therefore, if you don't put "http://" then the OS doesn't know if it needs to send the URL to the default web browser, the default file browser (here, the scheme would be "file://" instead of "http://") or any other kind of application that accepts URL (example: any applications that implement x-callback or the like). In the case of Safari that open the link even if there's no "http://" in front, then here the OS doesn't try to find which application can open the kind of link that we are sending since we directly specify that we want it to open the URL using Safari. Then, the link is passed directly to Safari and open it with its own method and may define its own way of dealing with it (like trying to be smart to determine that a passed URL is a web link or a file based on how it is constructed).

Link to comment

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...