Mozilla Firefox

From Gentoo Linux Wiki

(Redirected from HOWTO gxine with firefox)
Jump to: navigation, search

The Mozilla Firefox is a popular open source web browser using the Gecko engine, spring of the Mozilla-Family. Version 1.0 was released in November 2004. As of May 2008, the latest version is 2.0.0.14, and the release of Mozilla Firefox 3 is planned for June. It includes tabbed browsing, a spell checker, incremental find, live bookmarking, a download manager, and an integrated search system that uses the user's desired search engine. The Mozilla Firefox can be extended with add-ons created by third-party developers.

Contents

[edit] Installation

To install Mozilla Firefox, run: emerge -av mozilla-firefox

[edit] Usage

You can start Mozilla Firefox by entering firefox. Note that if you want to start Mozilla Firefox using X forwarding, use firefox -no-remote instead.

[edit] Configuration

[edit] Default browser

In order to use the Mozilla Firefox as your default browser, you need to change the $BROWSER variable. For more information, see TIP_Set_your_default_browser.


[edit] Opening X-Chat from Firefox

Note: Tested with net-irc/xchat-2.6.8. Previous versions are not guaranteed to work.

You have to emerge xchat with the dbus USE flag. Also make sure dbus is emerged with the X USE flag set.

File: /etc/portage/package.use
net-irc/xchat dbus
sys-apps/dbus X

To install xchat, run: emerge -av xchat

Note: It is not required to run the dbus daemon (/etc/init.d/dbus).

Now you have to edit ~/.xinitrc.

File: ~/.xinitrc

Replace your existing line in the following way (in this example we are using fluxbox as our WM):

#exec startfluxbox
exec dbus-launch --exit-with-session startfluxbox

Let's configure Firefox:

File: ~/.mozilla/firefox/<xxxxxxxx>.default/user.js
user_pref("network.protocol-handler.app.irc","/usr/bin/xchat-2-firefox");
user_pref("network.protocol-handler.external.irc",true);

Create the xchat-2-firefox script:

File: /usr/bin/xchat-2-firefox
#!/bin/bash
xchat-2 --existing --url=$@

Then make it executable:

# chmod +x /usr/bin/xchat-2-firefox

Everything should be ok now. Just test by clicking on a URL such as the following one: irc://irc.freenode.net/gentoo.

[edit] Opening Mozilla Firefox from X-Chat

To open a URL in Mozilla Firefox from X-Chat, CTRL-click on it, or right-click and choose Open Link in Browser from the context menu. You will need to set Mozilla Firefox as the default URL handler for http: and https: URI schemes.

GNOME users, just use the GNOME control panel. Non-GNOME users, use the gconftool-2 command:

 # gconftool-2 -t string -s /desktop/gnome/url-handlers/http/command "firefox %s"
 # gconftool-2 -t string -s /desktop/gnome/url-handlers/https/command "firefox %s"

[edit] Search engines

If you are using Mozilla Firefox 2.0 or newer, just open the drop down menu of you search bar on some web sites. For exemple, in this page, there should be an entry Add Gentoo Linux Wiki (English), it lets you download and install plugins automatically.

When you are on some Gentoo pages, you can see that you can add search engines plugins for Firefox. In this page, you can add the one for "Gentoo Linux Wiki". On the http://gentoo.org main page, you can add "Gentoo list archives". On http://forums.gentoo.org, you can add "Gentoo Website", "Gentoo Forums" (post & topics), and "Gentoo Bugzilla" (bug no & bug summary). On http://gentoo.zapto.org you'll be able to add a searchengine plugin for this website (search by description, search revdeps). In the next section, you'll see how to add search engine for gentoo-portage.

You can add keywords for them, to quickly search "gw editing search bar" "gpo thing", or "gzo what", "revdep app-shells/bash"...

There are more search engines, you can find those on mycraft: http://mycroft.mozdev.org/download.html?name=gentoo&submitform=Search

[edit] Gentoo-portage

[edit] Introduction

To install it you can go here and download both files into the "searchplugin" folder in your firefox installation folder: http://svn.gentoo-portage.com:8080/gentoo-portage/trunk/other/firefoxsearchplugin/

After restarting Firefox you will get a nice option in your browser to search the wiki directly in the top right of your browser

[edit] Problems I

If the search bar does not show up instantly after clicking the link you may fix it by doing this:

su -c "chgrp wheel /usr/lib/mozilla-firefox/searchplugins/ && chmod g+ws /usr/lib/mozilla-firefox/searchplugins/"

All users in the group "wheel" now have enough permissions to add searchplugins

As of Firefox 1.0.6 it is under /usr/lib/mozilla-firefox, so you have to type:

su -c "chgrp wheel /usr/lib/mozilla-firefox/searchplugins/ && chmod g+ws /usr/lib/mozilla-firefox/searchplugins/"
[edit] Problems II

If you're using the firefox-bin package you'll have to set the following directory:

su -c "chgrp wheel /opt/firefox/searchplugins && chmod g+ws /opt/firefox/searchplugins"

[edit] Keymark

In the bookmarks menu go to manage bookmarks and add a new bookmark. The name isn't important, but the Location should be
http://gentoo-wiki.com/Special:Search?go=Go&search=%s
and the put whatever keyword you want to use (lets say 'gw'). Then place the bookmark somewhere (it's not important where. Now you should be able to type in you location bar
gw <some search term>
and search the wiki

[edit] Inline mplayer

Version 1.0_pre7-r1 and 3.11 are in the ~x86 branch, the stable branch should work also. I would also recommend only installing one package for audio/video stream, installing more than one could cause problems. To use mplayer with the mozilla firefox browser you have to emerge the mplayerplug-in. emerge -av net-www/mplayerplug-in See here on how to configure mplayer

You may want to change the USE flags for the plugin.

File: /etc/portage/package.use
net-www/mplayerplug-in gtk divx firefox gmedia quicktime wmp realmedia

When you are done editing the package.use file, emerge and proceed. Now we have to copy the downloaded files so firefox detects them as plugins.

 # cp /usr/lib/nsbrowser/plugins/* ~/.mozilla/plugins/

[edit] Minimize to tray

The extension https://addons.mozilla.org/en-US/firefox/addon/4868 allows you to minimize the Mozilla Firefox to tray. An alternative to it is AllTray but if you use the Google Sync Plugin for the Mozilla Firefox, there might be some problems with it since a window asking you for your Google password pops up when starting the Mozilla Firefox. If you're using AllTray, only the first Google Sync window is docked into the tray.

[edit] Getting the standard Mozilla Firefox logo

Note: As of Firefox 1.5.0.1, the default gentoo ebuild uses the original Firefox logo.
Note: As of Firefox 2.0.0.1, the default gentoo ebuild has a useflag 'mozbranding' to enable the "standard' logo.

You're searching for the familiar orange-blue firefox icon far too long, because you simply don't get used to it being black/blue on GNU/Linux. Both Mozilla Firefox and Mozilla Thunderbird have a configure flag, --enable-official-branding, that we are going to add to their ebuild's to be used as a USE flag. We will do this in a portage overlay, which will prevent our ebuild being overwritten when portage is sync'd. This tweak is as per the patch attached to bug 89945.

[edit] Creating and merging the portage overlays

As has already been noted, it generally isn't good practice to edit anything in /usr/portage since it gets overwritten every time you sync portage, so here we are going to create portage overlays and edit the ebulids from the main tree to include our tweak.

1. Set your overlay directory in make.conf if you havn't already:

echo "PORTDIR_OVERLAY=\"/usr/local/portage\"" >> /etc/make.conf

2. Create the directory for your overlays (and the sub-directories for Firefox, which are used in the same way as those in the main portage tree, with a category and package name):

mkdir -p /usr/local/portage/www-client/mozilla-firefox

and to make Thunderbird's directories:

mkdir -p /usr/local/portage/mail-client/mozilla-thunderbird

3. Copy the appropriate ebuild for Firefox and Thunderbird from the main portage tree to your overlays:

cp /usr/portage/www-client/mozilla-firefox/mozilla-firefox-1.0.x.ebuild /usr/local/portage/www-client/mozilla-firefox
cp /usr/portage/mail-client/mozilla-thunderbird/mozilla-thunderbird-1.0.x.ebuild /usr/local/portage/mail-client/mozilla-thunderbird

Replace 'x' with the version of the program that you wish to merge. Run the following command for 'mozilla-firefox' or 'mozilla-thunderbird' to find out which version would be merged if you were to use the ebuild from the main tree:

emerge -pv package-name

4. Copy all the patches to the overlays to make the ebuild happy:

cp -R /usr/portage/www-client/mozilla-firefox/files /usr/local/portage/www-client/mozilla-firefox
cp -R /usr/portage/mail-client/mozilla-thunderbird/files /usr/local/portage/mail-client/mozilla-thunderbird

5. Now we need to edit the ebuilds to include our tweak:

File: mozilla-firefox-1.0.x.ebuild

Near the top of the file, you will something that looks like the following line, to which you need to add the 'branding' flag:

IUSE="branding gnome java mozdevelop mozsvg mozcalendar"

Near the middle of the file, you will find a section that looks like the following, to which you need to add the line 'mozconfig_use_enable branding official-branding':

# Other ff-specific settings
mozconfig_use_enable branding official-branding
mozconfig_use_enable mozdevelop jsd
mozconfig_use_enable mozdevelop xpctools
mozconfig_use_extension mozdevelop venkman
mozconfig_use_enable gnome gnomevfs
mozconfig_use_extension gnome gnomevfs
mozconfig_use_enable mozcalendar calendar
...

6. Repeat step 5 for the Thunderbird ebuild, in which you will find the appropriate sections in similar places.
7. Create digests for both ebuilds, otherwise portage will complain that the ebuild file is the wrong size, and ask you to resync:

ebuild /usr/local/portage/www-client/mozilla-firefox/mozilla-firefox-1.0.x.ebuild digest
ebuild /usr/local/portage/mail-client/mozilla-thunderbird/mozilla-thunderbird-1.0.x.ebuild digest

8. Add the appropriate line out of the following to your /etc/portage/package.use (make it if you don't have it):

www-client/mozilla-firefox branding
mail-client/mozilla-thunderbird branding

9. Now emerge them!

That's it - now you'll be able to instantly recognize your favorite browser in the task bar again and Thunderbird will have all that nice new artwork.

Maybe at some point this will be added to the ebuild in portage, but until then, you will have to repeat these steps for each new version of Firefox or Thunderbird that is added to the main portage tree if you want to keep the offical branding.

[edit] Add-Ons

[edit] Warning to system upgrades after installing plugins!

If you enable the nsplugin which replaces the mozilla flag in /etc/make.conf. when you go to update programs (ie. emerge -uD world) you could have unwanted apps creating plugins. For example on my machine I use gnome and mplayer, emerge updated totem with the nsplugin flag and totem became my new movie plugin. To fix it do:

# echo "media-video/totem -nsplugin" >> /etc/portage/package.use && emerge totem

[edit] Adobe Flash

If you can't install Adobe Flash plugin try the following command as root:

# chgrp wheel /usr/lib/nsbrowser/plugins/

or do it the Gentoo way (-av so it shows USE flags and asks to proceed):

# emerge netscape-flash -av

If you are running on an amd64, you also need nspluginwrapper:

# emerge nspluginwrapper -av

If the plugin plays videos and such, but does not produce sound, try this (as root):

# ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1

Create the following directory and file (as user):

# mkdir /tmp/.esd
# touch /tmp/.esd/socket

Don't forget to start the Enlightment Sound Daemon and add it to the default runlevel (as root).

# /etc/init.d/esound start
# rc-update add esound default

Restart your firefox. If that didn't help, you will want to try out Flash 9 Beta from labs.adobe.com. This is also the way to go if you're testing Firefox 2.

[edit] Adobe Acrobat Reader

Make sure you have nsplugin set in your /etc/make.conf file and do

# emerge -av acroread

make sure it says +nsplugin not -nsplugin so that it looks like this:

Code:
These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] app-text/acroread-7.0.1.1  +ldap +nsplugin 0 kB 

Total size of downloads: 0 kB

Note: This works for the mozilla and Epiphany 1.8.2 browsers also.

If you have problems with the pdf being displayed correctly then load acroread and change the dpi setting in the preferences menu

[edit] Acrobat Reader External Links

[edit] gxine for audio/video stream

Make sure you have nsplugin set in your /etc/make.conf file and do

# USE="nsplugin" emerge -av gxine

make sure it says +nsplugin not -nsplugin so that it looks like this:

Code:
These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] media-video/gxine-0.4.9  -lirc +nls +nsplugin 0 kB

Total size of downloads: 0 kB

Do you want me to merge these packages? [Yes/No]


You should now be able to browse to about:plugins in firefox to see your gxine plugin. If not, check your symlinks in your firefox plugin directory. Now make symlinks in /opt/netscape/plugins to the libraries in /usr/lib/gxine and you are ready to go. Note that gxine will by default play videos as 50% size. Just go into gxine's preferences the first time you play a video and change that to be 100%.

#  cd /usr/lib/nsbrowser/plugins
#  ln -s /usr/lib/gxine/gxinelibplugin.so .

This plugin is nice enough for playing asf, but for most things the mplayerplug-in package is a better.

[edit] FireBug

(Firebug) is an excellent plugin for AJAX development. In order to get it working, compile firefox with use flag mozdevelop. Source: Firebug group.

Personal tools