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