Firefox

From MythTV Official Wiki
Revision as of 05:08, 18 November 2011 by Leamas (Talk | contribs)

Jump to: navigation, search

You might want to use Firefox as the integrated MythBrowser, although there are some limitations. You can still use the MythTV bookmark manager to launch webpages. Firefox might need some addons to behave similiarly to MythBrowser (fullscreen, single-window-mode).

MythTV Configuration

Simply replace internal with /usr/bin/firefox %URL% in Configuration: Web Settings

If you are using Firefox on a machine that you also use as a desktop computer, you may wish to use a separate Firefox profile to keep your MythTV browsing separate from your usual browsing. You can create a new profile by starting Firefox from the commandline like this:

firefox -ProfileManager

Then if you create a profile called "mythtv" you can launch Firefox using that profile with:

firefox -P mythtv

You can then install addons and configure this profile totally separately from your default profile. Your default profile can be accessed like this:

firefox -P default

If you have no other instances of Firefox running then simply running Firefox with no arguments will use the default profile. However, if an instance of Firefox is already running using a profile that is not the default, then running Firefox without any arguments will open a new browser window using the same profile as the window already open.

Firefox configuration

By default, FF tries to restore state from last session when invoked. This is probably not what you want here, you'd rather see it start with the same state each time. This is governed by the browser.sessionstore.* about:config variables. An initial attempt for version 3.5+:

   - Set browser.sessionstore.max_tabs_undo to 0
   - Set browser.sessionstore.max_windows_undo to 0
   - Set browser.sessionstore.resume_from_crash to false


Addons

The following Firefox addons have been confirmed to work with Firefox 2, but may not work with Firefox 3, and some of them do not appear to be maintained by their authors any longer. Where possible, links to addons are to the official Firefox Addons website.

  • Autohide - for a nice fullscreen mode. You decide which toolbars you like to have. Install the extension and change the commandline to have a fullscreen mode on startup:
/usr/bin/firefox --fullscreen
  • Full Fullscreen Alternative solution to get a nice fullscreen mode, works OK in 3.5.
  • Tab Mix Plus - enhanced tab preferences with many options including a single-window-mode where everything is opened in a new tab instead of a new window. OK in vers 3.5
  • Keyconfig - Allows users to change the key bindings of common firefox shortcuts. Useful for people with limited remote controls. OK in vers 3.5
  • NumberFox, FocusingFrame and LoL - Provides three different ways to select links on pages without using a mouse. LoL OK in 3.5
  • Titlebar Tweaks - Use this to change the browser window's titlebar to display only the application name, so that you can send keypresses to it via LIRC with irxevent (not strictly required when using xdotool).
  • Cellphone Keyboard - Greasemonkey script that uses number keys like a cellphone to type text into forms. Useful if you only have a remote with number keys.
  • Stylish - Can be used to tweak pages to make them more readable. Can also be used to highlight focused links to make them clearly visible from a distance, for easy browsing with TAB and SHIFT-TAB keys. For example, this can be achieved using the following style with Stylish:
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(file://) {
  a:focus {color: red !important; background: yellow !important}
  :focus img {border-width: thick !important; border-color: red !important; border-style: solid !important}
  input:focus, textarea:focus {color: red !important; background: yellow !important}

  /* NumberFox addon displays numbers that are too small, even when set to their largest,
     and do not resize with PageZoom addon, so lets make them even bigger... */
  bbnspan.bbn_linknode {font-size: 35px !important}
}
  • My Portal - View bookmarks as a conveniently browsable web page.

Lirc configuration

Firefox has a reasonable single key interface documented Keyboard shortcuts You might want to use xdotool to send keypresses and mouse movements to firefox.

Two typical entries::

       begin
           prog = irexec
           button = KEY_CHANNELUP
           config = env DISPLAY=:0 xdotool key ctrl+plus
           flags = quit
       end
       begin
           prog = irexec
           button = KEY_UP
           config = env DISPLAY=:0 xdotool mousemove_relative 0 -10
           flags = quit
           repeat = 1
           delay = 4
       end

It makes a lot of sense to configure a separate mode in lircrc for the web browser. Use might include to redefine the arrow + OK keys to handle the mouse, and to use the numeric keys as up, down left, home etc., in the same way as a standard PC keyboard.

Troubleshooting

Firefox doesn't run

If firefox doesn't run at all after following the instructions at the top of the page then it is probably because MythTV is passing some parameters firefox doesn't like. The solution is to create a script file which acts as a wrapper to remove the bad parameters and only passes the good stuff to firefox.

Create a file called /usr/local/bin/firefox-wrapper using your text editor (e.g. nano):

sudo nano -w /usr/local/bin/firefox-wrapper

Put these lines into it:

#!/bin/sh
/usr/bin/firefox ${11}
exit 0

If using nano, you can save and exit using ctrl+x followed by y

Make this file executable using the following command:

sudo chmod 755 /usr/local/bin/firefox-wrapper

Then, back on the MythTV frontend, go to Web Settings and change the browser to

/usr/local/bin/firefox-wrapper