# Problem with Firefox and restrict_javascript plugin

## Dralnu

Ok, this is a really annoying problem, and what I did before to fix it no longer works.

I ran Firefox a day or two before, and things went swimmingly, as per the norm. Well, I had opened several (maybe a dozen?) tabs from a google search (several used javascript I believe. Can't confirm, though), and started to look through them. I looked down into the lower right-hand corner of my window, and lo and behold, the icon for the plugin was no longer there. Ok, this ticks me off, so I restart firefox - still not there. Export bookmarks, stop firefox, delete my .mozilla dir - it still isn't there. Ok, now I stop firefox, and recompile it - STILL not there. Needless to say I'm annoyed now (btw, I'm about to unmerge firefox, remove the deps, and reinstall), and wanted to know if anyone else had this problem or knows the reasoning for it and how to fix it without having to reinstall EVERYTHING.

----------

## erik258

My roommate, to whom I'm showing the Gentoo ropes, had a similar problem with the x86_64 build of firefox and flash plugins.  My firefox plugin manager shows a number of things, but his shows nothing and can't use the flash plugin.  I couldn't figure out what differed between his system and mine.  The binary version of firefox worked with flash fine, but it's still a mystery as to why the 64-bit build failed to use any plugins.  I also noticed that  a file with plugins in the name in ~/.mozilla/firefox seemed to hold this information, and was being overwritten by firefox.  

Firefox bug?

----------

## Dralnu

 *erik258 wrote:*   

> My roommate, to whom I'm showing the Gentoo ropes, had a similar problem with the x86_64 build of firefox and flash plugins.  My firefox plugin manager shows a number of things, but his shows nothing and can't use the flash plugin.  I couldn't figure out what differed between his system and mine.  The binary version of firefox worked with flash fine, but it's still a mystery as to why the 64-bit build failed to use any plugins.  I also noticed that  a file with plugins in the name in ~/.mozilla/firefox seemed to hold this information, and was being overwritten by firefox.  
> 
> Firefox bug?

 

well, it seems to be a part of x86 as well. It may be.

----------

## erik258

no, I'm dumb.  I forgot about nspluginwrapper.

----------

## Hu

This is a misfeature in the Firefox 2.x series ebuilds.  As part of installation, it runs rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}".  Unfortunately, $MOZILLA_FIVE_HOME is /usr/lib/mozilla-firefox on x86.  equery files x11-plugins/noscript (the package which is called in by the restrict-javascript USE flag) shows that noscript installs all its files in /usr/lib/mozilla-firefox/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.  As a result, upgrading Firefox completely erases all globally installed plugins, in particular NoScript.  Just re-emerge noscript and you will be fine until you emerge Firefox again.  The comment in the ebuild suggests the maintainer would be happy to hear about improvements to that function.

----------

## Dralnu

 *Hu wrote:*   

> This is a misfeature in the Firefox 2.x series ebuilds.  As part of installation, it runs rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}".  Unfortunately, $MOZILLA_FIVE_HOME is /usr/lib/mozilla-firefox on x86.  equery files x11-plugins/noscript (the package which is called in by the restrict-javascript USE flag) shows that noscript installs all its files in /usr/lib/mozilla-firefox/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.  As a result, upgrading Firefox completely erases all globally installed plugins, in particular NoScript.  Just re-emerge noscript and you will be fine until you emerge Firefox again.  The comment in the ebuild suggests the maintainer would be happy to hear about improvements to that function.

 

Good to hear there is a simpler solution.

----------

## Sperlock

What did you do to get noscript working in the first place considering that the ebuild places the files in a root only directory?

----------

## Hu

Just emerge x11-plugins/noscript, then restart Firefox.  It should pick it up automatically.  Firefox searches both a machine-wide directory and a user-specific directory.

----------

## Sperlock

 *Hu wrote:*   

> Just emerge x11-plugins/noscript, then restart Firefox.  It should pick it up automatically.  Firefox searches both a machine-wide directory and a user-specific directory.

 

Firefox finds noscript just fine, but I can't change preferences - the OK button doesn't respond.  And I need to get into the preferences to turn noscript on.

----------

## Hu

That is quite strange.  NoScript should be storing its preferences in the same JavaScript file that stores general Firefox preferences.  Even if there were a problem with all Firefox preferences, I think that manifests only in Firefox forgetting settings when you exit.  It still allows you to change them while running.

What version of NoScript are you using?  It is possible you picked up a buggy version.

----------

## Sperlock

1.1.72.  I even tried 1.1.9, and have tried unmerging noscript, recompiling firefox without the restrict-javscript flag, and then adding noscript from the Firefox extensions page (version 1.1.9.6), but am still getting the problem.  So I don't know what is causing it anymore.  Guess I will just have to manually block javascript through Adblock Plus, though I prefer noscript to do that.

----------

