diff --git a/content/events.js b/content/events.js index d1fd8cec..b6af87c6 100644 --- a/content/events.js +++ b/content/events.js @@ -307,8 +307,8 @@ liberator.Events = function () //{{{ } function exitPopupMode() { - // gContextMenu is set to NULL by firefox, when a context menu is closed - if (!gContextMenu && !activeMenubar) + // gContextMenu is set to NULL by Firefox, when a context menu is closed + if (typeof gContextMenu != "undefined" && gContextMenu == NULL && !activeMenubar) liberator.modes.remove(liberator.modes.MENU); } function enterMenuMode() @@ -662,7 +662,8 @@ liberator.Events = function () //{{{ // removeEventListeners() to avoid mem leaks window.dump("TODO: remove all eventlisteners\n"); - getBrowser().removeProgressListener(this.progressListener); + if (typeof(getBrowser) != "undefined") + getBrowser().removeProgressListener(this.progressListener); window.removeEventListener("popupshown", enterPopupMode, true); window.removeEventListener("popuphidden", exitPopupMode, true); diff --git a/content/liberator.js b/content/liberator.js index 4b8f5da9..bd558ede 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -72,28 +72,6 @@ const liberator = (function () //{{{ } }); - liberator.options.add(["titlestring"], // TODO: broken for Thunderbird - "Change the title of the window", - "string", "Vimperator", - { - setter: function (value) - { - try - { - var id = liberator.config.mainWindowID || "main-window"; - document.getElementById(id).setAttribute("titlemodifier", value); - if (window.content.document.title.length > 0) - document.title = window.content.document.title + " - " + value; - else - document.title = value; - } - catch (e) - { - liberator.log("Couldn't set titlestring", 3); - } - } - }); - liberator.options.add(["verbose", "vbs"], "Define which type of messages are logged", "number", 0, @@ -892,7 +870,6 @@ const liberator = (function () //{{{ loadModule("autocommands", liberator.AutoCommands); loadModule("io", liberator.IO); loadModule("completion", liberator.Completion); - // loadModule("previewwindow" = liberator.InformationList("liberator-previewwindow", { incrementalFill: false, maxItems: 10 }); // This adds options/mappings/commands which are only valid in this particular extension if (liberator.config.init) diff --git a/content/muttator.js b/content/muttator.js index 93dc03f7..2c68b4b6 100644 --- a/content/muttator.js +++ b/content/muttator.js @@ -106,6 +106,8 @@ liberator.config = { // load Muttator specific modules if (this.isComposeWindow) { + this.features = ["mail"]; + // TODO: move mappings elsewhere, probably compose.js liberator.mappings.add([liberator.modes.COMPOSE], ["e"], "Edit message", diff --git a/content/vimperator.js b/content/vimperator.js index b637840a..f58b6e8e 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -376,6 +376,28 @@ liberator.config = { //{{{ } }); + liberator.options.add(["titlestring"], + "Change the title of the window", + "string", "Vimperator", + { + setter: function (value) + { + try + { + var id = liberator.config.mainWindowID || "main-window"; + document.getElementById(id).setAttribute("titlemodifier", value); + if (window.content.document.title.length > 0) + document.title = window.content.document.title + " - " + value; + else + document.title = value; + } + catch (e) + { + liberator.log("Couldn't set titlestring", 3); + } + } + }); + liberator.options.add(["urlseparator"], "Set the separator regexp used to separate multiple URL args", "string", ",\\s");