Google CSE Firefox integration.SOLVED

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Locked
viking777

Google CSE Firefox integration.SOLVED

Post by viking777 »

I went here: https://www.google.com/cse/ and created a custom search engine to get better results when searching Mint/Ubuntu sites. The result works very well, although it is only presented as a piece of html that is supposed to be embedded into a website. Well I don't want to do that, I want to use it as a search engine in Firefox, but I can't find the way to do this. At the moment the html code is just saved as a file which I click to launch the code in Firefox, but this is very inconvenient, I am sure there must be a way to get it recognised as a search engine, and then I could give it a keyword when I wanted to use it. Anyone know how I could achieve this?

BTW. the firefox addon 'Add to Search Bar' is no help, it just tells me: "new EngineURL: template uses invalid scheme!"

The best I have come up with so far is a keyboard shortcut to launch the file that launches the search window - hardly 'integration' though.
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
zerozero

Re: Google CSE Firefox integration.

Post by zerozero »

maybe this will help http://forums.linuxmint.com/viewtopic.php?f=42&p=150700 (if you had a better search engine you would find it yourself :lol: )
viking777

Re: Google CSE Firefox integration.

Post by viking777 »

Fraid not zz :)

That only searches linuxmint.com - I can do that with a simple keyword search. My CSE search engine searches ubuntuforums and omgubuntu as well as linuxmint.com and the mint forums, that is why it's better, and why I would like to integrate it with FF. Right enough it wasn't meant for that purpose, it is meant for embedding in a web site so I will probably have to live with my keyboard shortcut.

Have a go with it if you like, just take this code, paste it into a file, rename it to something like 'search.html' and click it.

Code: Select all

    <script>
(function() {
  var cx = '014925687778169686232:p7fcqjljwgm';
  var gcse = document.createElement('script'); gcse.type = 'text/javascript';
  gcse.async = true;
  gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
      '//www.google.com/cse/cse.js?cx=' + cx;
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
zerozero

Re: Google CSE Firefox integration.

Post by zerozero »

i tried the CSE google search and as-is (as far as i could see) it's only for embedding in web pages (as you said) or to use as a widget in igoogle's home page (not a very good solution because i read somewhere that igoogle is going away)

but my suggestion above was to use altair's method to integrate the snippet generated by CSE into FF (the same way he did with it's own). mind you that i didn't test it :mrgreen:
viking777

Re: Google CSE Firefox integration.

Post by viking777 »

Sorry zerozereo, my misunderstanding, I tried that suggestion, but the newly created search plugin doesn't even show up. The html code supplied by google doesn't look much like the xml code used in the existing plugins and I have no idea how to convert one to the other.

Good try though - thanks for that :)
sunewbie

Re: Google CSE Firefox integration.

Post by sunewbie »

viking777 wrote:I went here: https://www.google.com/cse/ and created a custom search engine to get better results when searching Mint/Ubuntu sites. The result works very well, although it is only presented as a piece of html that is supposed to be embedded into a website. Well I don't want to do that, I want to use it as a search engine in Firefox, but I can't find the way to do this. At the moment the html code is just saved as a file which I click to launch the code in Firefox, but this is very inconvenient, I am sure there must be a way to get it recognised as a search engine, and then I could give it a keyword when I wanted to use it. Anyone know how I could achieve this?

BTW. the firefox addon 'Add to Search Bar' is no help, it just tells me: "new EngineURL: template uses invalid scheme!"

The best I have come up with so far is a keyboard shortcut to launch the file that launches the search window - hardly 'integration' though.
have you tried my search engine - link in my signature ;)

forum thread

also have a look at this thread

http://forums.linuxmint.com/viewtopic.p ... 61&start=0

it points to

https://addons.mozilla.org/en-US/firefo ... earch-bar/
viking777

Re: Google CSE Firefox integration.

Post by viking777 »

Thanks sunnewbie, I did look at your post but it doesn't answer my question - how do I use my own CSE as one of Firefox's default search engines. Your own posts only describe how to embed it in a website or a google home page - I don't have or want either, so it doesn't help me. If you reread my opening post you will see that I have already tried 'Add to search bar' and that doesn't work either.

Thanks for trying to help, but it is not the answer I am looking for.
sunewbie

Re: Google CSE Firefox integration.

Post by sunewbie »

I just went to my google CSE - LBSE

Right clicked in the search box

there was an option 'Add as a search engine' in Opera, FF (with addon - Add to search bar v 2.0 enabled ) and Chromium

You can add and define a key word e.g. I gave lb ('l' is small letter 'L') --> save

Just open a new tab, type

Code: Select all

lb [search query]
enjoy :D
sunewbie

Re: Google CSE Firefox integration.

Post by sunewbie »

Deleted by sunewbie
Last edited by sunewbie on Sat Feb 23, 2013 1:11 am, edited 2 times in total.
viking777

Re: Google CSE Firefox integration.

Post by viking777 »

I am so embarrased for not seeing that, and so grateful to you for pointing it out sunnewbie. I just never even thought of trying that - and neither did others because there is a bug reported for this problem to which I added my reply. Thanks a million it is just what I was looking for :D :D
sunewbie

Re: Google CSE Firefox integration.

Post by sunewbie »

viking777 wrote:I am so embarrased for not seeing that, and so grateful to you for pointing it out sunnewbie. I just never even thought of trying that - and neither did others because there is a bug reported for this problem to which I added my reply. Thanks a million it is just what I was looking for :D :D
Glad that it worked. Actually, before I submitted my second post, you had already posted a reply. So don't be embarrassed. :)

sometimes things are very simple for hardcore coders ;)

I wanted to add a tutorial on 'how to LBSE to browser search bar', but was too lazy to take screenshots - even after finding awesome screenshot - a chrome/ium extension, where I can mark and annotate easily. I do not need GIMP or Inkscape or Krita for it ;)

Before a year or so, many 3rd party tools like conduit toolbar did not recognized CSE's, so I could not add my CSE to a custom toolbar. I have quit the toolbar as it takes time to load, so not many will want to install it.

an e.g. of toolbar just in case you got interested.

source
Last edited by sunewbie on Fri Feb 15, 2013 8:57 am, edited 1 time in total.
viking777

Re: Google CSE Firefox integration.SOLVED

Post by viking777 »

an e.g. of toolbar just in case you got interested
Thanks for that, but I am not at all keen on browser toolbars.
sunewbie

Re: Google CSE Firefox integration.SOLVED

Post by sunewbie »

Not to self promote LBSE, but just incase someone still finds it difficult to add google CSE or any CSE to your Browser, so that you can search directly from address bar, here is the link. I have explained it along with screenshots.
Locked

Return to “Open Chat”