Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

Firefox search plugins on user profile [HOWTO]

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
VStrider
Apprentice
Apprentice
User avatar
Posts: 244
Joined: Mon Jun 27, 2005 1:11 am
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N

Firefox search plugins on user profile [HOWTO]

  • Quote

Post by VStrider » Fri Sep 02, 2005 12:08 am

After seeing this and this, I decided to write this howto. Hope it's helpful. :)

HOW TO - Firefox search plugins on user profiles

The problem
Firefox does not store plugins on the user profile folder, but on a central location. Any plugins you install will be also available on other users accounts. This may or may not be what you want. For example I have many plugins like sourceforge, gentoo-forums, gentoo-wiki etc etc that my girlfriend does not use. She uses plugins I don't want, like yellow pages, ask-jeeves etc. So the search plugins drop down list, ends up cluttered.

The sollution
Create a searchplugins folder in the firefox profile folder for each user. Next, copy the search plugins to the newly created folders, and assign ownership of the folder and plugins to each user. Then delete the original searchplugins folder.
eg. if you have 4 users: joe, sixpack, leet, guest

Code: Select all

root@localhost~# for iter in joe sixpack leet guest; do
> mkdir /home/$iter/.mozilla/firefox/searchplugins
> cp /usr/lib/mozilla-firefox/searchplugins/* /home/$iter/.mozilla/firefox/searchplugins
> chown -R $iter:users /home/$iter/.mozilla/firefox/searchplugins
> done
root@localhost~# \rm -R /usr/lib/mozilla-firefox/searchplugins
Finally we create a symlink to ~/.mozilla/firefox/searchplugins that gets updated every time a user logs in (so that it always points to the current user's searchplugins).

If you 're using GDM:

Code: Select all

root@localhost~# echo "[ -d ~/.mozilla/firefox/searchplugins ] && /bin/ln -sfn ~/.mozilla/firefox/searchplugins /usr/lib/mozilla-firefox/searchplugins" >> /etc/X11/gdm/PostLogin/Default
If you're using KDM or XDM, just add the line inside the quotations above into the scirpt that runs after login (don't know where, I'm not using kdm or xdm but it shouldn't be too hard to find)

That's it. Now logout and log back in. Firefox is now using your own searchplugins folder.
Go to /home/yourusername/.mozilla/firefox/searchplugins and delete any plugins you don't want. You can safely do this as it won't affect other users.
Start firefox and install new plugins. They will be installed on your profile only.

Please note:
1. If there's more than 1 users logging in at the same time (eg. if you're using LTSP or remote X etc) the symlink will be updated to the last user logged in. So if the 1st user starts firefox, he won't see any search plugins. In this case, better start firefox with a script that updates the symlink and then starts firefox.
2. If you emerged firefox-bin the path to firefox and searchplugins will be different. Probably under /opt.

Enjoy :)
Top
VStrider
Apprentice
Apprentice
User avatar
Posts: 244
Joined: Mon Jun 27, 2005 1:11 am
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N

  • Quote

Post by VStrider » Fri Sep 02, 2005 1:03 pm

No comments? Maybe I didn't explain it properly. Ok, let's try and do this step by step. You can always undo changes to the way it was before. (I'll explain how). You don't have to use the 'for loop' as on my previous post if it's confusing. You can still do it manually for every user, though you'll need to type the same things again and again for every user.

Ok, firefox looks for the searchplugins in /usr/lib/mozilla-firefox/searchplugins
This is a directory and contains all your searchplugins. The idea is that we'll replace this directory with a symlink that points to a directory inside your profile. As far as firefox is concerned, /usr/lib/mozilla-firefox/searchplugins exists and firefox will look there for plugins. Now though this file will not be a directory but a symlink. And it'll point to another dir in your profile.

First create a directory in your /home/username/.mozilla/firefox and name it searchplugins.
mkdir ~/.mozilla/firefox/searchplugins

Now copy any plugins you want to the new dir you just created. Let's copy only google for starters.
cp /usr/lib/mozilla-firefox/searchplugins/google* ~/.mozilla/firefox/searchplugins

Ok, now close firefox and rename the directory searchplugins to searchplugins_backup
mv /usr/lib/mozilla-firefox/searchplugins /usr/lib/mozilla-firefox/searchplugins_backup

Create the symlink.
ln -sfn ~/.mozilla/firefox/searchplugins /usr/lib/mozilla-firefox/searchplugins

Great. Now if you start firefox, you'll only have google on your searchplugins since it's using the new searchplugins dir under our profile. Go ahead and install a new searchplugin. You'll see that it's installed under ~/.mozilla/firefox/searchplugins

Now we create a searchplugins directory for every user (like we did above) and copy whatever plugins each user wants.
So we have these directories:
/home/username1/.mozilla/firefox/searchplugins
/home/username2/.mozilla/firefox/searchplugins
/home/username3/.mozilla/firefox/searchplugins
...etc.

Next we make sure the new folders have the correct ownership or users won't be able to install new searchplugins. If you created these dirs by su - to root the ownership would be root:root. Change it with chown to
username1:users for /home/username1/.mozilla/firefox/searchplugins
username2:users for /home/username2/.mozilla/firefox/searchplugins
...etc.
like so
chown username2:users /home/username2/.mozilla/firefox/searchplugins

Ok, now we have all these personalised searchplugins directories, but if we login with username2, the symlink will still point to /home/username1/.mozilla/firefox/searchplugins
We need a way to update the symlink everytime a user logs in.

So we edit the file /etc/X11/gdm/PostLogin/Default
If it doesn't exist, create it. Add this 1 line to it
[ -d ~/.mozilla/firefox/searchplugins ] && ln -sfn ~/.mozilla/firefox/searchplugins /usr/lib/mozilla-firefox/searchplugins
the red part checks whether the searchplugins dir exists so that it doesn't create a broken symlink. The blue part updates the symlink to point to the current user's searchplugins directory.

That's it. Now every time a user logins, firefox will use the user's searchplugins directory under his profile.

If you want to revert back to how it was before,
delete the symlink and rename searchplugins_backup to searchplugins, like so
rm /usr/lib/mozilla-firefox/searchplugins
mv /usr/lib/mozilla-firefox/searchplugins_backup /usr/lib/mozilla-firefox/searchplugins
remove the line you added to /etc/X11/gdm/PostLogin/Default
delete the searchplugins directories you created for each user.

Comments are welcome. :)
Top
revertex
l33t
l33t
User avatar
Posts: 806
Joined: Wed Apr 23, 2003 9:21 am

  • Quote

Post by revertex » Wed Oct 05, 2005 3:55 am

I can't believe nobody comment this thread, this bug is a pain in the a$$, because only root can install searchplugins under linux, and it's plain stupid.
Installing a searchplugin as user under default conditions fail without show any message, a terrible bug that still unsolved.
chmod /usr/lib/mozilla-firefox/searchplugins and make it word writable works too, but seems a bit unsafe.
Your solution is pretty elegant and funcional if you don't have 2 users logged in at the same time.
I don't undestand why searchplugins isn't installed under user profiles, like any other firefox plugin.

thank's for the tip, your instructions are crystal clear.
Top
VStrider
Apprentice
Apprentice
User avatar
Posts: 244
Joined: Mon Jun 27, 2005 1:11 am
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N

  • Quote

Post by VStrider » Wed Oct 05, 2005 11:45 am

I'm glad this helped someone. Thanks for your comments. :)
Top
arthi
n00b
n00b
Posts: 1
Joined: Wed Oct 05, 2005 10:06 pm

  • Quote

Post by arthi » Wed Oct 05, 2005 10:16 pm

Hi VStrider,

thank you very much.

I benefitted from your knowledge. :D

And I'm sure I'm not the only one... :wink:


arthi
Top
legine
Guru
Guru
Posts: 555
Joined: Thu May 27, 2004 2:07 pm
Location: Germany

  • Quote

Post by legine » Thu Oct 06, 2005 12:30 pm

Nice Idea.
But I do not think thats a good workaround for different user profiles. You run into trouble when user a and user b want both to install symlinks if they both run firefox simultaniously. One of them wont install any serachplugins or (if the sets permission do fit) in the wrong place.

IMHO I dont think thats a workabel workaround on multiuser systems at the same time. It is quite good for one at a time user access.

The main advantage is that you can keep your searchplugins after an update. At least they remain untuched you simply need to reinstall the symlink!

Thanks for that Idea. Never would have thought about this aproach :)

EDIT:
Hmm okey I tested it now. And I can confirm. that the one who last fires firefox up winns and gets all the search plugins. What I think is quite funny that when you install a new plugi the oplugin gets added. When somebody else does add a plugin it gets added at next startup. There is no warning something gone wrong.

So if somebody uses this workaround (which I think is great) then be aware that you might run into big questionmark if 2 users start useing firefox simultaniously and install plugins.
quote from Spaceballs:
Dark Helmet:[...] we were told to comb the desert, so we're combing it! [puts down bullhorn] Find anything yet?!
Soldier: Nothing yet, sir.
Top
VStrider
Apprentice
Apprentice
User avatar
Posts: 244
Joined: Mon Jun 27, 2005 1:11 am
Location: 1 to Rule All way, Moria Gate, Middle Earth, SAU 70N

  • Quote

Post by VStrider » Thu Oct 06, 2005 2:00 pm

Thanks alot guys for your comments. :) When I first wrote this howto (about a month ago), I didn't get any replies at all, and it's really disappointing if you found a simple workaround to a problem that bugs lots of people and yet you don't get any feedback. I'm glad this actually helped you guys, and it wasn't a waste of time. :)

legine, you are correct on your observations. When you have 2 (or more) users logged in at the same time on the same machine and they're using firefox, you'll have some sideeffects. Nothing dangerous, just that the other users won't see any searchplugins. The symlink will be pointing to the last logged-in user's searchplugins. I thought about this cause I also run an LTSP server, that's why I had this warning at the end of the howto. But for most casual desktop users, it shouldn't be a problem. :)
Top
bludger
Guru
Guru
Posts: 389
Joined: Wed Apr 09, 2003 7:14 am

  • Quote

Post by bludger » Wed Nov 02, 2005 11:36 am

Thanks very much for this workaround, I might just give it a go. Nevertheless, this is still a workaround and not a fix. It is amazing that this problem has been around for so long.

I checked out the mozilla bug report https://bugzilla.mozilla.org/show_bug.cgi?id=123315. The bug status is "fixed" with target milestone mozilla1.8beta1. Finally, is all I can say - the original bug report was opened in Feb 2002!
Last edited by bludger on Mon Dec 19, 2005 11:56 am, edited 1 time in total.
Top
brianlmoon
n00b
n00b
Posts: 11
Joined: Mon Apr 04, 2005 5:52 am

Update!

  • Quote

Post by brianlmoon » Wed Dec 07, 2005 1:47 pm

I am using mozilla-firefox-bin ver 1.0.7. My search plugins were found in /opt/firefox/searchplugins not in the location mentioned above.
Top
mo2001
n00b
n00b
Posts: 3
Joined: Thu Dec 15, 2005 5:05 pm

  • Quote

Post by mo2001 » Thu Dec 15, 2005 5:10 pm

revertex wrote:I can't believe nobody comment this thread, this bug is a pain in the a$$, because only root can install searchplugins under linux, and it's plain stupid.
Hmm, in Debian it is no problem to install searchplugins as a normal user. They will get installed to ~/.mozilla/searchplugins and everything will work fine. So it seems to be a Gentoo specific bug.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy