Google CSE Firefox integration.SOLVED

Chat about just about anything else

Google CSE Firefox integration.SOLVED

Postby viking777 on Fri Feb 08, 2013 12:23 pm

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.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Linux Mint is funded by ads and donations.
 

Re: Google CSE Firefox integration.

Postby zerozero on Fri Feb 08, 2013 9:04 pm

maybe this will help viewtopic.php?f=42&p=150700 (if you had a better search engine you would find it yourself :lol: )
zerozero
Level 16
Level 16
 
Posts: 6471
Joined: Tue Jul 07, 2009 2:29 pm

Re: Google CSE Firefox integration.

Postby viking777 on Sat Feb 09, 2013 6:23 am

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>
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Google CSE Firefox integration.

Postby zerozero on Sat Feb 09, 2013 6:40 am

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:
zerozero
Level 16
Level 16
 
Posts: 6471
Joined: Tue Jul 07, 2009 2:29 pm

Re: Google CSE Firefox integration.

Postby viking777 on Sat Feb 09, 2013 7:08 am

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 :)
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Google CSE Firefox integration.

Postby sunewbie on Fri Feb 15, 2013 6:57 am

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

viewtopic.php?f=90&t=105061&start=0

it points to

https://addons.mozilla.org/en-US/firefo ... earch-bar/
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: Google CSE Firefox integration.

Postby viking777 on Fri Feb 15, 2013 7:36 am

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.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Google CSE Firefox integration.

Postby sunewbie on Fri Feb 15, 2013 7:39 am

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
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: Google CSE Firefox integration.

Postby sunewbie on Fri Feb 15, 2013 7:50 am

Deleted by sunewbie
Last edited by sunewbie on Sat Feb 23, 2013 1:11 am, edited 2 times in total.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: Google CSE Firefox integration.

Postby viking777 on Fri Feb 15, 2013 8:08 am

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
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Google CSE Firefox integration.

Postby sunewbie on Fri Feb 15, 2013 8:33 am

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.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: Google CSE Firefox integration.SOLVED

Postby viking777 on Fri Feb 15, 2013 8:41 am

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


Thanks for that, but I am not at all keen on browser toolbars.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: Google CSE Firefox integration.SOLVED

Postby sunewbie on Fri Feb 22, 2013 4:26 am

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.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 510
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Linux Mint is funded by ads and donations.
 

Return to Open chat

Who is online

Users browsing this forum: No registered users and 6 guests