Difference between revisions of "Firefox"

From MythTV Official Wiki
Jump to: navigation, search
m
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
You might want to use [http://www.mozilla.com/firefox/ 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, page-zoom, single-window-mode).
+
You might want to use [http://www.mozilla.com/firefox/ 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).
  
== Configuration ==
+
In addition to these instructions, there are some helpful tools described in the [[AmazonVideo]] topic.
Simply replace ''/usr/bin/mythbrowser'' with ''/usr/bin/firefox'' in [[User_Manual:Detailed_configuration_Frontend#Web_Settings|Configuration: Web Settings]]
+
 
 +
== MythTV Configuration ==
 +
 
 +
Simply replace ''internal'' with ''/usr/bin/firefox %URL%'' in [[User_Manual:Detailed_configuration_Frontend#Web_Settings|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:
 
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:
Line 11: Line 14:
 
  firefox -P default
 
  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.
 
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 ==
 
== 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 [http://addons.mozilla.org/en-US/firefox/ Firefox Addons] website.
 +
 
* [http://www.krickelkrackel.de/autohide/ 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:
 
* [http://www.krickelkrackel.de/autohide/ 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
 
  /usr/bin/firefox --fullscreen
* [http://addons.mozilla.org/en-US/firefox/addon/1499 PageZoom] - Allows users to '''magnify the whole page''' (not just the font size), but it does not work as well as MythBrowser's page zoom. To have a default page size check the configuration of the addon. It is sometimes possible to remove intrusive images and panels that overlap with text as a result of using PageZoom from websites that you commonly visit using [http://addons.mozilla.org/en-US/firefox/addon/1865 Adblock Plus] together with [http://addons.mozilla.org/en-US/firefox/addon/4364 Adblock Plus: Element Hiding], or with [http://addons.mozilla.org/en-US/firefox/addon/737 Platypus] and [http://addons.mozilla.org/en-US/firefox/addon/748 Greasemonkey], or with [http://addons.mozilla.org/en-US/firefox/addon/2108 Stylish] (see below).
+
* [https://addons.mozilla.org/en-US/firefox/addon/full-fullscreen/ Full Fullscreen] Alternative solution to get a nice fullscreen mode, works OK in 3.5.
* [http://addons.mozilla.org/en-US/firefox/addon/1122 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.
+
* [http://addons.mozilla.org/en-US/firefox/addon/1122 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
* [http://mozilla.dorando.at/readme.html Keyconfig] - Allows users to change the key bindings of common firefox shortcuts. Useful for people with limited remote controls.
+
* [http://mozilla.dorando.at/readme.html Keyconfig] - Allows users to change the key bindings of common firefox shortcuts. Useful for people with limited remote controls. OK in vers 3.5
* [http://addons.mozilla.org/en-US/firefox/addon/6420 NumberFox] and [http://addons.mozilla.org/en-US/firefox/addon/2580 FocusingFrame] - Provide two different ways to select links on pages without using a mouse.
+
* [http://addons.mozilla.org/en-US/firefox/addon/6420 NumberFox], [http://addons.mozilla.org/en-US/firefox/addon/2580 FocusingFrame] and  [http://elder-gods.org/lol LoL] - Provides three different ways to select links on pages without using a mouse. LoL OK in 3.5
* [http://addons.mozilla.org/en-US/firefox/addon/57 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 [http://www.lirc.org/html/irxevent.html irxevent].
+
* [http://addons.mozilla.org/en-US/firefox/addon/57 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 [http://www.lirc.org/html/irxevent.html irxevent] (not strictly required when using xdotool).
 
* [http://userscripts.org/scripts/show/30887 Cellphone Keyboard] - [http://addons.mozilla.org/en-US/firefox/addon/748 Greasemonkey] script that uses number keys like a cellphone to type text into forms.  Useful if you only have a remote with number keys.
 
* [http://userscripts.org/scripts/show/30887 Cellphone Keyboard] - [http://addons.mozilla.org/en-US/firefox/addon/748 Greasemonkey] script that uses number keys like a cellphone to type text into forms.  Useful if you only have a remote with number keys.
* [http://addons.mozilla.org/en-US/firefox/addon/2108 Stylish] - Can be used to tweak pages to make them more readable, especially if they have been mangled by the PageZoom addon.  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:
+
* [http://addons.mozilla.org/en-US/firefox/addon/2108 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:
 
<pre>
 
<pre>
 
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(file://) {
 
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(file://) {
Line 33: Line 47:
 
}
 
}
 
</pre>
 
</pre>
 +
* [http://addons.mozilla.org/en-US/firefox/addon/1217 My Portal] - View bookmarks as a conveniently browsable web page.
 +
 +
== Lirc configuration ==
 +
Firefox has a reasonable single key interface documented [http://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard shortcuts]
 +
You might want to use  [http://www.semicomplete.com/projects/xdotool/ 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:
 +
<pre>
 +
#!/bin/sh
 +
/usr/bin/firefox ${11}
 +
exit 0
 +
</pre>
 +
 +
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
 +
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Latest revision as of 20:06, 8 May 2012

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).

In addition to these instructions, there are some helpful tools described in the AmazonVideo topic.

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