browser-sets.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. #ifdef XP_UNIX
  6. #define XP_GNOME 1
  7. #endif
  8. <stringbundleset id="stringbundleset">
  9. <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
  10. <stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
  11. <stringbundle id="bundle_preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
  12. </stringbundleset>
  13. <commandset id="mainCommandSet">
  14. <command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
  15. <command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
  16. <command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
  17. <command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
  18. <command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
  19. <command id="Browser:SavePage" oncommand="saveDocument(window.content.document);"/>
  20. <command id="Browser:SendLink"
  21. oncommand="MailIntegration.sendLinkForWindow(window.content);"/>
  22. <command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
  23. <command id="cmd_print" oncommand="PrintUtils.print();"/>
  24. <command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
  25. <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
  26. <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
  27. <command id="cmd_toggleMute" oncommand="gBrowser.selectedTab.toggleMuteAudio()"/>
  28. <command id="cmd_ToggleTabsOnTop" oncommand="TabsOnTop.toggle()"/>
  29. <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
  30. <command id="cmd_restartApplication" oncommand="restart(false);"/>
  31. <command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
  32. <commandset id="editMenuCommands"/>
  33. <command id="View:PageSource" oncommand="BrowserViewSourceOfDocument(content.document);" observes="isImage"/>
  34. <command id="View:PageInfo" oncommand="BrowserPageInfo();"/>
  35. <command id="View:FullScreen" oncommand="BrowserFullScreen();"/>
  36. <command id="cmd_find"
  37. oncommand="gFindBar.onFindCommand();"
  38. observes="isImage"/>
  39. <command id="cmd_findAgain"
  40. oncommand="gFindBar.onFindAgainCommand(false);"
  41. observes="isImage"/>
  42. <command id="cmd_findPrevious"
  43. oncommand="gFindBar.onFindAgainCommand(true);"
  44. observes="isImage"/>
  45. <!-- work-around bug 392512 -->
  46. <command id="Browser:AddBookmarkAs"
  47. oncommand="PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksMenuFolderId);"/>
  48. <!-- The command disabled state must be manually updated through
  49. PlacesCommandHook.updateBookmarkAllTabsCommand() -->
  50. <command id="Browser:BookmarkAllTabs"
  51. oncommand="PlacesCommandHook.bookmarkCurrentPages();"/>
  52. <command id="Browser:Home" oncommand="BrowserHome();"/>
  53. <command id="Browser:Back" oncommand="BrowserBack();" disabled="true"/>
  54. <command id="Browser:BackOrBackDuplicate" oncommand="BrowserBack(event);" disabled="true">
  55. <observes element="Browser:Back" attribute="disabled"/>
  56. </command>
  57. <command id="Browser:Forward" oncommand="BrowserForward();" disabled="true"/>
  58. <command id="Browser:ForwardOrForwardDuplicate" oncommand="BrowserForward(event);" disabled="true">
  59. <observes element="Browser:Forward" attribute="disabled"/>
  60. </command>
  61. <command id="Browser:Stop" oncommand="BrowserStop();" disabled="true"/>
  62. <command id="Browser:Reload" oncommand="if (event.shiftKey) BrowserReloadSkipCache(); else BrowserReload()" disabled="true"/>
  63. <command id="Browser:ReloadOrDuplicate" oncommand="BrowserReloadOrDuplicate(event)" disabled="true">
  64. <observes element="Browser:Reload" attribute="disabled"/>
  65. </command>
  66. <command id="Browser:ReloadSkipCache" oncommand="BrowserReloadSkipCache()" disabled="true">
  67. <observes element="Browser:Reload" attribute="disabled"/>
  68. </command>
  69. <command id="Browser:NextTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);"/>
  70. <command id="Browser:PrevTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);"/>
  71. <command id="Browser:ShowAllTabs" oncommand="allTabs.open();"/>
  72. <command id="cmd_fullZoomReduce" oncommand="FullZoom.reduce()"/>
  73. <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
  74. <command id="cmd_fullZoomReset" oncommand="FullZoom.reset()"/>
  75. <command id="cmd_fullZoomToggle" oncommand="ZoomManager.toggleZoom();"/>
  76. <command id="cmd_gestureRotateLeft" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
  77. <command id="cmd_gestureRotateRight" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
  78. <command id="cmd_gestureRotateEnd" oncommand="gGestureSupport.rotateEnd()"/>
  79. <command id="Browser:OpenLocation" oncommand="openLocation();"/>
  80. <command id="Browser:RestoreLastSession" oncommand="restoreLastSession();" disabled="true"/>
  81. <command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
  82. <command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
  83. <command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
  84. <command id="Tools:Permissions" oncommand="BrowserOpenPermissionsMgr();"/>
  85. <command id="Tools:ErrorConsole" oncommand="toJavaScriptConsole()" disabled="true" hidden="true"/>
  86. <command id="Tools:Sanitize"
  87. oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
  88. <command id="Tools:PrivateBrowsing"
  89. oncommand="OpenBrowserWindow({private: true});"/>
  90. <command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
  91. <command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
  92. <command id="Browser:ToggleAddonBar" oncommand="toggleAddonBar();"/>
  93. </commandset>
  94. <commandset id="placesCommands">
  95. <command id="Browser:ShowAllBookmarks"
  96. oncommand="PlacesCommandHook.showPlacesOrganizer('AllBookmarks');"/>
  97. <command id="Browser:ShowAllHistory"
  98. oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
  99. </commandset>
  100. <broadcasterset id="mainBroadcasterSet">
  101. <broadcaster id="viewBookmarksSidebar" autoCheck="false" sidebartitle="&bookmarksButton.label;"
  102. type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
  103. oncommand="toggleSidebar('viewBookmarksSidebar');"/>
  104. <!-- for both places and non-places, the sidebar lives at
  105. chrome://browser/content/history/history-panel.xul so there are no
  106. problems when switching between versions -->
  107. <broadcaster id="viewHistorySidebar" autoCheck="false" sidebartitle="&historyButton.label;"
  108. type="checkbox" group="sidebar"
  109. sidebarurl="chrome://browser/content/history/history-panel.xul"
  110. oncommand="toggleSidebar('viewHistorySidebar');"/>
  111. <broadcaster id="viewWebPanelsSidebar" autoCheck="false"
  112. type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
  113. oncommand="toggleSidebar('viewWebPanelsSidebar');"/>
  114. <!-- popup blocking menu items -->
  115. <broadcaster id="blockedPopupAllowSite"
  116. accesskey="&allowPopups.accesskey;"
  117. oncommand="gPopupBlockerObserver.toggleAllowPopupsForSite(event);"/>
  118. <broadcaster id="blockedPopupEditSettings"
  119. #ifdef XP_WIN
  120. label="&editPopupSettings.label;"
  121. #else
  122. label="&editPopupSettingsUnix.label;"
  123. #endif
  124. accesskey="&editPopupSettings.accesskey;"
  125. oncommand="gPopupBlockerObserver.editPopupSettings();"/>
  126. <broadcaster id="blockedPopupDontShowMessage"
  127. accesskey="&dontShowMessage.accesskey;"
  128. type="checkbox"
  129. oncommand="gPopupBlockerObserver.dontShowMessage();"/>
  130. <broadcaster id="blockedPopupsSeparator"/>
  131. <broadcaster id="isImage"/>
  132. <broadcaster id="isFrameImage"/>
  133. <broadcaster id="singleFeedMenuitemState" disabled="true"/>
  134. <broadcaster id="multipleFeedsMenuState" hidden="true"/>
  135. #ifdef MOZ_SERVICES_SYNC
  136. <broadcaster id="sync-setup-state"/>
  137. <broadcaster id="sync-syncnow-state"/>
  138. #endif
  139. <broadcaster id="workOfflineMenuitemState"/>
  140. <broadcaster id="devtoolsMenuBroadcaster_PageSource"
  141. label="&pageSourceCmd.label;"
  142. key="key_viewSource"
  143. command="View:PageSource"/>
  144. <broadcaster id="devtoolsMenuBroadcaster_ErrorConsole"
  145. label="&errorConsoleCmd.label;"
  146. command="Tools:ErrorConsole"/>
  147. </broadcasterset>
  148. <keyset id="mainKeyset">
  149. <key id="key_newNavigator"
  150. key="&newNavigatorCmd.key;"
  151. command="cmd_newNavigator"
  152. modifiers="accel"/>
  153. <key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
  154. <key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
  155. modifiers="accel"/>
  156. <key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
  157. modifiers="alt"/>
  158. #
  159. # Search Command Key Logic works like this:
  160. #
  161. # Unix: Ctrl+K (cross platform binding)
  162. # Ctrl+J (in case of emacs Ctrl-K conflict)
  163. # Mac: Cmd+K (cross platform binding)
  164. # Cmd+Opt+F (platform convention)
  165. # Win: Ctrl+K (cross platform binding)
  166. # Ctrl+E (IE compat)
  167. #
  168. # We support Ctrl+K on all platforms now and advertise it in the menu since it is
  169. # our standard - it is a "safe" choice since it is near no harmful keys like "W" as
  170. # "E" is. People mourning the loss of Ctrl+K for emacs compat can switch their GTK
  171. # system setting to use emacs emulation, and we should respect it. Focus-Search-Box
  172. # is a fundamental keybinding and we are maintaining a XP binding so that it is easy
  173. # for people to switch to Linux.
  174. #
  175. <key id="key_search" key="&searchFocus.commandkey;" command="Tools:Search" modifiers="accel"/>
  176. #ifdef XP_WIN
  177. <key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
  178. #endif
  179. #ifdef XP_GNOME
  180. <key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
  181. <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
  182. #else
  183. <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
  184. #endif
  185. <key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
  186. <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
  187. <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
  188. <key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
  189. <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
  190. <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
  191. <key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/>
  192. <key id="key_undo"
  193. key="&undoCmd.key;"
  194. modifiers="accel"/>
  195. #ifdef XP_UNIX
  196. <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
  197. #else
  198. <key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
  199. #endif
  200. <key id="key_cut"
  201. key="&cutCmd.key;"
  202. modifiers="accel"/>
  203. <key id="key_copy"
  204. key="&copyCmd.key;"
  205. modifiers="accel"/>
  206. <key id="key_paste"
  207. key="&pasteCmd.key;"
  208. modifiers="accel"/>
  209. <key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
  210. <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
  211. <key keycode="VK_BACK" command="cmd_handleBackspace"/>
  212. <key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
  213. <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
  214. <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
  215. #ifdef XP_UNIX
  216. <key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
  217. <key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
  218. #endif
  219. <key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
  220. <key keycode="VK_F5" command="Browser:Reload"/>
  221. <key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
  222. <key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
  223. <key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
  224. <key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
  225. <key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
  226. <key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
  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. <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
  234. <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
  235. <key id="addBookmarkAsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
  236. # Accel+Shift+A-F are reserved on GTK
  237. #ifndef MOZ_WIDGET_GTK
  238. <key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" oncommand="PlacesCommandHook.bookmarkCurrentPages();" modifiers="accel,shift"/>
  239. <key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
  240. #else
  241. <key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
  242. #endif
  243. <key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
  244. #ifdef XP_WIN
  245. # Cmd+I is conventially mapped to Info on MacOS X, thus it should not be
  246. # overridden for other purposes there.
  247. <key id="viewBookmarksSidebarWinKb" key="&bookmarksWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
  248. #endif
  249. # Navigation cancel keys: Esc performs a cancel on loading (i.e.: stop button equivalent)
  250. # Shift-Esc (and similar Shift-modified stop on Mac) performs a "superstop": this halts all
  251. # networking requests, XHR, animated gifs, etc.
  252. <key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
  253. <key id="key_stop_all" keycode="VK_ESCAPE" modifiers="shift" oncommand="BrowserStop();"/>
  254. <key id="key_gotoHistory"
  255. key="&historySidebarCmd.commandKey;"
  256. modifiers="accel"
  257. command="viewHistorySidebar"/>
  258. <key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
  259. <key key="&fullZoomReduceCmd.commandkey2;" command="cmd_fullZoomReduce" modifiers="accel"/>
  260. <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
  261. <key key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
  262. <key key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
  263. <key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;" command="cmd_fullZoomReset" modifiers="accel"/>
  264. <key key="&fullZoomResetCmd.commandkey2;" command="cmd_fullZoomReset" modifiers="accel"/>
  265. <key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
  266. <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
  267. <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
  268. <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
  269. #ifdef XP_UNIX
  270. <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" command="cmd_quitApplication" modifiers="accel"/>
  271. #endif
  272. #ifdef FULL_BROWSER_WINDOW
  273. <key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
  274. #endif
  275. <key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
  276. #ifdef XP_GNOME
  277. #define NUM_SELECT_TAB_MODIFIER alt
  278. #else
  279. #define NUM_SELECT_TAB_MODIFIER accel
  280. #endif
  281. #expand <key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  282. #expand <key id="key_selectTab2" oncommand="gBrowser.selectTabAtIndex(1, event);" key="2" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  283. #expand <key id="key_selectTab3" oncommand="gBrowser.selectTabAtIndex(2, event);" key="3" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  284. #expand <key id="key_selectTab4" oncommand="gBrowser.selectTabAtIndex(3, event);" key="4" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  285. #expand <key id="key_selectTab5" oncommand="gBrowser.selectTabAtIndex(4, event);" key="5" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  286. #expand <key id="key_selectTab6" oncommand="gBrowser.selectTabAtIndex(5, event);" key="6" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  287. #expand <key id="key_selectTab7" oncommand="gBrowser.selectTabAtIndex(6, event);" key="7" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  288. #expand <key id="key_selectTab8" oncommand="gBrowser.selectTabAtIndex(7, event);" key="8" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  289. #expand <key id="key_selectLastTab" oncommand="gBrowser.selectTabAtIndex(-1, event);" key="9" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
  290. <key id="key_toggleAddonBar" command="Browser:ToggleAddonBar" key="&toggleAddonBarCmd.key;" modifiers="accel"/>
  291. </keyset>
  292. # Used by baseMenuOverlay
  293. <keyset id="baseMenuKeyset" />