83 +#ifdef BROWSER_XHTML |
94 +#ifdef BROWSER_XHTML |
84 +xmlns="http://www.w3.org/1999/xhtml" |
95 +xmlns="http://www.w3.org/1999/xhtml" |
85 +#endif |
96 +#endif |
86 +> |
97 +> |
87 + Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this); |
98 + Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this); |
|
99 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-captivePortal.js", this); |
|
100 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-compacttheme.js", this); |
|
101 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-contentblocking.js", this); |
|
102 +#ifdef MOZ_DATA_REPORTING |
|
103 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-data-submission-info-bar.js", this); |
|
104 +#endif |
|
105 +#ifndef MOZILLA_OFFICIAL |
|
106 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-development-helpers.js", this); |
|
107 +#endif |
|
108 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-media.js", this); |
|
109 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-pageActions.js", this); |
|
110 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-plugins.js", this); |
|
111 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-sidebar.js", this); |
|
112 + Services.scriptloader.loadSubScript("chrome://browser/content/browser-tabsintitlebar.js", this); |
88 + Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this); |
113 + Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this); |
|
114 + Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this); |
89 + |
115 + |
90 + window.onload = gBrowserInit.onLoad.bind(gBrowserInit); |
116 + window.onload = gBrowserInit.onLoad.bind(gBrowserInit); |
91 + window.onunload = gBrowserInit.onUnload.bind(gBrowserInit); |
117 + window.onunload = gBrowserInit.onUnload.bind(gBrowserInit); |
92 + window.onclose = WindowIsClosing; |
118 + window.onclose = WindowIsClosing; |
|
119 + |
93 +#ifdef BROWSER_XHTML |
120 +#ifdef BROWSER_XHTML |
94 + window.addEventListener("DOMContentLoaded", |
121 + window.addEventListener("readystatechange", () => { |
95 + gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true }); |
122 + // We initially hide the window to prevent layouts during parse. This lets us |
|
123 + // avoid accidental XBL construction and better match browser.xul (see Bug 1497975). |
|
124 + gBrowserInit.onBeforeInitialXULLayout(); |
|
125 + document.documentElement.removeAttribute("hidden"); |
|
126 + }, { once: true, capture: true }); |
96 +#else |
127 +#else |
97 + window.addEventListener("MozBeforeInitialXULLayout", |
128 + window.addEventListener("MozBeforeInitialXULLayout", |
98 + gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true }); |
129 + gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true }); |
99 +#endif |
130 +#endif |
100 + // The listener of DOMContentLoaded must be set on window, rather than |
131 + // The listener of DOMContentLoaded must be set on window, rather than |
114 + <menupopup id="tabContextMenu" |
145 + <menupopup id="tabContextMenu" |
115 + onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);" |
146 + onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);" |
116 + onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;"> |
147 + onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;"> |
117 + <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;" |
148 + <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;" |
118 + oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/> |
149 + oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/> |
119 + <menuitem id="context_reloadSelectedTabs" label="&reloadSelectedTabs.label;" hidden="true" |
150 + <menuitem id="context_reloadSelectedTabs" label="&reloadTabs.label;" hidden="true" |
120 + accesskey="&reloadSelectedTabs.accesskey;" |
151 + accesskey="&reloadTabs.accesskey;" |
121 + oncommand="gBrowser.reloadMultiSelectedTabs();"/> |
152 + oncommand="gBrowser.reloadMultiSelectedTabs();"/> |
122 + <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/> |
153 + <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/> |
123 + <menuitem id="context_toggleMuteSelectedTabs" hidden="true" |
154 + <menuitem id="context_toggleMuteSelectedTabs" hidden="true" |
124 + oncommand="gBrowser.toggleMuteAudioOnMultiSelectedTabs(TabContextMenu.contextTab);"/> |
155 + oncommand="gBrowser.toggleMuteAudioOnMultiSelectedTabs(TabContextMenu.contextTab);"/> |
125 + <menuseparator/> |
|
126 + <menuitem id="context_pinTab" label="&pinTab.label;" |
156 + <menuitem id="context_pinTab" label="&pinTab.label;" |
127 + accesskey="&pinTab.accesskey;" |
157 + accesskey="&pinTab.accesskey;" |
128 + oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/> |
158 + oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/> |
129 + <menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true" |
159 + <menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true" |
130 + accesskey="&unpinTab.accesskey;" |
160 + accesskey="&unpinTab.accesskey;" |
136 + accesskey="&unpinSelectedTabs.accesskey;" |
166 + accesskey="&unpinSelectedTabs.accesskey;" |
137 + oncommand="gBrowser.unpinMultiSelectedTabs();"/> |
167 + oncommand="gBrowser.unpinMultiSelectedTabs();"/> |
138 + <menuitem id="context_duplicateTab" label="&duplicateTab.label;" |
168 + <menuitem id="context_duplicateTab" label="&duplicateTab.label;" |
139 + accesskey="&duplicateTab.accesskey;" |
169 + accesskey="&duplicateTab.accesskey;" |
140 + oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/> |
170 + oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/> |
|
171 + <menuitem id="context_duplicateTabs" label="&duplicateTabs.label;" |
|
172 + accesskey="&duplicateTabs.accesskey;" |
|
173 + oncommand="TabContextMenu.duplicateSelectedTabs();"/> |
|
174 + <menuseparator/> |
|
175 + <menuitem id="context_selectAllTabs" label="&selectAllTabs.label;" accesskey="&selectAllTabs.accesskey;" |
|
176 + oncommand="gBrowser.selectAllTabs();"/> |
|
177 + <menuitem id="context_bookmarkSelectedTabs" |
|
178 + hidden="true" |
|
179 + label="&bookmarkSelectedTabs.label;" |
|
180 + accesskey="&bookmarkSelectedTabs.accesskey;" |
|
181 + oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"/> |
|
182 + <menuitem id="context_bookmarkTab" |
|
183 + label="&bookmarkTab.label;" |
|
184 + accesskey="&bookmarkTab.accesskey;" |
|
185 + oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.getUniquePages([TabContextMenu.contextTab]));"/> |
141 + <menu id="context_reopenInContainer" |
186 + <menu id="context_reopenInContainer" |
142 + label="&reopenInContainer.label;" |
187 + label="&reopenInContainer.label;" |
143 + accesskey="&reopenInContainer.accesskey;" |
188 + accesskey="&reopenInContainer.accesskey;" |
144 + hidden="true"> |
189 + hidden="true"> |
145 + <menupopup oncommand="TabContextMenu.reopenInContainer(event);" |
190 + <menupopup oncommand="TabContextMenu.reopenInContainer(event);" |
146 + onpopupshowing="TabContextMenu.createReopenInContainerMenu(event);"/> |
191 + onpopupshowing="TabContextMenu.createReopenInContainerMenu(event);"/> |
147 + </menu> |
192 + </menu> |
148 + <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;" |
193 + <menu id="context_moveTabOptions" |
149 + accesskey="&moveToNewWindow.accesskey;" |
194 + multiselectcontextlabel="&moveSelectedTabOptions.label;" |
150 + tbattr="tabbrowser-multiple" |
195 + multiselectcontextaccesskey="&moveSelectedTabOptions.accesskey;" |
151 + oncommand="gBrowser.replaceTabsWithWindow(TabContextMenu.contextTab);"/> |
196 + nonmultiselectcontextlabel="&moveTabOptions.label;" |
152 + <menuseparator id="context_sendTabToDevice_separator" class="sync-ui-item"/> |
197 + nonmultiselectcontextaccesskey="&moveTabOptions.accesskey;"> |
153 + <menu id="context_sendTabToDevice" label="&sendTabToDevice.label;" |
198 + <menupopup id="moveTabOptionsMenu"> |
154 + class="sync-ui-item" |
199 + <menuitem id="context_moveToStart" |
155 + accesskey="&sendTabToDevice.accesskey;"> |
200 + label="&moveToStart.label;" |
|
201 + accesskey="&moveToStart.accesskey;" |
|
202 + tbattr="tabbrowser-multiple" |
|
203 + oncommand="gBrowser.moveTabsToStart(TabContextMenu.contextTab);"/> |
|
204 + <menuitem id="context_moveToEnd" |
|
205 + label="&moveToEnd.label;" |
|
206 + accesskey="&moveToEnd.accesskey;" |
|
207 + tbattr="tabbrowser-multiple" |
|
208 + oncommand="gBrowser.moveTabsToEnd(TabContextMenu.contextTab);"/> |
|
209 + <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;" |
|
210 + accesskey="&moveToNewWindow.accesskey;" |
|
211 + tbattr="tabbrowser-multiple" |
|
212 + oncommand="gBrowser.replaceTabsWithWindow(TabContextMenu.contextTab);"/> |
|
213 + </menupopup> |
|
214 + </menu> |
|
215 + <menu id="context_sendTabToDevice" |
|
216 + class="sync-ui-item"> |
156 + <menupopup id="context_sendTabToDevicePopupMenu" |
217 + <menupopup id="context_sendTabToDevicePopupMenu" |
157 + onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle);"/> |
218 + onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle, TabContextMenu.contextTab.multiselected);"/> |
158 + </menu> |
219 + </menu> |
159 + <menuseparator/> |
220 + <menuseparator/> |
160 + <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;" |
|
161 + tbattr="tabbrowser-multiple-visible" |
|
162 + oncommand="gBrowser.reloadAllTabs();"/> |
|
163 + <menuitem id="context_bookmarkSelectedTabs" |
|
164 + hidden="true" |
|
165 + label="&bookmarkSelectedTabs.label;" |
|
166 + accesskey="&bookmarkSelectedTabs.accesskey;" |
|
167 + oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"/> |
|
168 + <menuitem id="context_bookmarkAllTabs" |
|
169 + label="&bookmarkAllTabs.label;" |
|
170 + accesskey="&bookmarkAllTabs.accesskey;" |
|
171 + command="Browser:BookmarkAllTabs"/> |
|
172 + <menuitem id="context_closeTabsToTheEnd" label="&closeTabsToTheEnd.label;" accesskey="&closeTabsToTheEnd.accesskey;" |
221 + <menuitem id="context_closeTabsToTheEnd" label="&closeTabsToTheEnd.label;" accesskey="&closeTabsToTheEnd.accesskey;" |
173 + oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab, {animate: true});"/> |
222 + oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab, {animate: true});"/> |
174 + <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;" |
223 + <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;" |
175 + oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/> |
224 + oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/> |
176 + <menuseparator/> |
|
177 + <menuitem id="context_undoCloseTab" |
225 + <menuitem id="context_undoCloseTab" |
178 + label="&undoCloseTab.label;" |
226 + label="&undoCloseTab.label;" |
179 + accesskey="&undoCloseTab.accesskey;" |
227 + accesskey="&undoCloseTab.accesskey;" |
180 + observes="History:UndoCloseTab"/> |
228 + observes="History:UndoCloseTab"/> |
181 + <menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;" |
229 + <menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;" |
182 + oncommand="gBrowser.removeTab(TabContextMenu.contextTab, { animate: true });"/> |
230 + oncommand="gBrowser.removeTab(TabContextMenu.contextTab, { animate: true });"/> |
183 + <menuitem id="context_closeSelectedTabs" label="&closeSelectedTabs.label;" |
231 + <menuitem id="context_closeSelectedTabs" label="&closeTabs.label;" |
184 + hidden="true" accesskey="&closeSelectedTabs.accesskey;" |
232 + hidden="true" accesskey="&closeTabs.accesskey;" |
185 + oncommand="gBrowser.removeMultiSelectedTabs();"/> |
233 + oncommand="gBrowser.removeMultiSelectedTabs();"/> |
186 + </menupopup> |
234 + </menupopup> |
187 + |
235 + |
188 + <!-- bug 415444/582485: event.stopPropagation is here for the cloned version |
236 + <!-- bug 415444/582485: event.stopPropagation is here for the cloned version |
189 + of this menupopup --> |
237 + of this menupopup --> |
372 + class="subviewbutton" |
440 + class="subviewbutton" |
373 + oncommand="SidebarUI.hide()"/> |
441 + oncommand="SidebarUI.hide()"/> |
374 + </panel> |
442 + </panel> |
375 + |
443 + |
376 + <menupopup id="toolbar-context-menu" |
444 + <menupopup id="toolbar-context-menu" |
377 + onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')); UpdateDownloadsAutoHide(this); UpdateManageExtension(this)"> |
445 + onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')); ToolbarContextMenu.updateDownloadsAutoHide(this); ToolbarContextMenu.updateExtension(this)"> |
378 + <menuitem oncommand="openAboutAddonsForContextAction(this.parentElement)" |
446 + <menuitem oncommand="ToolbarContextMenu.openAboutAddonsForContextAction(this.parentElement)" |
379 + accesskey="&customizeMenu.manageExtension.accesskey;" |
447 + accesskey="&customizeMenu.manageExtension.accesskey;" |
380 + label="&customizeMenu.manageExtension.label;" |
448 + label="&customizeMenu.manageExtension.label;" |
381 + contexttype="toolbaritem" |
449 + contexttype="toolbaritem" |
382 + class="customize-context-manageExtension"/> |
450 + class="customize-context-manageExtension"/> |
|
451 + <menuitem oncommand="ToolbarContextMenu.removeExtensionForContextAction(this.parentElement)" |
|
452 + accesskey="&customizeMenu.removeExtension.accesskey;" |
|
453 + label="&customizeMenu.removeExtension.label;" |
|
454 + contexttype="toolbaritem" |
|
455 + class="customize-context-removeExtension"/> |
383 + <menuseparator/> |
456 + <menuseparator/> |
384 + <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)" |
457 + <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)" |
385 + accesskey="&customizeMenu.pinToOverflowMenu.accesskey;" |
458 + accesskey="&customizeMenu.pinToOverflowMenu.accesskey;" |
386 + label="&customizeMenu.pinToOverflowMenu.label;" |
459 + label="&customizeMenu.pinToOverflowMenu.label;" |
387 + contexttype="toolbaritem" |
460 + contexttype="toolbaritem" |
388 + class="customize-context-moveToPanel"/> |
461 + class="customize-context-moveToPanel"/> |
389 + <menuitem oncommand="onDownloadsAutoHideChange(event)" |
462 + <menuitem id="toolbar-context-autohide-downloads-button" |
|
463 + oncommand="ToolbarContextMenu.onDownloadsAutoHideChange(event);" |
390 + type="checkbox" |
464 + type="checkbox" |
391 + accesskey="&customizeMenu.autoHideDownloadsButton.accesskey;" |
465 + accesskey="&customizeMenu.autoHideDownloadsButton.accesskey;" |
392 + label="&customizeMenu.autoHideDownloadsButton.label;" |
466 + label="&customizeMenu.autoHideDownloadsButton.label;" |
393 + contexttype="toolbaritem" |
467 + contexttype="toolbaritem"/> |
394 + class="customize-context-autoHide"/> |
|
395 + <menuitem oncommand="gCustomizeMode.removeFromArea(document.popupNode)" |
468 + <menuitem oncommand="gCustomizeMode.removeFromArea(document.popupNode)" |
396 + accesskey="&customizeMenu.removeFromToolbar.accesskey;" |
469 + accesskey="&customizeMenu.removeFromToolbar.accesskey;" |
397 + label="&customizeMenu.removeFromToolbar.label;" |
470 + label="&customizeMenu.removeFromToolbar.label;" |
398 + contexttype="toolbaritem" |
471 + contexttype="toolbaritem" |
399 + class="customize-context-removeFromToolbar"/> |
472 + class="customize-context-removeFromToolbar"/> |
400 + <menuitem id="toolbar-context-reloadAllTabs" |
473 + <menuitem id="toolbar-context-reloadSelectedTab" |
401 + class="toolbaritem-tabsmenu" |
|
402 + contexttype="tabbar" |
474 + contexttype="tabbar" |
403 + oncommand="gBrowser.reloadAllTabs();" |
475 + oncommand="gBrowser.reloadMultiSelectedTabs();" |
404 + label="&toolbarContextMenu.reloadAllTabs.label;" |
476 + label="&toolbarContextMenu.reloadSelectedTab.label;" |
405 + accesskey="&toolbarContextMenu.reloadAllTabs.accesskey;"/> |
477 + accesskey="&toolbarContextMenu.reloadSelectedTab.accesskey;"/> |
406 + <menuitem id="toolbar-context-bookmarkAllTabs" |
478 + <menuitem id="toolbar-context-reloadSelectedTabs" |
407 + class="toolbaritem-tabsmenu" |
|
408 + contexttype="tabbar" |
479 + contexttype="tabbar" |
409 + command="Browser:BookmarkAllTabs" |
480 + oncommand="gBrowser.reloadMultiSelectedTabs();" |
410 + label="&toolbarContextMenu.bookmarkAllTabs.label;" |
481 + label="&toolbarContextMenu.reloadSelectedTabs.label;" |
411 + accesskey="&toolbarContextMenu.bookmarkAllTabs.accesskey;"/> |
482 + accesskey="&toolbarContextMenu.reloadSelectedTabs.accesskey;"/> |
|
483 + <menuitem id="toolbar-context-bookmarkSelectedTab" |
|
484 + contexttype="tabbar" |
|
485 + oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);" |
|
486 + label="&toolbarContextMenu.bookmarkSelectedTab.label;" |
|
487 + accesskey="&toolbarContextMenu.bookmarkSelectedTab.accesskey;"/> |
|
488 + <menuitem id="toolbar-context-bookmarkSelectedTabs" |
|
489 + contexttype="tabbar" |
|
490 + oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);" |
|
491 + label="&toolbarContextMenu.bookmarkSelectedTabs.label;" |
|
492 + accesskey="&toolbarContextMenu.bookmarkSelectedTabs.accesskey;"/> |
|
493 + <menuitem id="toolbar-context-selectAllTabs" |
|
494 + contexttype="tabbar" |
|
495 + oncommand="gBrowser.selectAllTabs();" |
|
496 + label="&toolbarContextMenu.selectAllTabs.label;" |
|
497 + accesskey="&toolbarContextMenu.selectAllTabs.accesskey;"/> |
412 + <menuitem id="toolbar-context-undoCloseTab" |
498 + <menuitem id="toolbar-context-undoCloseTab" |
413 + class="toolbaritem-tabsmenu" |
|
414 + contexttype="tabbar" |
499 + contexttype="tabbar" |
415 + label="&toolbarContextMenu.undoCloseTab.label;" |
500 + label="&toolbarContextMenu.undoCloseTab.label;" |
416 + accesskey="&toolbarContextMenu.undoCloseTab.accesskey;" |
501 + accesskey="&toolbarContextMenu.undoCloseTab.accesskey;" |
417 + observes="History:UndoCloseTab"/> |
502 + observes="History:UndoCloseTab"/> |
418 + <menuseparator/> |
503 + <menuseparator/> |
532 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
616 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
533 + <menuitem class="pageActionContextMenuItem builtInPinned" |
617 + <menuitem class="pageActionContextMenuItem builtInPinned" |
534 + label="&pageAction.removeFromUrlbar.label;" |
618 + label="&pageAction.removeFromUrlbar.label;" |
535 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
619 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
536 + <menuitem class="pageActionContextMenuItem extensionUnpinned" |
620 + <menuitem class="pageActionContextMenuItem extensionUnpinned" |
537 + label="&pageAction.allowInUrlbar.label;" |
621 + label="&pageAction.addToUrlbar.label;" |
538 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
622 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
539 + <menuitem class="pageActionContextMenuItem extensionPinned" |
623 + <menuitem class="pageActionContextMenuItem extensionPinned" |
540 + label="&pageAction.disallowInUrlbar.label;" |
624 + label="&pageAction.removeFromUrlbar.label;" |
541 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
625 + oncommand="BrowserPageActions.togglePinningForContextAction();"/> |
542 + <menuseparator class="pageActionContextMenuItem extensionPinned extensionUnpinned"/> |
626 + <menuseparator class="pageActionContextMenuItem extensionPinned extensionUnpinned"/> |
543 + <menuitem class="pageActionContextMenuItem extensionPinned extensionUnpinned" |
627 + <menuitem class="pageActionContextMenuItem extensionPinned extensionUnpinned" |
544 + label="&pageAction.manageExtension.label;" |
628 + label="&pageAction.manageExtension.label;" |
545 + oncommand="BrowserPageActions.openAboutAddonsForContextAction();"/> |
629 + oncommand="BrowserPageActions.openAboutAddonsForContextAction();"/> |
653 + </hbox> |
737 + </hbox> |
654 + </hbox> |
738 + </hbox> |
655 + </popupset> |
739 + </popupset> |
656 + <box id="appMenu-viewCache" hidden="true"/> |
740 + <box id="appMenu-viewCache" hidden="true"/> |
657 + |
741 + |
658 +<vbox id="titlebar"> |
742 + <toolbox id="navigator-toolbox"> |
659 + <hbox id="titlebar-content"> |
743 + |
660 + <spacer id="titlebar-spacer" flex="1"/> |
744 + <vbox id="titlebar"> |
661 + <hbox id="titlebar-buttonbox-container"> |
745 + <!-- Menu --> |
662 + <hbox id="titlebar-buttonbox" class="titlebar-color"> |
746 + <toolbar type="menubar" id="toolbar-menubar" |
663 + <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/> |
747 + class="browser-toolbar chromeclass-menubar titlebar-color" |
664 + <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/> |
748 + customizable="true" |
665 + <toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/> |
749 + mode="icons" |
666 + </hbox> |
750 +#ifdef MENUBAR_CAN_AUTOHIDE |
667 + </hbox> |
751 + toolbarname="&menubarCmd.label;" |
668 +#ifdef XP_MACOSX |
752 + accesskey="&menubarCmd.accesskey;" |
669 + <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary |
753 + autohide="true" |
670 + buttonbox from reversing order in RTL by forcing an LTR direction. --> |
|
671 + <hbox id="titlebar-secondary-buttonbox" dir="ltr"> |
|
672 + <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/> |
|
673 + <hbox class="private-browsing-indicator"/> |
|
674 + <hbox id="titlebar-fullscreen-button"/> |
|
675 + </hbox> |
|
676 +#endif |
754 +#endif |
677 + </hbox> |
755 + context="toolbar-context-menu"> |
678 +</vbox> |
756 + <toolbaritem id="menubar-items" align="center"> |
679 + |
|
680 + <toolbox id="navigator-toolbox"> |
|
681 + <!-- Menu --> |
|
682 + <toolbar type="menubar" id="toolbar-menubar" |
|
683 + class="browser-toolbar chromeclass-menubar titlebar-color" |
|
684 + customizable="true" |
|
685 + mode="icons" |
|
686 +#ifdef MENUBAR_CAN_AUTOHIDE |
|
687 + toolbarname="&menubarCmd.label;" |
|
688 + accesskey="&menubarCmd.accesskey;" |
|
689 + autohide="true" |
|
690 +#endif |
|
691 + context="toolbar-context-menu"> |
|
692 + <toolbaritem id="menubar-items" align="center"> |
|
693 +# The entire main menubar is placed into browser-menubar.inc, so that it can be |
757 +# The entire main menubar is placed into browser-menubar.inc, so that it can be |
694 +# shared with other top level windows in macWindow.inc.xul. |
758 +# shared with other top level windows in macWindow.inc.xul. |
695 +#include browser-menubar.inc |
759 +#include browser-menubar.inc |
696 + </toolbaritem> |
760 + </toolbaritem> |
|
761 + <spacer flex="1" skipintoolbarset="true" ordinal="1000"/> |
|
762 +#include titlebar-items.inc.xul |
|
763 + </toolbar> |
|
764 + |
|
765 + <toolbar id="TabsToolbar" |
|
766 + class="browser-toolbar titlebar-color" |
|
767 + fullscreentoolbar="true" |
|
768 + customizable="true" |
|
769 + customizationtarget="TabsToolbar-customization-target" |
|
770 + mode="icons" |
|
771 + aria-label="&tabsToolbar.label;" |
|
772 + context="toolbar-context-menu" |
|
773 + flex="1"> |
|
774 + <vbox flex="1" class="toolbar-items"> |
|
775 + <spacer flex="1000"/> |
|
776 + |
|
777 + <hbox id="TabsToolbar-customization-target" flex="1"> |
|
778 + <hbox class="titlebar-spacer" type="pre-tabs" |
|
779 + skipintoolbarset="true"/> |
|
780 + |
|
781 + <tabs id="tabbrowser-tabs" |
|
782 + flex="1" |
|
783 + setfocus="false" |
|
784 + tooltip="tabbrowser-tab-tooltip" |
|
785 + stopwatchid="FX_TAB_CLICK_MS"> |
|
786 + <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/> |
|
787 + </tabs> |
|
788 + |
|
789 + <toolbarbutton id="new-tab-button" |
|
790 + class="toolbarbutton-1 chromeclass-toolbar-additional" |
|
791 + label="&tabCmd.label;" |
|
792 + command="cmd_newNavigatorTab" |
|
793 + onclick="checkForMiddleClick(this, event);" |
|
794 + tooltip="dynamic-shortcut-tooltip" |
|
795 + ondrop="newTabButtonObserver.onDrop(event)" |
|
796 + ondragover="newTabButtonObserver.onDragOver(event)" |
|
797 + ondragenter="newTabButtonObserver.onDragOver(event)" |
|
798 + ondragexit="newTabButtonObserver.onDragExit(event)" |
|
799 + cui-areatype="toolbar" |
|
800 + removable="true"/> |
|
801 + |
|
802 + <toolbarbutton id="alltabs-button" |
|
803 + class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button" |
|
804 + oncommand="gTabsPanel.showAllTabsPanel();" |
|
805 + label="&listAllTabs.label;" |
|
806 + tooltiptext="&listAllTabs.label;" |
|
807 + removable="false"/> |
|
808 + |
|
809 + <hbox class="titlebar-spacer" type="post-tabs" |
|
810 + ordinal="1000" |
|
811 + skipintoolbarset="true"/> |
|
812 + </hbox> |
|
813 + </vbox> |
697 + |
814 + |
698 +#ifndef XP_MACOSX |
815 +#ifndef XP_MACOSX |
699 + <hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000" |
816 + <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" |
700 + skipintoolbarset="true"/> |
817 + ordinal="1000" |
|
818 + aria-live="polite" skipintoolbarset="true"/> |
|
819 + <hbox class="private-browsing-indicator" skipintoolbarset="true" |
|
820 + ordinal="1000"/> |
701 +#endif |
821 +#endif |
702 + </toolbar> |
822 + |
703 + |
823 +#include titlebar-items.inc.xul |
704 + <toolbar id="TabsToolbar" |
824 + |
705 + class="browser-toolbar titlebar-color" |
825 +#ifdef XP_MACOSX |
706 + fullscreentoolbar="true" |
826 + <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary |
707 + customizable="true" |
827 + buttonbox from reversing order in RTL by forcing an LTR direction. --> |
708 + mode="icons" |
828 + <hbox id="titlebar-secondary-buttonbox" dir="ltr"> |
709 + aria-label="&tabsToolbar.label;" |
829 + <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/> |
710 + context="toolbar-context-menu"> |
830 + <hbox class="private-browsing-indicator"/> |
711 + <hbox class="titlebar-placeholder" type="pre-tabs" |
831 + <hbox id="titlebar-fullscreen-button"/> |
712 + skipintoolbarset="true"/> |
832 + </hbox> |
713 + |
|
714 + <tabs id="tabbrowser-tabs" |
|
715 + flex="1" |
|
716 + setfocus="false" |
|
717 + tooltip="tabbrowser-tab-tooltip" |
|
718 + stopwatchid="FX_TAB_CLICK_MS"> |
|
719 + <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/> |
|
720 + </tabs> |
|
721 + |
|
722 + <toolbarbutton id="new-tab-button" |
|
723 + class="toolbarbutton-1 chromeclass-toolbar-additional" |
|
724 + label="&tabCmd.label;" |
|
725 + command="cmd_newNavigatorTab" |
|
726 + onclick="checkForMiddleClick(this, event);" |
|
727 + tooltip="dynamic-shortcut-tooltip" |
|
728 + ondrop="newTabButtonObserver.onDrop(event)" |
|
729 + ondragover="newTabButtonObserver.onDragOver(event)" |
|
730 + ondragenter="newTabButtonObserver.onDragOver(event)" |
|
731 + ondragexit="newTabButtonObserver.onDragExit(event)" |
|
732 + cui-areatype="toolbar" |
|
733 + removable="true"/> |
|
734 + |
|
735 + <toolbarbutton id="alltabs-button" |
|
736 + class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button" |
|
737 + oncommand="gTabsPanel.showAllTabsPanel();" |
|
738 + label="&listAllTabs.label;" |
|
739 + tooltiptext="&listAllTabs.label;" |
|
740 + removable="false"/> |
|
741 + |
|
742 + <hbox class="titlebar-placeholder" type="post-tabs" |
|
743 + ordinal="1000" |
|
744 + skipintoolbarset="true"/> |
|
745 + |
|
746 + <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" |
|
747 + ordinal="1000" |
|
748 + aria-live="polite" skipintoolbarset="true"/> |
|
749 + <hbox class="private-browsing-indicator" skipintoolbarset="true" |
|
750 + ordinal="1000"/> |
|
751 + <hbox class="titlebar-placeholder" type="caption-buttons" |
|
752 +#ifndef XP_MACOSX |
|
753 + ordinal="1000" |
|
754 +#endif |
833 +#endif |
755 + skipintoolbarset="true"/> |
834 + </toolbar> |
756 + |
835 + |
757 +#ifdef XP_MACOSX |
836 + </vbox> |
758 + <hbox class="titlebar-placeholder" type="fullscreen-button" |
|
759 + skipintoolbarset="true"/> |
|
760 +#endif |
|
761 + </toolbar> |
|
762 + |
837 + |
763 + <toolbar id="nav-bar" |
838 + <toolbar id="nav-bar" |
764 + class="browser-toolbar" |
839 + class="browser-toolbar" |
765 + aria-label="&navbarCmd.label;" |
840 + aria-label="&navbarCmd.label;" |
766 + fullscreentoolbar="true" mode="icons" customizable="true" |
841 + fullscreentoolbar="true" mode="icons" customizable="true" |
1384 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacAttributionService) |
1462 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacAttributionService) |
1385 #endif |
1463 #endif |
1386 |
1464 |
1387 #if defined(XP_WIN) |
1465 #if defined(XP_WIN) |
1388 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator) |
1466 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator) |
1389 @@ -70,17 +68,17 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID) |
1467 @@ -67,17 +65,17 @@ NS_DEFINE_NAMED_CID(NS_MACATTRIBUTIONSER |
1390 NS_DEFINE_NAMED_CID(NS_MACATTRIBUTIONSERVICE_CID); |
|
1391 #endif |
1468 #endif |
1392 |
1469 |
1393 static const mozilla::Module::CIDEntry kBrowserCIDs[] = { |
1470 static const mozilla::Module::CIDEntry kBrowserCIDs[] = { |
|
1471 // clang-format off |
1394 { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor }, |
1472 { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor }, |
1395 #if defined(XP_WIN) |
1473 #if defined(XP_WIN) |
1396 { &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor }, |
1474 { &kNS_SHELLSERVICE_CID, false, nullptr, nsWindowsShellServiceConstructor }, |
1397 #elif defined(MOZ_WIDGET_GTK) |
1475 #elif defined(MOZ_WIDGET_GTK) |
1398 - { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor }, |
1476 - { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor }, |
1399 + { &kNS_SHELLSERVICE_CID, false, nullptr, nsUnixShellServiceConstructor }, |
1477 + { &kNS_SHELLSERVICE_CID, false, nullptr, nsUnixShellServiceConstructor }, |
1400 #endif |
1478 #endif |
1401 { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor }, |
|
1402 { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create }, |
1479 { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create }, |
1403 #if defined(XP_WIN) |
1480 #if defined(XP_WIN) |
1404 { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor }, |
1481 { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor }, |
1405 #elif defined(XP_MACOSX) |
1482 #elif defined(XP_MACOSX) |
1406 { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor }, |
1483 { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor }, |
1407 #endif |
1484 #endif |
|
1485 #if defined(MOZ_WIDGET_COCOA) |
1408 diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js |
1486 diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js |
1409 --- a/browser/components/preferences/in-content/main.js |
1487 --- a/browser/components/preferences/in-content/main.js |
1410 +++ b/browser/components/preferences/in-content/main.js |
1488 +++ b/browser/components/preferences/in-content/main.js |
1411 @@ -327,16 +327,23 @@ var gMainPane = { |
1489 @@ -289,16 +289,23 @@ var gMainPane = { |
1412 this._backoffIndex++ : backoffTimes.length - 1]); |
1490 this._backoffIndex++ : backoffTimes.length - 1]); |
1413 }; |
1491 }; |
1414 |
1492 |
1415 window.setTimeout(() => { |
1493 window.setTimeout(() => { |
1416 window.requestIdleCallback(pollForDefaultBrowser); |
1494 window.requestIdleCallback(pollForDefaultBrowser); |
1638 + uristr->SetData( aURI ); |
1716 + uristr->SetData( aURI ); |
1639 + command->AppendElement( uristr ); |
1717 + command->AppendElement( uristr ); |
1640 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1718 + return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; |
1641 +} |
1719 +} |
1642 + |
1720 + |
1643 +NS_IMETHODIMP |
|
1644 +nsKDEShellService::GetDefaultFeedReader(nsIFile** _retval) |
|
1645 +{ |
|
1646 + *_retval = nullptr; |
|
1647 + |
|
1648 + nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID ); |
|
1649 + if( !command ) |
|
1650 + return NS_ERROR_FAILURE; |
|
1651 + |
|
1652 + nsCOMPtr<nsISupportsCString> str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); |
|
1653 + if( !str ) |
|
1654 + return NS_ERROR_FAILURE; |
|
1655 + |
|
1656 + str->SetData( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" )); |
|
1657 + command->AppendElement( str ); |
|
1658 + |
|
1659 + nsCOMPtr<nsIArray> output; |
|
1660 + if( !nsKDEUtils::command( command, getter_AddRefs( output ) ) ) |
|
1661 + return NS_ERROR_FAILURE; |
|
1662 + |
|
1663 + PRUint32 length; |
|
1664 + output->GetLength( &length ); |
|
1665 + if( length != 1 ) |
|
1666 + return NS_ERROR_FAILURE; |
|
1667 + |
|
1668 + nsCOMPtr<nsISupportsCString> resstr = do_QueryElementAt( output, 0 ); |
|
1669 + if( !resstr ) |
|
1670 + return NS_ERROR_FAILURE; |
|
1671 + |
|
1672 + nsAutoCString path; |
|
1673 + resstr->GetData( path ); |
|
1674 + if (path.IsEmpty()) |
|
1675 + return NS_ERROR_FAILURE; |
|
1676 + |
|
1677 + nsresult rv; |
|
1678 + nsCOMPtr<nsIFile> defaultReader = |
|
1679 + do_CreateInstance("@mozilla.org/file/local;1", &rv); |
|
1680 + NS_ENSURE_SUCCESS(rv, rv); |
|
1681 + |
|
1682 + rv = defaultReader->InitWithNativePath(path); |
|
1683 + NS_ENSURE_SUCCESS(rv, rv); |
|
1684 + |
|
1685 + bool exists; |
|
1686 + rv = defaultReader->Exists(&exists); |
|
1687 + NS_ENSURE_SUCCESS(rv, rv); |
|
1688 + if (!exists) |
|
1689 + return NS_ERROR_FAILURE; |
|
1690 + |
|
1691 + NS_ADDREF(*_retval = defaultReader); |
|
1692 + return NS_OK; |
|
1693 +} |
|
1694 diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h |
1721 diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h |
1695 new file mode 100644 |
1722 new file mode 100644 |
1696 --- /dev/null |
1723 --- /dev/null |
1697 +++ b/browser/components/shell/nsKDEShellService.h |
1724 +++ b/browser/components/shell/nsKDEShellService.h |
1698 @@ -0,0 +1,30 @@ |
1725 @@ -0,0 +1,30 @@ |