},
removeTab: function removeTab(tab) {
- if (this.tabbrowser.mTabs.length > 1)
+ if (window.gInPrintPreviewMode)
+ window.PrintUtils.exitPrintPreview();
+ else if (this.tabbrowser.mTabs.length > 1)
this.tabbrowser.removeTab(tab);
else {
if (modules.buffer.uri.spec !== "about:blank" || window.getWebNavigation().sessionHistory.count > 0) {
}, {
}, {
- commands: function (dactyl, modules, window) {
+ commands: function initCommands(dactyl, modules, window) {
const { commands, completion, config } = modules;
const { document } = window;
privateData: true
});
},
- completion: function (dactyl, modules, window) {
+ completion: function initCompletion(dactyl, modules, window) {
const { CompletionContext, bookmarkcache, completion } = modules;
const { document } = window;
context.completions = Array.map(menu.childNodes, function (n) [n.getAttribute("label"), ""]);
};
},
- events: function (dactyl, modules, window) {
+ events: function initEvents(dactyl, modules, window) {
modules.events.listen(window, "SidebarFocused", function (event) {
modules.config.lastSidebar = window.document.getElementById("sidebar-box")
.getAttribute("sidebarcommand");
"Handled by " + config.host,
function () Events.PASS_THROUGH);
},
- options: function (dactyl, modules, window) {
+ options: function initOptions(dactyl, modules, window) {
modules.options.add(["online"],
"Enables or disables offline mode",
"boolean", true,