Adding an Search Engine which is based on JavaScript
-
Hi, I was trying to add NIX package search as a Search engine on vivaldi, Link here "https://search.nixos.org/packages", But seems like it doesn't work as i thought it will be. So How Would i add this as a Search engine on vivaldi?
-
@nahianadnan1234 Hi, engines that are just based on JS and POSTing JSON are a problem and generally won't work.
However, it's always a good idea to just try a regular GET if it works, and in this case it seems to work fine:
https://search.nixos.org/packages?query=%s
Also looking at the page source headers is a good idea. If the site uses OpenSearch they will support GET requests and provide the url to use.
https://search.nixos.org/desc-search-packages.xml -
@Pathduck said in Adding an Search Engine which is based on JavaScript:
engines that are just based on JS and POSTing JSON are a problem and generally won't work.
As i thought.
@Pathduck said in Adding an Search Engine which is based on JavaScript:
However, it's always a good idea to just try a regular GET if it works, and in this case it seems to work fine:
https://search.nixos.org/packages?query=%sI tried this but different that's why it didn't worked for me first time, And yes it is working for me right now. It's really helpful to have it.
@Pathduck said in Adding an Search Engine which is based on JavaScript:
Also looking at the page source headers is a good idea. If the site uses OpenSearch they will support GET requests and provide the url to use.
https://search.nixos.org/desc-search-packages.xmlCan i ask how did you found this?
-
@nahianadnan1234 said in Adding an Search Engine which is based on JavaScript:
Can i ask how did you found this?
Right-click > Developer Tools > Inspect/View Source.
In the HTML header:<link rel="search" type="application/opensearchdescription+xml" title="NixOS packages" href="/desc-search-packages.xml">
Also, if you understand how HTTP url parameters work, you can change your query to include channel, hits, sort etc:
https://search.nixos.org/packages?channel=unstable&from=0&size=1000&sort=alpha_desc&type=packages&query=%s