Custom search engines? Topic is solved

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Custom search engines?

Unread post by Sessh » 2024-11-23, 15:45

Using v33.4.1 64-bit

My question is does Pale Moon support adding custom search engines? I don't see it where I'd expect to see it (Manage Search Engines, but clicking "Get more search engines" only takes me to the Pale Moon Addon site to add search plugins), so does that mean adding custom search engines are not supported at all? What I was looking to do was add perplexity.ai as a search engine.

Thanks in advance.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37526
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Custom search engines?

Unread post by Moonchild » 2024-11-23, 16:23

If the site does not offer a way to integrate it as a search engine, then Pale Moon can't magically do so. Since it seems to be your typical "ai dialog", you can only do so on the website.

If they offer a single-shot search query, then you can create your own search engine entry by providing the query URL (e.g by creating an OpenSearch xml file)
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-23, 16:45

It looks like the single search query you'd use for such a thing is:
https://www.perplexity.ai/search?q=%s

..which is what I would have used to add it. I wasn't expecting magic. :)

Never heard of OpenSearch, but I think I found a Mozilla site showing how to make one. How do I integrate it into Pale Moon? Drag and drop like an Addon?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37526
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Custom search engines?

Unread post by Moonchild » 2024-11-23, 17:44

Sessh wrote:
2024-11-23, 16:45
which is what I would have used to add it. I wasn't expecting magic. :)
Well you didn't exactly tell us it was possible ;) Most "AI search" things aren't available outside of a web interface.
Sessh wrote:
2024-11-23, 16:45
How do I integrate it into Pale Moon? Drag and drop like an Addon?
Unfortunately not. You either need to install it from a web server presenting the proper MIME type so it knows to treat it like a searchplugin definition, or you need to drop it into the "searchplugins" folder in your profile folder. The xml files dropped there will be picked up upon restart of the browser.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-23, 18:06

Moonchild wrote:
2024-11-23, 17:44
Well you didn't exactly tell us it was possible ;) Most "AI search" things aren't available outside of a web interface.
lol Fair enough. I just assume that everyone knows more about AI than me and if I know it, most others probably do. My bad
Moonchild wrote:
2024-11-23, 17:44
Unfortunately not. You either need to install it from a web server presenting the proper MIME type so it knows to treat it like a searchplugin definition, or you need to drop it into the "searchplugins" folder in your profile folder. The xml files dropped there will be picked up upon restart of the browser.
I'll just try the searchplugins folder then. Thanks for the help MC. :)

User avatar
frostknight
Astronaut
Astronaut
Posts: 557
Joined: 2022-08-10, 02:25

Re: Custom search engines?

Unread post by frostknight » 2024-11-23, 18:35

Just a heads up too, if this is not false:

browser.privatebrowsing.autostart;

you cannot add new search engines from mycroftproject and many other places too.

Which always puzzles me, because I never had this problem with Basilisk-Browser or Iceweasel-Uxp.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

User avatar
suzyne
Astronaut
Astronaut
Posts: 685
Joined: 2023-06-28, 22:43
Location: Australia

Re: Custom search engines?

Unread post by suzyne » 2024-11-23, 22:28

In case it's of any use or interest, a while back I made a web page that can add a search engine to Pale Moon. By examining the HTML and XML files, you can see what is required for a site to offer the option of adding its search (or any other search if there is the appropriate XML magic) to a visiting browser.

https://fiftynineisprime.com/palemoongooglewebplugin/
Laptop 1: Windows 11 64-bit, i7 @ 2.80GHz, 16GB, NVIDIA GeForce MX450.
Laptop 2: Windows 10 32-bit, Atom Z3735F @ 1.33GHz, 2GB, Intel HD Graphics.
Laptop 3: Linux Mint 20.3 64-bit, i5 @ 2.5GHz, 8GB, Intel HD Graphics 620.

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-23, 23:15

Ok so I don't want this so bad that I want to dump a bunch of time into it, but I'm kinda curious why it's not working for me. I even had perplexity write the XML file just to make sure it wasn't me making an error. I name it OpenSearch.xml (saved in UTF-8) and put it in the searchplugins folder in my default profile, but it doesn't show up in the list of search engines even after a restart. The contents of the XML are as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>Perplexity AI</ShortName>
    <Description>Search Perplexity AI for answers to your questions.</Description>
    <Url type="text/html" template="https://www.perplexity.ai/?s=o&q={searchTerms}" />
    <Url type="application/json" template="https://www.perplexity.ai/api/search?q={searchTerms}" />
    <Image height="16" width="16">https://www.perplexity.ai/favicon.ico</Image>
    <Query role="example" searchTerms="What is AI?" />
    <Developer>Your Name or Organization</Developer>
    <Attribution>Powered by Perplexity AI</Attribution>
</OpenSearchDescription>
Anything look obviously wrong here? The links / ico all seem to be accessible.

User avatar
frostknight
Astronaut
Astronaut
Posts: 557
Joined: 2022-08-10, 02:25

Re: Custom search engines?

Unread post by frostknight » 2024-11-23, 23:19

Oh also after you turn private browsing off, you have to reboot the web browser to add most search engines.... just something i forgot
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

User avatar
suzyne
Astronaut
Astronaut
Posts: 685
Joined: 2023-06-28, 22:43
Location: Australia

Re: Custom search engines?

Unread post by suzyne » 2024-11-23, 23:38

Sessh wrote:
2024-11-23, 23:15
Anything look obviously wrong here?
I don't have a deep understanding of how this all works, and my results have been from copying existing files. But looking at the contents of google.xml in the Pale Moon searchplugins folder, it is very different from your file.

Code: Select all

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Google</os:ShortName>
<os:Description>Google Search</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64, blah blah blah have removed the encoded data</os:Image>
<SearchForm>https://www.google.com/</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="https://suggestqueries.google.com/complete/search?output=firefox&amp;client=firefox&amp;q={searchTerms}" resultDomain="suggestqueries.google.com">
</os:Url><os:Url type="text/html" method="GET" template="https://www.google.com/search" resultDomain="google.com">
  <os:Param name="q" value="{searchTerms}"/>
  <os:Param name="ie" value="utf-8"/>
  <os:Param name="oe" value="utf-8"/>
</os:Url>
</SearchPlugin>
Laptop 1: Windows 11 64-bit, i7 @ 2.80GHz, 16GB, NVIDIA GeForce MX450.
Laptop 2: Windows 10 32-bit, Atom Z3735F @ 1.33GHz, 2GB, Intel HD Graphics.
Laptop 3: Linux Mint 20.3 64-bit, i5 @ 2.5GHz, 8GB, Intel HD Graphics 620.

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-23, 23:48

Yeah I was actually looking at that too. I tried editing another one to make it work, but nothing yet. I'll try that google one.

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-24, 00:07

Based on that formatting, i get this:

Code: Select all

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Perplexity AI</os:ShortName>
<os:Description>Search Perplexity AI for answers to your questions.</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16" type="image/x-icon">https://www.perplexity.ai/favicon.ico</os:Image>
<SearchForm>https://www.perplexity.ai/api/search?q={searchTerms}</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="https://www.perplexity.ai/api/search?q={searchTerms}" resultDomain="perplexity.ai">
  <os:Param name="q" value="{searchTerms}"/>
</os:Url><os:Url type="text/html" method="GET" template="https://www.perplexity.ai/?s=o&q={searchTerms}" resultDomain="perplexity.ai">
  <os:Param name="s" value="o"/>
  <os:Param name="q" value="{searchTerms}"/>
</os:Url>
</SearchPlugin>
Still doesn't work. Clean profile or not (copying searchplugins folder to that profile first) and yes, that privatebrowsing.autostart setting was already off.

I don't have a deep understanding either of all this. Not sure if I'm just doing something wrong or it's just not being picked up properly, but it's not a big deal really. :) I thought it might go smoother than this which is usually a sign of overconfidence, so I shoulda known better. lol

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37526
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Custom search engines?

Unread post by Moonchild » 2024-11-24, 00:18

if you include "param" to pass parameters to a URL, then you have to remove those from the URL in the template. e.g.:

Code: Select all

<os:Url type="text/html" method="GET" template="https://www.perplexity.ai/">
  <os:Param name="s" value="o"/>
  <os:Param name="q" value="{searchTerms}"/>
</os:Url>
And you may want to remove the search suggestion URL block if they don't explicitly support that.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
frostknight
Astronaut
Astronaut
Posts: 557
Joined: 2022-08-10, 02:25

Re: Custom search engines?

Unread post by frostknight » 2024-11-24, 00:36

Sessh wrote:
2024-11-24, 00:07
Still doesn't work. Clean profile or not (copying searchplugins folder to that profile first) and yes, that privatebrowsing.autostart setting was already off.
Did you try mycroftproject then to get those search plugins? If it still failed, that is strange. No idea why that would happen. Especially if after making it turning that off, you proceeded to close and reopen palemoon.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Say NO to Fascism and Corporatism as much as possible!
Also, Peace Be With us All!

Sessh
Fanatic
Fanatic
Posts: 206
Joined: 2018-01-11, 18:43

Re: Custom search engines?

Unread post by Sessh » 2024-11-24, 00:49

Moonchild wrote:
2024-11-24, 00:18
if you include "param" to pass parameters to a URL, then you have to remove those from the URL in the template. e.g.:

Code: Select all

<os:Url type="text/html" method="GET" template="https://www.perplexity.ai/">
  <os:Param name="s" value="o"/>
  <os:Param name="q" value="{searchTerms}"/>
</os:Url>
Removing the parameters from the URL template worked! Now it shows up in the list and works as expected. Thanks again and also to everyone else that replied.

User avatar
suzyne
Astronaut
Astronaut
Posts: 685
Joined: 2023-06-28, 22:43
Location: Australia

Re: Custom search engines?

Unread post by suzyne » 2024-11-24, 01:28

Yay!
Laptop 1: Windows 11 64-bit, i7 @ 2.80GHz, 16GB, NVIDIA GeForce MX450.
Laptop 2: Windows 10 32-bit, Atom Z3735F @ 1.33GHz, 2GB, Intel HD Graphics.
Laptop 3: Linux Mint 20.3 64-bit, i5 @ 2.5GHz, 8GB, Intel HD Graphics 620.