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