Jump to content

Make URL-encoding smarter or optional


Recommended Posts

Ref: http://www.alfredforum.com/topic/5993-custom-searches-with-full-url-as-the-query/

Unless {query} is the entire URL, the Open URL action behaves as if {query} is a query string value and URL-encodes it, i.e. it assumes:

http://www.example.com/page?arg={query}

This is not always the case, however. {query} may also be a part of the URL path, e.g.

http://www.example.com/{query}/some/other/thing

In the latter case, most browsers will choke on the URL (I think only Firefox is smart enough to handle URL-encoded paths).

Alfred should ideally provide a checkbox to turn URL-encoding of {query} off to avoid messing up {query}.

Alternatively, it could try to determine whether {query} is actually the value of a GET parameter (for example, based on the presence of "arg=…"), but the on/off option is probably more robust.

Edited by deanishe
Link to comment
Share on other sites

I agree, there are definitely improvements which can be made in this area, but I may leave this until a more major release (as there is the Workflows workaround at this point).

 

Other improvements would be the option to encode spaces as other characters such as - and _ which would give even more flexibility.

 

I've added a ticket :)

Link to comment
Share on other sites

  • 7 years later...

I see in Alfred 5 we changed some of the encoding setup. I have a custom search that takes the query value and puts it into an Atlassian JQL search.  Unfortunately Atlassian reserves the space character and now with the forced encoding I cannot find a way to keep it an actual space.  More info on Atlassian JQL can be found  https://confluence.atlassian.com/jirasoftwareserver0820/search-syntax-for-text-fields-1095249262.html.

Essentially my resulting URL I want to send to the browser should look like this `https://URL/issues/?jql=text~"alfred app"` and my custom query looks like this `https://URL/issues/?jql=text~"{query}"` .

Is there an option to not modify the query?  This used to work in Alfred 4, I believe.

Link to comment
Share on other sites

@vitor Thanks that helped I ran into the exact same issue I had to create a workflow to disable encoding the {query} parameter option.

 

Previously I was able to get this working with Web search now it encodes the % itself breaking the Jira search.

 

The working config is here for anyone who is looking for a fix.

 

This Web search config as shown below no longer works 💔 

 

image.thumb.png.e21b4cbaf30050d0efdf0c2e1616de76.png

 

We need to do this Create a workflow as mentioned here 

image.thumb.png.a05ebd6b1ca54fc7a141d852166171b3.png

 

Then uncheck encoding for {query} placeholder

 

 

 image.thumb.png.3a871851c67d0dcb5ed34854bf4b056b.png

 

 

Now disable the Web search and only have the Workflow enabled 👍

 

 

 

 

Edited by dannysamk
Link to comment
Share on other sites

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