From bf2f971a94e44beb5d19cde605be290bf88cb0de Mon Sep 17 00:00:00 2001 From: Neil Rashbrook Date: Fri, 6 Jul 2012 22:05:46 +0100 Subject: [PATCH] Bug 761319 Use a more reliable way of resolving the feed handler URI r=gavin --- browser/components/feeds/src/FeedWriter.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/browser/components/feeds/src/FeedWriter.js b/browser/components/feeds/src/FeedWriter.js index 74ba96f5c410..2c15e6e53323 100644 --- a/browser/components/feeds/src/FeedWriter.js +++ b/browser/components/feeds/src/FeedWriter.js @@ -51,7 +51,7 @@ const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed"; const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed"; const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed"; const URI_BUNDLE = "chrome://browser/locale/feeds/subscribe.properties"; -const SUBSCRIBE_PAGE_URI = "chrome://browser/content/feeds/subscribe.xhtml"; +const FEEDHANDLER_URI = "about:feeds"; const PREF_SELECTED_APP = "browser.feeds.handlers.application"; const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice"; @@ -673,7 +673,7 @@ FeedWriter.prototype = { */ _getFileIconURL: function FW__getFileIconURL(file) { var ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Components.interfaces.nsIIOService); + getService(Ci.nsIIOService); var fph = ios.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler); var urlSpec = fph.getURLSpecFromFile(file); @@ -1089,10 +1089,9 @@ FeedWriter.prototype = { getInterface(Ci.nsIWebNavigation). QueryInterface(Ci.nsIDocShell).currentDocumentChannel; - var uri = makeURI(SUBSCRIBE_PAGE_URI); - var resolvedURI = Cc["@mozilla.org/chrome/chrome-registry;1"]. - getService(Ci.nsIChromeRegistry). - convertChromeURL(uri); + var resolvedURI = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService). + newChannel(FEEDHANDLER_URI, null, null).URI; if (resolvedURI.equals(chan.URI)) return chan.originalURI;