diff --git a/content/liberator.js b/content/liberator.js index 5ac60f3e..e700e1ea 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -896,7 +896,7 @@ const liberator = (function () //{{{ if (urls.length > 20 && !force) { liberator.commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no])", - function (resp) { if (resp.match(/^y(es)?$/i)) liberator.open(urls, where, true) }); + function (resp) { if (resp && resp.match(/^y(es)?$/i)) liberator.open(urls, where, true) }); return true; } diff --git a/content/ui.js b/content/ui.js index ee7544eb..6bc7fe90 100644 --- a/content/ui.js +++ b/content/ui.js @@ -128,7 +128,8 @@ liberator.CommandLine = function () //{{{ promptCallback = null; currentExtendedMode = null; liberator.commandline.clear(); - callback(value); + if (callback) + callback(value); } liberator.registerCallback("cancel", liberator.modes.PROMPT, closePrompt); liberator.registerCallback("submit", liberator.modes.PROMPT, closePrompt); @@ -610,6 +611,7 @@ liberator.CommandLine = function () //{{{ if (liberator.events.isAcceptKey(key)) { var mode = currentExtendedMode; // save it here, as setMode() resets it + currentExtendedMode = null; history.add(command); liberator.modes.pop(); completionlist.hide();