1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 18:47:59 +01:00

Allows for empty defsearches and prevents red JS errors on bad URLs.

This commit is contained in:
Ted Pavlic
2008-12-18 12:34:12 -05:00
parent 0841a01e15
commit 195fc10e05
2 changed files with 11 additions and 3 deletions

View File

@@ -1090,7 +1090,11 @@ const liberator = (function () //{{{
switch (where) switch (where)
{ {
case liberator.CURRENT_TAB: case liberator.CURRENT_TAB:
getBrowser().loadURIWithFlags(url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, postdata); try
{
getBrowser().loadURIWithFlags(url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, postdata);
}
catch (e) {}
break; break;
case liberator.NEW_BACKGROUND_TAB: case liberator.NEW_BACKGROUND_TAB:
@@ -1107,7 +1111,11 @@ const liberator = (function () //{{{
const wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); const wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
window.open(); window.open();
whichwindow = wm.getMostRecentWindow("navigator:browser"); whichwindow = wm.getMostRecentWindow("navigator:browser");
whichwindow.loadURI(url, null, postdata); try
{
whichwindow.loadURI(url, null, postdata);
}
catch (e) {}
break; break;
default: default:

View File

@@ -259,7 +259,7 @@ function Bookmarks() //{{{
"string", "google", "string", "google",
{ {
completer: function completer(context) completion.search(context, true), completer: function completer(context) completion.search(context, true),
validator: Option.validateCompleter validator: function validator(value) value == "" || Option.validateCompleter.call(this, value)
}); });
options.add(["preload"], options.add(["preload"],