diff --git a/common/content/commandline.js b/common/content/commandline.js index 81e54619..8ee48769 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -331,10 +331,11 @@ const CommandLine = Module("commandline", { FORCE_MULTILINE : 1 << 0, FORCE_SINGLELINE : 1 << 1, - DISALLOW_MULTILINE : 1 << 2, // if an echo() should try to use the single line + DISALLOW_MULTILINE : 1 << 2, // If an echo() should try to use the single line // but output nothing when the MOW is open; when also // FORCE_MULTILINE is given, FORCE_MULTILINE takes precedence - APPEND_TO_MESSAGES : 1 << 3, // add the string to the message this._history + APPEND_TO_MESSAGES : 1 << 3, // Add the string to the message this._history. + ACTIVE_WINDOW : 1 << 4, // Only echo in active window. get completionContext() this._completions.context, @@ -501,6 +502,10 @@ const CommandLine = Module("commandline", { if (flags & this.APPEND_TO_MESSAGES) this._messageHistory.add({ str: str, highlight: highlightGroup }); + if ((flags & this.ACTIVE_WINDOW) && + window != services.get("windowWatcher").activeWindow && + services.get("windowWatcher").activeWindow.liberator) + return; // The DOM isn't threadsafe. It must only be accessed from the main thread. liberator.callInMainThread(function () { diff --git a/common/content/io.js b/common/content/io.js index 75cb6054..3350df4f 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -340,7 +340,7 @@ const IO = Module("io", { let file = download.targetFile.path; let size = download.size; - liberator.echomsg("Download of " + title + " to " + file + " finished", 1); + liberator.echomsg("Download of " + title + " to " + file + " finished", 1, commandline.ACTIVE_WINDOW); autocommands.trigger("DownloadPost", { url: url, title: title, file: file, size: size }); } },