evilpie / add-custom-search-engine

Add a custom search engine to the list of available search engines in Firefox
https://addons.mozilla.org/en-US/firefox/addon/add-custom-search-engine/
Mozilla Public License 2.0
173 stars 13 forks source link

Port number in URLs? #29

Closed gstaniak closed 3 years ago

gstaniak commented 3 years ago

It seems the UI doesn't accept URLs that include port number, like 'https://www.example.com:8443/search=%s'. I have noticed that in two cases the URL field was highlighted in red and the 'Please enter a URL' messages was flashed, and this was the only common feature of the two URLs. If this is the case, can this be fixed please? Thank you.

evilpie commented 3 years ago

I can't reproduce this issue, using https://www.example.com:8443/search=%s. Make sure you don't have any other invalid characters in your URL. Like for example a ' at the beginning.

gstaniak commented 3 years ago

Hi, thanks for the reply. I tested some more, and it seems the issue is not with the port number, but with the %s placeholder being used in the host name. To give some more context, I'm setting up searches on a number of internal systems whose names can be dynamic and search queries are standardized, with the hostname used only to specify the range of the search, along the lines of:

https://srv.%s.example.com/Category:Internals?source=%s

That way, if I define a keyword like @int and then type '@int svc01', I get the results of the internal debugging page from srv.svc01.example.com, which is really handy. The rest of the team use Chrome for these searches and it works there. Do you think it's feasible to make your extension substitute the placeholder in hostnames too? Thank you.

evilpie commented 3 years ago

Mhm. I could, but it's a bit annoying because it breaks the URL validation. I will think about it a bit more.

I suggest you just open the console (F12) and enter $("#input-url").type = "text". That should allow you to add this at the moment.