Source code

Revision control

Other Tools

1
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
# This Source Code Form is subject to the terms of the Mozilla Public
3
# License, v. 2.0. If a copy of the MPL was not distributed with this
4
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
6
#ifdef XP_UNIX
7
#ifndef XP_MACOSX
8
#define XP_GNOME 1
9
#endif
10
#endif
11
12
<stringbundleset id="stringbundleset"
13
string-bookmarkthispage="&bookmarkThisPageCmd.label;"
14
string-editthisbookmark="&editThisBookmarkCmd.label;">
15
<stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
16
<stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
17
</stringbundleset>
18
19
<commandset id="mainCommandSet">
20
<command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
21
<command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
22
<command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
23
24
<command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab(event);"/>
25
<command id="cmd_newNavigatorTabNoEvent" oncommand="BrowserOpenTab();"/>
26
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
27
<command id="Browser:SavePage" oncommand="saveBrowser(gBrowser.selectedBrowser);"/>
28
29
<command id="Browser:SendLink"
30
oncommand="MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);"/>
31
32
<command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
33
<command id="cmd_print" oncommand="PrintUtils.printWindow(window.gBrowser.selectedBrowser.outerWindowID, window.gBrowser.selectedBrowser);"/>
34
<command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
35
<command id="cmd_importFromAnotherBrowser" oncommand="MigrationUtils.showMigrationWizard(window, [MigrationUtils.MIGRATION_ENTRYPOINT_FILE_MENU]);"/>
36
<command id="cmd_close" oncommand="BrowserCloseTabOrWindow(event);"/>
37
<command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
38
<command id="cmd_toggleMute" oncommand="gBrowser.toggleMuteAudioOnMultiSelectedTabs(gBrowser.selectedTab)"/>
39
<command id="cmd_CustomizeToolbars" oncommand="gCustomizeMode.enter()"/>
40
<command id="cmd_toggleOfflineStatus" oncommand="BrowserOffline.toggleOfflineStatus();"/>
41
<command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
42
43
<command id="View:PageSource" oncommand="BrowserViewSource(window.gBrowser.selectedBrowser);"/>
44
<command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
45
<command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
46
<command id="View:ReaderView" oncommand="ReaderParent.toggleReaderMode(event);"/>
47
<command id="cmd_find" oncommand="gLazyFindCommand('onFindCommand')"/>
48
<command id="cmd_findAgain" oncommand="gLazyFindCommand('onFindAgainCommand', false)"/>
49
<command id="cmd_findPrevious" oncommand="gLazyFindCommand('onFindAgainCommand', true)"/>
50
#ifdef XP_MACOSX
51
<command id="cmd_findSelection" oncommand="gLazyFindCommand('onFindSelectionCommand')"/>
52
#endif
53
<!-- work-around bug 392512 -->
54
<command id="Browser:AddBookmarkAs"
55
oncommand="PlacesCommandHook.bookmarkPage();"/>
56
<command id="Browser:BookmarkAllTabs"
57
oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueCurrentPages);"/>
58
<command id="Browser:Back" oncommand="BrowserBack();" disabled="true"/>
59
<command id="Browser:BackOrBackDuplicate" oncommand="BrowserBack(event);" disabled="true">
60
<observes element="Browser:Back" attribute="disabled"/>
61
</command>
62
<command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
63
<command id="Browser:ForwardOrForwardDuplicate" oncommand="BrowserForward(event);" disabled="true">
64
<observes element="Browser:Forward" attribute="disabled"/>
65
</command>
66
<command id="Browser:Stop" oncommand="BrowserStop();" disabled="true"/>
67
<command id="Browser:Reload" oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload()" disabled="true"/>
68
<command id="Browser:ReloadOrDuplicate" oncommand="BrowserReloadOrDuplicate(event)" disabled="true">
69
<observes element="Browser:Reload" attribute="disabled"/>
70
</command>
71
<command id="Browser:ReloadSkipCache" oncommand="BrowserReloadSkipCache()" disabled="true">
72
<observes element="Browser:Reload" attribute="disabled"/>
73
</command>
74
<command id="Browser:NextTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);"/>
75
<command id="Browser:PrevTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);"/>
76
<command id="Browser:ShowAllTabs" oncommand="gTabsPanel.showAllTabsPanel();"/>
77
<command id="cmd_fullZoomReduce" oncommand="FullZoom.reduce()"/>
78
<command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
79
<command id="cmd_fullZoomReset" oncommand="FullZoom.reset()"/>
80
<command id="cmd_fullZoomToggle" oncommand="ZoomManager.toggleZoom();"/>
81
<command id="cmd_gestureRotateLeft" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
82
<command id="cmd_gestureRotateRight" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
83
<command id="cmd_gestureRotateEnd" oncommand="gGestureSupport.rotateEnd()"/>
84
<command id="Browser:OpenLocation" oncommand="openLocation();"/>
85
<command id="Browser:RestoreLastSession" oncommand="SessionStore.restoreLastSession();" disabled="true"/>
86
<command id="Browser:NewUserContextTab" oncommand="openNewUserContextTab(event.sourceEvent);"/>
87
<command id="Browser:OpenAboutContainers" oncommand="openPreferences('paneContainers');"/>
88
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
89
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
90
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
91
<command id="Tools:Sanitize" oncommand="Sanitizer.showUI(window);"/>
92
<command id="Tools:PrivateBrowsing"
93
oncommand="OpenBrowserWindow({private: true});"/>
94
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
95
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
96
97
#ifdef NIGHTLY_BUILD
98
<command id="wrCaptureCmd" oncommand="gGfxUtils.webrenderCapture();"/>
99
<command id="windowRecordingCmd" oncommand="gGfxUtils.toggleWindowRecording();"/>
100
#endif
101
#ifdef XP_MACOSX
102
<command id="minimizeWindow"
103
label="&minimizeWindow.label;"
104
oncommand="window.minimize();" />
105
<command id="zoomWindow"
106
label="&zoomWindow.label;"
107
oncommand="zoomWindow();" />
108
#endif
109
</commandset>
110
111
#include ../../components/places/content/placesCommands.inc.xul
112
113
<keyset id="mainKeyset">
114
<key id="key_newNavigator"
115
key="&newNavigatorCmd.key;"
116
command="cmd_newNavigator"
117
modifiers="accel" reserved="true"/>
118
<key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel"
119
command="cmd_newNavigatorTabNoEvent" reserved="true"/>
120
<key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
121
modifiers="accel"/>
122
#ifndef XP_MACOSX
123
<key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
124
modifiers="alt"/>
125
#endif
126
127
#
128
# Search Command Key Logic works like this:
129
#
130
# Unix: Ctrl+K (cross platform binding)
131
# Ctrl+J (in case of emacs Ctrl-K conflict)
132
# Mac: Cmd+K (cross platform binding)
133
# Cmd+Opt+F (platform convention)
134
# Win: Ctrl+K (cross platform binding)
135
# Ctrl+E (IE compat)
136
#
137
# We support Ctrl+K on all platforms now and advertise it in the menu since it is
138
# our standard - it is a "safe" choice since it is near no harmful keys like "W" as
139
# "E" is. People mourning the loss of Ctrl+K for emacs compat can switch their GTK
140
# system setting to use emacs emulation, and we should respect it. Focus-Search-Box
141
# is a fundamental keybinding and we are maintaining a XP binding so that it is easy
142
# for people to switch to Linux.
143
#
144
<key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
145
#ifdef XP_MACOSX
146
<key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
147
#endif
148
#ifdef XP_WIN
149
<key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
150
#endif
151
#ifdef XP_GNOME
152
<key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
153
<key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
154
#else
155
<key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
156
#endif
157
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
158
<key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
159
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
160
<key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
161
<key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel" reserved="true"/>
162
<key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/>
163
<key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/>
164
<key id="key_undo"
165
key="&undoCmd.key;"
166
modifiers="accel"/>
167
#ifdef XP_UNIX
168
<key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
169
#else
170
<key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
171
#endif
172
<key id="key_cut"
173
key="&cutCmd.key;"
174
modifiers="accel"/>
175
<key id="key_copy"
176
key="&copyCmd.key;"
177
modifiers="accel"/>
178
<key id="key_paste"
179
key="&pasteCmd.key;"
180
modifiers="accel"/>
181
<key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
182
<key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
183
184
<key keycode="VK_BACK" command="cmd_handleBackspace" reserved="false"/>
185
<key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift" reserved="false"/>
186
#ifndef XP_MACOSX
187
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
188
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
189
#else
190
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
191
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
192
#endif
193
#ifdef XP_UNIX
194
<key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
195
<key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
196
#endif
197
<key id="goHome" keycode="VK_HOME" oncommand="BrowserHome();" modifiers="alt"/>
198
<key keycode="VK_F5" command="Browser:Reload"/>
199
#ifndef XP_MACOSX
200
<key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
201
<key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
202
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
203
#else
204
<key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,control"/>
205
<key id="key_fullScreen_old" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
206
<key keycode="VK_F11" command="View:FullScreen"/>
207
#endif
208
#ifndef XP_WIN
209
<key id="key_toggleReaderMode" key="&toggleReaderMode.key;" command="View:ReaderView" modifiers="accel,alt" disabled="true"/>
210
#else
211
<key id="key_toggleReaderMode" keycode="&toggleReaderMode.win.keycode;" command="View:ReaderView" disabled="true"/>
212
#endif
213
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
214
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
215
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
216
#ifdef XP_MACOSX
217
<key id="key_viewSourceSafari" key="&pageSourceCmd.SafariCommandKey;" command="View:PageSource" modifiers="accel,alt"/>
218
#endif
219
#ifndef XP_WIN
220
<key id="key_viewInfo" key="&pageInfoCmd.commandkey;" command="View:PageInfo" modifiers="accel"/>
221
#endif
222
<key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
223
<key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
224
<key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
225
#ifdef XP_MACOSX
226
<key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
227
#endif
228
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
229
<key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
230
231
<key id="addBookmarkAsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
232
<key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueCurrentPages);" modifiers="accel,shift"/>
233
# Accel+Shift+A-F are reserved on GTK
234
#ifndef MOZ_WIDGET_GTK
235
<key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
236
#else
237
<key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
238
#endif
239
<key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" oncommand="SidebarUI.toggle('viewBookmarksSidebar');" modifiers="accel"/>
240
#ifdef XP_WIN
241
# Cmd+I is conventially mapped to Info on MacOS X, thus it should not be
242
# overridden for other purposes there.
243
<key id="viewBookmarksSidebarWinKb" key="&bookmarksWinCmd.commandkey;" oncommand="SidebarUI.toggle('viewBookmarksSidebar');" modifiers="accel"/>
244
#endif
245
246
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
247
248
#ifdef XP_MACOSX
249
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" command="Browser:Stop"/>
250
#endif
251
252
<key id="key_gotoHistory"
253
key="&historySidebarCmd.commandKey;"
254
#ifdef XP_MACOSX
255
modifiers="accel,shift"
256
#else
257
modifiers="accel"
258
#endif
259
oncommand="SidebarUI.toggle('viewHistorySidebar');"/>
260
261
<key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
262
<key key="&fullZoomReduceCmd.commandkey2;" command="cmd_fullZoomReduce" modifiers="accel"/>
263
<key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
264
<key key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
265
<key key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
266
<key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;" command="cmd_fullZoomReset" modifiers="accel"/>
267
<key key="&fullZoomResetCmd.commandkey2;" command="cmd_fullZoomReset" modifiers="accel"/>
268
269
<key id="key_showAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
270
271
<key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
272
273
<key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;"
274
modifiers="accel,shift" reserved="true"/>
275
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
276
#ifdef XP_MACOSX
277
<key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
278
#endif
279
<key id="key_quitApplication" key="&quitApplicationCmd.key;"
280
#ifdef XP_WIN
281
modifiers="accel,shift"
282
#else
283
modifiers="accel"
284
#endif
285
# On OS X, dark voodoo magic invokes the quit code for this key.
286
# So we're not adding the attribute on OSX because of backwards/add-on compat.
287
# See bug 1369909 for background on this.
288
#ifndef XP_MACOSX
289
command="cmd_quitApplication"
290
#endif
291
reserved="true"/>
292
293
<key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
294
<key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
295
296
#ifdef XP_GNOME
297
#define NUM_SELECT_TAB_MODIFIER alt
298
#else
299
#define NUM_SELECT_TAB_MODIFIER accel
300
#endif
301
302
#expand <key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
303
#expand <key id="key_selectTab2" oncommand="gBrowser.selectTabAtIndex(1, event);" key="2" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
304
#expand <key id="key_selectTab3" oncommand="gBrowser.selectTabAtIndex(2, event);" key="3" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
305
#expand <key id="key_selectTab4" oncommand="gBrowser.selectTabAtIndex(3, event);" key="4" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
306
#expand <key id="key_selectTab5" oncommand="gBrowser.selectTabAtIndex(4, event);" key="5" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
307
#expand <key id="key_selectTab6" oncommand="gBrowser.selectTabAtIndex(5, event);" key="6" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
308
#expand <key id="key_selectTab7" oncommand="gBrowser.selectTabAtIndex(6, event);" key="7" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
309
#expand <key id="key_selectTab8" oncommand="gBrowser.selectTabAtIndex(7, event);" key="8" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
310
#expand <key id="key_selectLastTab" oncommand="gBrowser.selectTabAtIndex(-1, event);" key="9" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
311
312
#ifdef NIGHTLY_BUILD
313
<key id="key_wrCaptureCmd"
314
#ifdef XP_MACOSX
315
key="3" modifiers="control,shift"
316
#else
317
key="#" modifiers="control"
318
#endif
319
command="wrCaptureCmd"/>
320
<key id="key_windowRecordingCmd"
321
#ifdef XP_MACOSX
322
key="4" modifiers="control,shift"
323
#else
324
key="$" modifiers="control"
325
#endif
326
command="windowRecordingCmd"/>
327
#endif
328
#ifdef XP_MACOSX
329
<key id="key_minimizeWindow"
330
command="minimizeWindow"
331
key="&minimizeWindow.key;"
332
modifiers="accel"/>
333
<key id="key_openHelpMac"
334
oncommand="openHelpLink('firefox-osxkey');"
335
key="&helpMac.commandkey;"
336
modifiers="accel"/>
337
<!-- These are used to build the Application menu -->
338
<key id="key_preferencesCmdMac"
339
key="&preferencesCmdMac.commandkey;"
340
reserved="true"
341
modifiers="accel"/>
342
<key id="key_hideThisAppCmdMac"
343
key="&hideThisAppCmdMac2.commandkey;"
344
modifiers="accel"/>
345
<key id="key_hideOtherAppsCmdMac"
346
key="&hideOtherAppsCmdMac.commandkey;"
347
modifiers="accel,alt"/>
348
#endif
349
</keyset>