browser-sets.inc
Go to the documentation of this file.
1 # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 #
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
9 #
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
14 #
15 # The Original Code is Mozilla.org Code.
16 #
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 2001
20 # the Initial Developer. All Rights Reserved.
21 #
22 # Contributor(s):
23 # Ben Goodger <ben@bengoodger.com> (v2.0)
24 # Blake Ross <blakeross@telocity.com>
25 # Shawn Wilsher <me@shawnwilsher.com>
26 # Ehsan Akhgari <ehsan.akhgari@gmail.com>
27 #
28 # Alternatively, the contents of this file may be used under the terms of
29 # either the GNU General Public License Version 2 or later (the "GPL"), or
30 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 # in which case the provisions of the GPL or the LGPL are applicable instead
32 # of those above. If you wish to allow use of your version of this file only
33 # under the terms of either the GPL or the LGPL, and not to allow others to
34 # use your version of this file under the terms of the MPL, indicate your
35 # decision by deleting the provisions above and replace them with the notice
36 # and other provisions required by the GPL or the LGPL. If you do not delete
37 # the provisions above, a recipient may use your version of this file under
38 # the terms of any one of the MPL, the GPL or the LGPL.
39 #
40 # ***** END LICENSE BLOCK *****
41 
42 #ifdef XP_UNIX
43 #ifndef XP_MACOSX
44 #define XP_GNOME 1
45 #endif
46 #endif
47 
48  <stringbundleset id="stringbundleset">
49  <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
50  <stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
51  <stringbundle id="bundle_preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
52  </stringbundleset>
53 
54  <commandset id="mainCommandSet">
55  <command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
56  <command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
57  <command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
58 
59  <command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
60  <command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
61  <command id="Browser:SavePage" oncommand="saveDocument(window.content.document);"/>
62  <command id="Browser:SaveFrame" oncommand="saveFrameDocument();"/>
63 
64  <command id="Browser:SendLink"
65  oncommand="MailIntegration.sendLinkForWindow(window.content);"/>
66 
67  <command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
68  <command id="cmd_print" oncommand="PrintUtils.print();"/>
69  <command id="cmd_printPreview" oncommand="PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview);"/>
70  <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
71  <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
72  <command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
73  <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
74  <command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
75 
76 
77  <commandset id="editMenuCommands"/>
78 
79  <command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(content.document);" observes="isImage"/>
80  <command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
81  <command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
82  <command id="cmd_find"
83  oncommand="gFindBar.onFindCommand();"
84  observes="isImage"/>
85  <command id="cmd_findAgain"
86  oncommand="gFindBar.onFindAgainCommand(false);"
87  observes="isImage"/>
88  <command id="cmd_findPrevious"
89  oncommand="gFindBar.onFindAgainCommand(true);"
90  observes="isImage"/>
91  <!-- work-around bug 392512 -->
92  <command id="Browser:AddBookmarkAs"
93  oncommand="PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksMenuFolderId);"/>
94  <!-- The command is disabled for the hidden window. Otherwise its enabled
95  state is handled by the BookmarkAllTabsHandler object. -->
96  <command id="Browser:BookmarkAllTabs"
97  oncommand="gBookmarkAllTabsHandler.doCommand();"
98  disabled="true"/>
99  <command id="Browser:Home" oncommand="BrowserHome();"/>
100  <command id="Browser:Back" oncommand="BrowserBack();" disabled="true"/>
101  <command id="Browser:BackOrBackDuplicate" oncommand="BrowserBack(event);" disabled="true">
102  <observes element="Browser:Back" attribute="disabled"/>
103  </command>
104  <command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
105  <command id="Browser:ForwardOrForwardDuplicate" oncommand="BrowserForward(event);" disabled="true">
106  <observes element="Browser:Forward" attribute="disabled"/>
107  </command>
108  <command id="Browser:Stop" oncommand="BrowserStop();" disabled="true"/>
109  <command id="Browser:Reload" oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload()" disabled="true"/>
110  <command id="Browser:ReloadOrDuplicate" oncommand="BrowserReloadOrDuplicate(event)" disabled="true">
111  <observes element="Browser:Reload" attribute="disabled"/>
112  </command>
113  <command id="Browser:ReloadSkipCache" oncommand="BrowserReloadSkipCache()" disabled="true">
114  <observes element="Browser:Reload" attribute="disabled"/>
115  </command>
116  <command id="Browser:NextTab" oncommand="gBrowser.mTabContainer.advanceSelectedTab(1, true);"/>
117  <command id="Browser:PrevTab" oncommand="gBrowser.mTabContainer.advanceSelectedTab(-1, true);"/>
118  <command id="Browser:ShowAllTabs" oncommand="allTabs.open();"/>
119  <command id="cmd_fullZoomReduce" oncommand="FullZoom.reduce()"/>
120  <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
121  <command id="cmd_fullZoomReset" oncommand="FullZoom.reset()"/>
122  <command id="cmd_fullZoomToggle" oncommand="ZoomManager.toggleZoom();"/>
123  <command id="Browser:OpenLocation" oncommand="openLocation();"/>
124 
125  <command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
126  <command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
127  <command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
128  <command id="Tools:Sanitize"
129  oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
130  <command id="Tools:PrivateBrowsing" oncommand="gPrivateBrowsingUI.toggleMode();"/>
131  <command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
132  <command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
133  </commandset>
134 
135  <commandset id="placesCommands">
136  <command id="Browser:ShowAllBookmarks"
137  oncommand="PlacesCommandHook.showPlacesOrganizer('AllBookmarks');"/>
138  <command id="Browser:ShowAllHistory"
139  oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
140  </commandset>
141 
142  <broadcasterset id="mainBroadcasterSet">
143  <broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
144  type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
145  oncommand="toggleSidebar('viewBookmarksSidebar');"/>
146 
147  <!-- for both places and non-places, the sidebar lives at
148  chrome://browser/content/history/history-panel.xul so there are no
149  problems when switching between versions -->
150  <broadcaster id="viewHistorySidebar" autoCheck="false" sidebartitle="&historyButton.label;"
151  type="checkbox" group="sidebar"
152  sidebarurl="chrome://browser/content/history/history-panel.xul"
153  oncommand="toggleSidebar('viewHistorySidebar');"/>
154 
155  <broadcaster id="viewWebPanelsSidebar" autoCheck="false"
156  type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
157  oncommand="toggleSidebar('viewWebPanelsSidebar');"/>
158 
159  <!-- popup blocking menu items -->
160  <broadcaster id="blockedPopupAllowSite"
161  accesskey="&allowPopups.accesskey;"
162  oncommand="gPopupBlockerObserver.toggleAllowPopupsForSite(event);"/>
163  <broadcaster id="blockedPopupEditSettings"
164 #ifdef XP_WIN
165  label="&editPopupSettings.label;"
166 #else
167  label="&editPopupSettingsUnix.label;"
168 #endif
169  accesskey="&editPopupSettings.accesskey;"
170  oncommand="gPopupBlockerObserver.editPopupSettings();"/>
171  <broadcaster id="blockedPopupDontShowMessage"
172  accesskey="&dontShowMessage.accesskey;"
173  type="checkbox"
174  oncommand="gPopupBlockerObserver.dontShowMessage();"/>
175  <broadcaster id="blockedPopupsSeparator"/>
176  <broadcaster id="isImage"/>
177  <broadcaster id="isFrameImage"/>
178  </broadcasterset>
179 
180  <keyset id="mainKeyset">
181  <key id="key_newNavigator"
182  key="&newNavigatorCmd.key;"
183  command="cmd_newNavigator"
184  modifiers="accel"/>
185  <key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
186  <key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
187  modifiers="accel"/>
188 #ifndef XP_MACOSX
189  <key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
190  modifiers="alt"/>
191 #endif
192 
193 #
194 # Search Command Key Logic works like this:
195 #
196 # Unix: Ctrl+K (cross platform binding)
197 # Ctrl+J (in case of emacs Ctrl-K conflict)
198 # Mac: Ctrl+K (cross platform binding)
199 # Win: Ctrl+K (cross platform binding)
200 # Ctrl+E (IE compat)
201 #
202 # We support Ctrl+K on all platforms now and advertise it in the menu since it is
203 # our standard - it is a "safe" choice since it is near no harmful keys like "W" as
204 # "E" is. People mourning the loss of Ctrl+K for emacs compat can switch their GTK
205 # system setting to use emacs emulation, and we should respect it. Focus-Search-Box
206 # is a fundamental keybinding and we are maintaining a XP binding so that it is easy
207 # for people to switch to Linux.
208 #
209 # Do *not* tamper with these values without talking to ben@mozilla.org
210 #
211  <key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
212 #ifdef XP_MACOSX
213  <key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
214 #endif
215 #ifdef XP_WIN
216  <key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
217 #endif
218 #ifdef XP_GNOME
219  <key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
220  <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
221 #else
222  <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
223 #endif
224  <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift"/>
225  <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
226  <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
227  <key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
228  <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
229  <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
230  <key id="key_undo"
231  key="&undoCmd.key;"
232  modifiers="accel"/>
233 #ifdef XP_UNIX
234  <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
235 #else
236  <key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
237 #endif
238  <key id="key_cut"
239  key="&cutCmd.key;"
240  modifiers="accel"/>
241  <key id="key_copy"
242  key="&copyCmd.key;"
243  modifiers="accel"/>
244  <key id="key_paste"
245  key="&pasteCmd.key;"
246  modifiers="accel"/>
247  <key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
248  <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
249 
250  <key keycode="VK_BACK" command="cmd_handleBackspace"/>
251  <key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
252 #ifndef XP_MACOSX
253  <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
254  <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
255 #else
256  <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
257  <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
258 #endif
259 #ifdef XP_UNIX
260  <key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
261  <key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
262 #endif
263  <key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
264  <key keycode="VK_F5" command="Browser:Reload"/>
265 #ifndef XP_MACOSX
266  <key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
267  <key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
268  <key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
269 #else
270  <key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
271  <key keycode="VK_F11" command="View:FullScreen"/>
272 #endif
273  <key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
274  <key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
275  <key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
276 #ifndef XP_WIN
277  <key id="key_viewInfo" key="&pageInfoCmd.commandkey;" command="View:PageInfo" modifiers="accel"/>
278 #endif
279  <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
280  <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
281  <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
282  <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
283  <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
284 
285  <key id="addBookmarkAsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
286 # Accel+Shift+A-F are reserved on GTK2
287 #ifndef MOZ_WIDGET_GTK2
288  <key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:BookmarkAllTabs" modifiers="accel,shift"/>
289  <key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
290 #else
291  <key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
292 #endif
293  <key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
294 #ifdef XP_WIN
295 # Cmd+I is conventially mapped to Info on MacOS X, thus it should not be
296 # overridden for other purposes there.
297  <key id="viewBookmarksSidebarWinKb" key="&bookmarksWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
298 #endif
299 
300 # don't use |command="Browser:Stop"|, ESC is being used to freeze animated gifs,
301 # even if the stop button and menuitem are disabled (see Bug 284140)
302  <key id="key_stop" keycode="VK_ESCAPE" oncommand="BrowserStop();"/>
303 
304 #ifdef XP_MACOSX
305  <key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" oncommand="BrowserStop();"/>
306 #endif
307 
308  <key id="key_gotoHistory"
309  key="&historySidebarCmd.commandKey;"
310 #ifdef XP_MACOSX
311  modifiers="accel,shift"
312 #else
313  modifiers="accel"
314 #endif
315  command="viewHistorySidebar"/>
316 
317  <key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
318  <key key="&fullZoomReduceCmd.commandkey2;" command="cmd_fullZoomReduce" modifiers="accel"/>
319  <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
320  <key key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
321  <key key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
322  <key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;" command="cmd_fullZoomReset" modifiers="accel"/>
323  <key key="&fullZoomResetCmd.commandkey2;" command="cmd_fullZoomReset" modifiers="accel"/>
324 
325  <key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
326 
327  <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
328 
329  <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
330  <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
331 #ifdef XP_MACOSX
332  <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
333 #endif
334 #ifdef XP_UNIX
335  <key id="key_quitApplication" key="&quitApplicationCmdMac.key;" command="cmd_quitApplication" modifiers="accel"/>
336 #endif
337 
338  <key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
339  <key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
340 
341 #ifdef XP_GNOME
342 #define NUM_SELECT_TAB_MODIFIER alt
343 #else
344 #define NUM_SELECT_TAB_MODIFIER accel
345 #endif
346 
347 #expand <key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
348 #expand <key id="key_selectTab2" oncommand="gBrowser.selectTabAtIndex(1, event);" key="2" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
349 #expand <key id="key_selectTab3" oncommand="gBrowser.selectTabAtIndex(2, event);" key="3" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
350 #expand <key id="key_selectTab4" oncommand="gBrowser.selectTabAtIndex(3, event);" key="4" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
351 #expand <key id="key_selectTab5" oncommand="gBrowser.selectTabAtIndex(4, event);" key="5" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
352 #expand <key id="key_selectTab6" oncommand="gBrowser.selectTabAtIndex(5, event);" key="6" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
353 #expand <key id="key_selectTab7" oncommand="gBrowser.selectTabAtIndex(6, event);" key="7" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
354 #expand <key id="key_selectTab8" oncommand="gBrowser.selectTabAtIndex(7, event);" key="8" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
355 #expand <key id="key_selectLastTab" oncommand="gBrowser.selectTabAtIndex(-1, event);" key="9" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
356 
357  </keyset>
358 
359 # Used by baseMenuOverlay
360 #ifdef XP_MACOSX
361  <commandset id="baseMenuCommandSet" />
362 #endif
363  <keyset id="baseMenuKeyset" />
var menu
let window
this _contentSandbox label
Definition: FeedWriter.js:814
function BookmarkAllTabsHandler()
Definition: browser.js:6407
var hidden
var group