From 3840a88fdcfbdde0befb186d4a507422902a41f7 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Wed, 24 Aug 2005 00:04:08 +0000 Subject: [PATCH] Bug #304704 --> Make Thunderbird open feed:// urls from the desktop in addition to feed: sr=bienvenu --- mail/extensions/newsblog/js/newsblog.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mail/extensions/newsblog/js/newsblog.js b/mail/extensions/newsblog/js/newsblog.js index 566f1d7c5978..a61bae3f62d9 100755 --- a/mail/extensions/newsblog/js/newsblog.js +++ b/mail/extensions/newsblog/js/newsblog.js @@ -136,11 +136,15 @@ var nsNewsBlogFeedDownloader = if (!aFolder) return; - // if aUrl is a feed url, then it is of the form: feed:http://somesite/feed.xml - // Strip off the feed: so we can subscribe to the contained URL. - // Questions: what about feed://, can the OS be giving us an escaped URL? + // if aUrl is a feed url, then it is of the form: feed:http://somesite/feed.xml or + // feed://http://somesite/feed.xml + // Strip off the feed: part so we can subscribe to the contained URL. if (/^feed:/i.test(aUrl)) - aUrl = aUrl.replace('feed:', ''); + { + aUrl = aUrl.replace(/^feed:/i, ''); + // Strip off the optional forward slashes if we were given feed:// + aUrl = aUrl.replace(/^\x2f\x2f/, ''); + } // make sure we aren't already subscribed to this feed before we attempt to subscribe to it. if (feedAlreadyExists(aUrl, aFolder.server))