Chrome URLs: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
(browser.xul)
(28 intermediate revisions by 19 users not shown)
Line 1: Line 1:
Stolen from [http://www.squarefree.com/archives/000007.html Squarefree]:
To overlay an existing XUL element, you first need the URL of its chrome.
== Finding Chrome URLs not listed below ==
If you can open the desired chrome element in its own window or popup, make sure you have the [https://addons.mozilla.org/en-US/firefox/addon/6622 DOM Inspector extension] installed (it comes bundled with some applications, not with others), then:
* Open your chrome element's window
* Start the DOM Inspector via the appropriate submenu or sub-submenu of the Tools menu (its exact location varies between applications, and with the presence or absence of some other extensions), or by hitting Ctrl+Shift+I
* In the DOM Inspector window, use the "File => Inspect Chrome Document" menuitem to select your chrome element's window
* The desired chrome URL should appear in the DOM Inspector's URL bar.


==Firefox Only==
=== Search for chrome content ===
You can also use a Mozilla code search tool such as MXR to find the source files for chrome content by searching for text in the content.
Note that toolkit code assembles much of the text you see from smaller bits of text to ease localization. For example, if you see "Welcome to SeaMonkey Help", the chrome content is actually "Welcome to &brandShortName; Help".  So if you don't get a search result try searching for something smaller.
 
=== Chrome URLs map to file locations ===
However, note that toolkit code maps chrome URLs to locale-specific directories, for example SeaMonkey's
chrome://locale/communicator/help/welcome_help.xhtml maps to the file
/chrome/en-US/locale/en-US/help/firefox_welcome.xhtml (for someone with the U.S. English build of SeaMonkey).
 
=== Look in omni.ja ===
In 2011 and later versions of Firefox and SeaMonkey, most built-in chrome content is packaged inside the single large file <tt>omni.ja</tt>. This is a JAR file which uses a special variant of the ZIP file compression format. So you can explore this with most "unzip" tools to look at its contents. The compression variant is optimized for read ahead access.
 
==== jar: to look at ZIP content in the browser ====
Firefox and SeaMonkey support the "jar:" URL protocol to access content in ZIP files. If you load a chrome URL, then view its URL or choose Page Info, you may see the URL transform to something like
 
jar:file:///''path/to/seamonkey program''/omni.ja!/chrome/en-US/locale/en-US/help/firefox_welcome.xhtml
 
An expert user can edit these URLs to investigate the contents of omni.ja (or in fact any locale zip file), although the user interface is quirky and error handling non-existent.
 
==All Toolkit applications==
Firefox, Thunderbird, Sunbird, SeaMonkey (2.0a1pre and later), ...<br>&nbsp;<br>
<div style="border: 2px solid blue; background-color: yellow; font-weight: bold">&nbsp;<br>&nbsp;This section is incomplete. If you know what's missing, please fill it in.<br>&nbsp;</div>
&nbsp;<br>
{| border="1" cellpadding="5" rules="all"
! Function !! URL
|-
|Add-ons || chrome://mozapps/content/extensions/extensions.xul
|-
| DOM Inspector || chrome://inspector/content/inspector.xul
|}
 
==Firefox==
{| border="1" cellpadding="5" rules="all"
{| border="1" cellpadding="5" rules="all"
! Function !! URL
! Function !! URL
Line 7: Line 44:
| Main Window || chrome://browser/content/browser.xul
| Main Window || chrome://browser/content/browser.xul
|-
|-
| Options || chrome://browser/content/pref/pref.xul
| Options || chrome://browser/content/preferences/preferences.xul <br /> Firefox 1.5: chrome://browser/content/pref/pref.xul
|-
| Privacy Options || chrome://browser/content/pref/pref-privacy.xul
|-
|-
| Bookmark Manager || chrome://browser/content/bookmarks/bookmarksManager.xul
|Library || chrome://browser/content/places/places.xul  <br /> Firefox 1.5: chrome://browser/content/bookmarks/bookmarksManager.xul
|-
|-
| Bookmark Panel || chrome://browser/content/bookmarks/bookmarksPanel.xul
| Bookmark Panel || chrome://browser/content/bookmarks/bookmarksPanel.xul
Line 17: Line 52:
| History Panel || chrome://browser/content/history/history-panel.xul
| History Panel || chrome://browser/content/history/history-panel.xul
|-
|-
| Javascript Console || chrome://global/content/console.xul
| Downloads || chrome://mozapps/content/downloads/downloads.xul
|-  
|-
| Master Password || chrome://pippki/content/pref-masterpass.xul
| Clear Private Data || chrome://browser/content/sanitize.xul
|-
| Saved Passwords || chrome://passwordmgr/content/passwordManager.xul
|-
| Error Console || chrome://global/content/console.xul
|-
| Manage Cookies || chrome://browser/content/preferences/cookies.xul
|}
 
 
===Firefox Help Links===
{| border="1" cellpadding="5" rules="all"
! Function !! URL
|-
| Mozilla Firefox Help || chrome://help/locale/firefox_welcome.xhtml
|-
| Using the Help Window || chrome://help/locale/welcome.xhtml
|-
| Using Mozilla Firefox || chrome://help/locale/using_firebird.xhtml
|-
| Using the Download Manager || chrome://help/locale/download_manager.xhtml
|-
| Customization || chrome://help/locale/customization.xhtml
|-
| Options (Preferences) || chrome://help/locale/prefs.xhtml
|-
| Controlling Popups || chrome://help/locale/popup.xhtml
|-
| Managing Cookies || chrome://help/locale/cookies.xhtml
|-
| Tabbed Browsing || chrome://help/locale/tabbed_browsing.xhtml
|-
| Keyboard Shortcuts || chrome://help/locale/shortcuts.xhtml
|-
| Mouse Shortcuts || chrome://help/locale/mouse_shortcuts.xhtml
|-
| Menu Reference || chrome://help/locale/menu_reference.xhtml
|-
| Help for Internet Explorer Users || chrome://help/locale/forieusers.xhtml
|-
|-
| Download Manager || chrome://mozapps/content/downloads/downloads.xul
| Glossary || chrome://help/locale/glossary.xhtml
|}
|}


==Mozilla Suite Only==
==Thunderbird==
&nbsp;<br>
<div style="border: 2px solid blue; background-color: yellow; font-weight: bold">&nbsp;<br>&nbsp;Please fill in.<br>&nbsp;</div>
 
==SeaMonkey 2.0 and later==
<div style="border: 2px solid blue; background-color: yellow; padding: 1em; text-align: center">Most "2.0 and later" URLs are missing: Please complete.</div>
&nbsp;<br>
{| border="1" cellpadding="5" rules="all"
{| border="1" cellpadding="5" rules="all"
! Function !! URL
! Function !! URL
|-
| Main help || chrome://help/content/help.xul
|}
=== early Mozilla Suite and SeaMonkey 1.0/1.1===
{| border="1" cellpadding="5" rules="all"
! Function !! URL
|-
| Main Window || chrome://navigator/content/navigator.xul
|-
| Search Panel || chrome://communicator/content/search/search-panel.xul
|-
| Bookmark Panel || chrome://communicator/content/bookmarks/bm-panel.xul
|-
| History Panel || chrome://communicator/content/history/history-panel.xul
|-
| Addressbook Panel || chrome://messenger/content/addressbook/addressbook-panel.xul
|-
| Bookmark Manager || chrome://communicator/content/bookmarks/bookmarksManager.xul
|-
| History Window || chrome://communicator/content/history/history.xul
|-
| Manage Cookies || chrome://communicator/content/permissions/cookieViewer.xul
|-
| Image Permissions || chrome://communicator/content/permissions/permissionsManager.xul
|-
| Manage Popups || chrome://communicator/content/permissions/permissionsManager.xul
|-
| Preferences || chrome://communicator/content/pref/pref.xul
|-
| Saved Passwords || chrome://communicator/content/wallet/SignonViewer.xul
|-
| Error Console || chrome://global/content/console.xul
|-
| DOM Inspector || chrome://inspector/content/inspector.xul
|-
|-
| Mail & News || chrome://messenger/content/messenger.xul
| Mail & News || chrome://messenger/content/messenger.xul
|-
| Address Book || chrome://messenger/content/addressbook/addressbook.xul
|-
| Composer || chrome://editor/content/editor.xul
|-
|-
| Chatzilla || chrome://chatzilla/content/chatzilla.xul
| Chatzilla || chrome://chatzilla/content/chatzilla.xul
|-
|-
| Calendar || chrome://calendar/content/calendar.xul
| Calendar || chrome://calendar/content/calendar.xul
|-
| Preferences || chrome://communicator/content/pref/pref.xul
|-
| History Window || chrome://communicator/content/history/history.xul
|}
|}
==Sunbird==
&nbsp;<br>
<div style="border: 2px solid blue; background-color: yellow; font-weight: bold">&nbsp;<br>&nbsp;Please fill in.<br>&nbsp;</div>
==Camino==
&nbsp;<br>
<div style="border: 2px solid blue; background-color: yellow; font-weight: bold">&nbsp;<br>&nbsp;Please fill in.<br>&nbsp;</div>
== Using the chrome URL ==
Once you've got your chrome URL you can load it (by typing it in the location bar), and use the DOM inspector's click-to-select tool to locate the element and get its ID.
== See Also ==
* [[Dev : Firefox Chrome URLs]].
== External Links ==
* [http://www.squarefree.com/archives/000007.html Squarefree's Chrome URLs]
[[Category:Development]]

Revision as of 22:13, 16 October 2015

To overlay an existing XUL element, you first need the URL of its chrome.

Finding Chrome URLs not listed below

If you can open the desired chrome element in its own window or popup, make sure you have the DOM Inspector extension installed (it comes bundled with some applications, not with others), then:

  • Open your chrome element's window
  • Start the DOM Inspector via the appropriate submenu or sub-submenu of the Tools menu (its exact location varies between applications, and with the presence or absence of some other extensions), or by hitting Ctrl+Shift+I
  • In the DOM Inspector window, use the "File => Inspect Chrome Document" menuitem to select your chrome element's window
  • The desired chrome URL should appear in the DOM Inspector's URL bar.

Search for chrome content

You can also use a Mozilla code search tool such as MXR to find the source files for chrome content by searching for text in the content. Note that toolkit code assembles much of the text you see from smaller bits of text to ease localization. For example, if you see "Welcome to SeaMonkey Help", the chrome content is actually "Welcome to &brandShortName; Help". So if you don't get a search result try searching for something smaller.

Chrome URLs map to file locations

However, note that toolkit code maps chrome URLs to locale-specific directories, for example SeaMonkey's chrome://locale/communicator/help/welcome_help.xhtml maps to the file /chrome/en-US/locale/en-US/help/firefox_welcome.xhtml (for someone with the U.S. English build of SeaMonkey).

Look in omni.ja

In 2011 and later versions of Firefox and SeaMonkey, most built-in chrome content is packaged inside the single large file omni.ja. This is a JAR file which uses a special variant of the ZIP file compression format. So you can explore this with most "unzip" tools to look at its contents. The compression variant is optimized for read ahead access.

jar: to look at ZIP content in the browser

Firefox and SeaMonkey support the "jar:" URL protocol to access content in ZIP files. If you load a chrome URL, then view its URL or choose Page Info, you may see the URL transform to something like

jar:file:///path/to/seamonkey program/omni.ja!/chrome/en-US/locale/en-US/help/firefox_welcome.xhtml

An expert user can edit these URLs to investigate the contents of omni.ja (or in fact any locale zip file), although the user interface is quirky and error handling non-existent.

All Toolkit applications

Firefox, Thunderbird, Sunbird, SeaMonkey (2.0a1pre and later), ...
 

 
 This section is incomplete. If you know what's missing, please fill it in.
 

 

Function URL
Add-ons chrome://mozapps/content/extensions/extensions.xul
DOM Inspector chrome://inspector/content/inspector.xul

Firefox

Function URL
Main Window chrome://browser/content/browser.xul
Options chrome://browser/content/preferences/preferences.xul
Firefox 1.5: chrome://browser/content/pref/pref.xul
Library chrome://browser/content/places/places.xul
Firefox 1.5: chrome://browser/content/bookmarks/bookmarksManager.xul
Bookmark Panel chrome://browser/content/bookmarks/bookmarksPanel.xul
History Panel chrome://browser/content/history/history-panel.xul
Downloads chrome://mozapps/content/downloads/downloads.xul
Clear Private Data chrome://browser/content/sanitize.xul
Saved Passwords chrome://passwordmgr/content/passwordManager.xul
Error Console chrome://global/content/console.xul
Manage Cookies chrome://browser/content/preferences/cookies.xul


Firefox Help Links

Function URL
Mozilla Firefox Help chrome://help/locale/firefox_welcome.xhtml
Using the Help Window chrome://help/locale/welcome.xhtml
Using Mozilla Firefox chrome://help/locale/using_firebird.xhtml
Using the Download Manager chrome://help/locale/download_manager.xhtml
Customization chrome://help/locale/customization.xhtml
Options (Preferences) chrome://help/locale/prefs.xhtml
Controlling Popups chrome://help/locale/popup.xhtml
Managing Cookies chrome://help/locale/cookies.xhtml
Tabbed Browsing chrome://help/locale/tabbed_browsing.xhtml
Keyboard Shortcuts chrome://help/locale/shortcuts.xhtml
Mouse Shortcuts chrome://help/locale/mouse_shortcuts.xhtml
Menu Reference chrome://help/locale/menu_reference.xhtml
Help for Internet Explorer Users chrome://help/locale/forieusers.xhtml
Glossary chrome://help/locale/glossary.xhtml

Thunderbird

 

 
 Please fill in.
 

SeaMonkey 2.0 and later

Most "2.0 and later" URLs are missing: Please complete.

 

Function URL
Main help chrome://help/content/help.xul

early Mozilla Suite and SeaMonkey 1.0/1.1

Function URL
Main Window chrome://navigator/content/navigator.xul
Search Panel chrome://communicator/content/search/search-panel.xul
Bookmark Panel chrome://communicator/content/bookmarks/bm-panel.xul
History Panel chrome://communicator/content/history/history-panel.xul
Addressbook Panel chrome://messenger/content/addressbook/addressbook-panel.xul
Bookmark Manager chrome://communicator/content/bookmarks/bookmarksManager.xul
History Window chrome://communicator/content/history/history.xul
Manage Cookies chrome://communicator/content/permissions/cookieViewer.xul
Image Permissions chrome://communicator/content/permissions/permissionsManager.xul
Manage Popups chrome://communicator/content/permissions/permissionsManager.xul
Preferences chrome://communicator/content/pref/pref.xul
Saved Passwords chrome://communicator/content/wallet/SignonViewer.xul
Error Console chrome://global/content/console.xul
DOM Inspector chrome://inspector/content/inspector.xul
Mail & News chrome://messenger/content/messenger.xul
Address Book chrome://messenger/content/addressbook/addressbook.xul
Composer chrome://editor/content/editor.xul
Chatzilla chrome://chatzilla/content/chatzilla.xul
Calendar chrome://calendar/content/calendar.xul

Sunbird

 

 
 Please fill in.
 

Camino

 

 
 Please fill in.
 

Using the chrome URL

Once you've got your chrome URL you can load it (by typing it in the location bar), and use the DOM inspector's click-to-select tool to locate the element and get its ID.

See Also

External Links