Throbber URL: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (cat change)
(rewrite for version 2)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
:''This article applies to Firefox, Mozilla Suite, and Thunderbird.''
:''This article applies to Firefox, Thunderbird and SeaMonkey.''


Want to change where the [[Commonly Used Words#Browser-Related Terms | throbber]] (or activity indicator) takes you?
The ''throbber'' is an image at the right of the main toolbar that animates when a server connection is active. Its appearance might depend on the theme you are using. In the default theme, it looks like:
:{|
|-
|style="padding-left:1ex;"|[[Image:Throbber.png]]
|style="line-height:24px;"|Firefox or Thunderbird<br>SeaMonkey
|}


== Firefox ==
In older versions of Firefox and Thunderbird you could click the throbber to open a URL. This feature is still present in SeaMonkey, and you can restore it in Firefox and Thunderbird. For information about preference settings for older versions, see an [http://kb.mozillazine.org/index.php?title=Throbber_URL&oldid=31560 older&nbsp;version] of this article.
#Go to [[about:config]] (through your Location Bar).
#Type ''throbber'' into the filter bar.
#Right-click on the value for ''browser.throbber.url'' and choose "Modify".
#Change the value to the URL you would like to be taken to (e.g., ''<nowiki>http://kb.mozillazine.org</nowiki>'').
# Restart Firefox if the new setting does not take effect immediately.


== Mozilla Suite ==
==Firefox==
You can configure the Mozilla Suite throbber URLs separately for each window. For instance, you could have the Navigator throbber take you to one URL and the Mail & Newsroups throbber take you to a different URL.
To make the throbber clickable so that it opens various URLs, depending on how you click it, you can use the [https://addons.mozilla.org/en-US/firefox/addon/2821 Throbber Button] extension.


#Go to [[about:config]] (through your Location Bar).
Alternatively, use the userChrome.css method described for Thunderbird in the next section, which does not require any extension.
#Type ''throbber'' into the filter bar.
#For each throbber URL that you would like to change (see options below), right-click on the corresponding value and choose "Modify".
#Change the value to the URL you would like to be taken to (e.g., ''<nowiki>http://kb.mozillazine.org</nowiki>'').
#Restart Mozilla Suite if the new settings do not take effect immediately.


=== Navigator ===
==Thunderbird==
:browser.throbber.url (''Shared'')
In Thunderbird you can make the throbber clickable either so that it opens a URL in your default browser (for example, Firefox) or so that it
=== Mail & Newsgroups ===
opens a URL in Thunderbird itself (in the message pane).
:browser.throbber.url (''Shared'')
 
=== Address Book ===
There are two ways to customize Thunderbird. You can use a [[UserChrome.css|userChrome.css]] file, which does not require any extension but can only open a URL in your default browser. Or you can install and use the [[UserChrome.js|userChrome.js]] extension.
:addressbook.throbber.url
 
=== Composer ===
===Using userChrome.css===
:compose.throbber.url
To open a URL in your default browser, add this line to your [[UserChrome.css|userChrome.css]] file:
=== Editor ===
 
:editor.throbber.url
#throbber-box {-moz-binding: url(userChrome.xml#throbber);}
=== IRC Chat ===
 
:messenger.throbber.url
Make a new text file named <tt>userChrome.xml</tt> in the same directory as userChrome.css.  Copy and paste the new file's content from here:
<pre><nowiki>
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE bindings [
  &lt;!ENTITY url "http://kb.mozillazine.org/"&gt;
  &lt;!ENTITY tip "Mozillazine Knowledge Base"&gt;
  ]&gt;
 
&lt;bindings id="throbber-bindings" xmlns="http://www.mozilla.org/xbl"
  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
&lt;binding id="throbber"&gt;
  &lt;content&gt;
    &lt;xul:label class="text-link" href="&url;"
        style="-moz-user-focus: ignore; margin: 0; height: 22px;"&gt;
      &lt;xul:stack&gt;
        &lt;children/&gt;
        &lt;xul:box tooltiptext="&tip;" style="cursor: pointer;"/&gt;
        &lt;/xul:stack&gt;
      &lt;/xul:label&gt;
    &lt;/content&gt;
  &lt;/binding&gt;
&lt;/bindings&gt;
</nowiki></pre>
Customize the URL and tooltip near the top of the new file.
 
Save the files and restart Thunderbird.
 
'''Note:&nbsp;''' If this makes the menu bar jump upward occasionally, increase the value <tt>22px</tt> in the new file, or if it jumps downward
decrease the value. The right value depends on the theme you are using.
 
===Using the userChrome.js extension===
To open a URL in Thunderbird's message pane, add this code to your [[UserChrome.js|userChrome.js]] file. When you copy it from this page, make sure that you scroll to get all of the code:
 
<div style="height: 20em; overflow: auto;"><pre>
ThrobberLink = {
 
  // customize:
  tip: "Mozillazine",
  url: "http://www.mozillazine.org/",
 
  click: function () {
    gMessageNotificationBar.clearMsgNotifications()
    ClearMessageSelection()
    ClearMessagePane()
    ShowThreadPane()
    if (IsMessagePaneCollapsed()) MsgToggleMessagePane()
    GetMessagePaneFrame().location.href = this.url
    },
 
  load: function (win) {
    var btn = win.document.getElementById("navigator-throbber")
    if (!btn) return
 
    win.ThrobberLink = this
    with (btn)
      removeAttribute("disabled"),
      setAttribute("oncommand", "ThrobberLink.click()"),
      setAttribute("tooltiptext", ThrobberLink.tip),
      style.cursor = "pointer"
    },
 
  observe: function (win, act) {
    if (act = "domwindowopened")
      win.QueryInterface(Components.interfaces.nsIDOMEventTarget)
        .addEventListener(
          "load",
          function () {ThrobberLink.load(
            win.QueryInterface(Components.interfaces.nsIDOMWindow))},
          false
          )
    }
 
  }


==Thunderbird==
ThrobberLink.load(self)
Thunderbird has throbbers displayed in the main window, the Compose window, and the Address Book window. You can change the throbber URL for each separately. For each that you want to change, exit Thunderbird and add the appropriate lines of code below into your [[user.js file]], replacing <tt><nowiki>"http://kb.mozillazine.org/"</nowiki></tt> in the examples below with whatever URL you want to use. You can also change these settings through [[about:config]].
 
Components
  .classes["@mozilla.org/embedcomp/window-watcher;1"]
  .getService(Components.interfaces.nsIWindowWatcher)
  .registerNotification(ThrobberLink)
</pre></div>
 
Customize the tip and the URL near the top, making sure that you only change text between the double-quote characters.
 
To open the URL in your default browser, modify the code replacing the <tt>click</tt> section with:


===Main Window===
click: function () {
  messenger.launchExternalURL(this.url)
  },


// Change throbber URL in main window
==SeaMonkey==
user_pref("messenger.throbber.url", "<nowiki>http://kb.mozillazine.org/</nowiki>");
You can configure SeaMonkey throbber URLs separately for each window by setting the following [[Editing configuration#Modifying preferences|preferences]]:


===Compose window===
:{|style="border-spacing:1em 0;"
// Change throbber URL in Compose window
|-
user_pref("compose.throbber.url", "<nowiki>http://kb.mozillazine.org/</nowiki>");
|Navigator||<tt>browser.throbber.url</tt>
|-
|Mail & Newsgroups||<tt>browser.throbber.url</tt>
|-
|Address Book||<tt>addressbook.throbber.url</tt>
|-
|Composer||<tt>compose.throbber.url</tt>
|-
|Editor||<tt>editor.throbber.url</tt>
|-
|IRC Chat||<tt>messenger.throbber.url</tt>
|}


===Address Book window===
==See also==
// Change throbber URL in Address Book window
*[[About protocol links]]
user_pref("addressbook.throbber.url", "<nowiki>http://kb.mozillazine.org/</nowiki>");
*[[Start Page for mail]]


[[Category:Configuration]]
[[Category:Configuration]]
[[Category: Extensions (Firefox)]]
[[Category:Configuration (Thunderbird)]]

Latest revision as of 10:19, 8 May 2007

This article applies to Firefox, Thunderbird and SeaMonkey.

The throbber is an image at the right of the main toolbar that animates when a server connection is active. Its appearance might depend on the theme you are using. In the default theme, it looks like:

Firefox or Thunderbird
SeaMonkey

In older versions of Firefox and Thunderbird you could click the throbber to open a URL. This feature is still present in SeaMonkey, and you can restore it in Firefox and Thunderbird. For information about preference settings for older versions, see an older version of this article.

Firefox

To make the throbber clickable so that it opens various URLs, depending on how you click it, you can use the Throbber Button extension.

Alternatively, use the userChrome.css method described for Thunderbird in the next section, which does not require any extension.

Thunderbird

In Thunderbird you can make the throbber clickable either so that it opens a URL in your default browser (for example, Firefox) or so that it opens a URL in Thunderbird itself (in the message pane).

There are two ways to customize Thunderbird. You can use a userChrome.css file, which does not require any extension but can only open a URL in your default browser. Or you can install and use the userChrome.js extension.

Using userChrome.css

To open a URL in your default browser, add this line to your userChrome.css file:

#throbber-box {-moz-binding: url(userChrome.xml#throbber);}

Make a new text file named userChrome.xml in the same directory as userChrome.css. Copy and paste the new file's content from here:

 <?xml version="1.0"?>
 <!DOCTYPE bindings [
   <!ENTITY url "http://kb.mozillazine.org/">
   <!ENTITY tip "Mozillazine Knowledge Base">
   ]>

 <bindings id="throbber-bindings" xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <binding id="throbber">
   <content>
     <xul:label class="text-link" href="&url;"
         style="-moz-user-focus: ignore; margin: 0; height: 22px;">
       <xul:stack>
         <children/>
         <xul:box tooltiptext="&tip;" style="cursor: pointer;"/>
         </xul:stack>
       </xul:label>
     </content>
   </binding>
 </bindings>

Customize the URL and tooltip near the top of the new file.

Save the files and restart Thunderbird.

Note:  If this makes the menu bar jump upward occasionally, increase the value 22px in the new file, or if it jumps downward decrease the value. The right value depends on the theme you are using.

Using the userChrome.js extension

To open a URL in Thunderbird's message pane, add this code to your userChrome.js file. When you copy it from this page, make sure that you scroll to get all of the code:

ThrobberLink = {

  // customize:
  tip: "Mozillazine",
  url: "http://www.mozillazine.org/",

  click: function () {
    gMessageNotificationBar.clearMsgNotifications()
    ClearMessageSelection()
    ClearMessagePane()
    ShowThreadPane()
    if (IsMessagePaneCollapsed()) MsgToggleMessagePane()
    GetMessagePaneFrame().location.href = this.url
    },

  load: function (win) {
    var btn = win.document.getElementById("navigator-throbber")
    if (!btn) return

    win.ThrobberLink = this
    with (btn)
      removeAttribute("disabled"),
      setAttribute("oncommand", "ThrobberLink.click()"),
      setAttribute("tooltiptext", ThrobberLink.tip),
      style.cursor = "pointer"
    },

  observe: function (win, act) {
    if (act = "domwindowopened")
      win.QueryInterface(Components.interfaces.nsIDOMEventTarget)
        .addEventListener(
          "load",
          function () {ThrobberLink.load(
            win.QueryInterface(Components.interfaces.nsIDOMWindow))},
          false
          )
    }

  }

ThrobberLink.load(self)

Components
  .classes["@mozilla.org/embedcomp/window-watcher;1"]
  .getService(Components.interfaces.nsIWindowWatcher)
  .registerNotification(ThrobberLink)

Customize the tip and the URL near the top, making sure that you only change text between the double-quote characters.

To open the URL in your default browser, modify the code replacing the click section with:

click: function () {
  messenger.launchExternalURL(this.url)
  },

SeaMonkey

You can configure SeaMonkey throbber URLs separately for each window by setting the following preferences:

Navigator browser.throbber.url
Mail & Newsgroups browser.throbber.url
Address Book addressbook.throbber.url
Composer compose.throbber.url
Editor editor.throbber.url
IRC Chat messenger.throbber.url

See also