From 8fadfa381e62f99fafdf342ee3aa9e46bef5ff08 Mon Sep 17 00:00:00 2001 From: John Foerch Date: Fri, 16 Sep 2011 21:34:26 -0400 Subject: [PATCH] set_protocol_handler: set name property of webapp handlers Webapp handlers must have a name or else an error is thrown in nsIHandlerService.store(). We use the webapp's host name for this. --- modules/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/utils.js b/modules/utils.js index 8a5aa78..6dfef01 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -900,6 +900,8 @@ function set_protocol_handler (protocol, handler) { } else if (typeof handler == "string") { h = Cc["@mozilla.org/uriloader/web-handler-app;1"] .createInstance(Ci.nsIWebHandlerApp); + var uri = make_uri(handler); + h.name = uri.host; h.uriTemplate = handler; } info.alwaysAskBeforeHandling = false; -- 2.11.4.GIT