From 038b1e0c50a67d0fa78be4ae2159f9a23dfbc100 Mon Sep 17 00:00:00 2001 From: "beng%bengoodger.com" Date: Mon, 8 May 2006 22:59:52 +0000 Subject: [PATCH] did not mean to check this in yet git-svn-id: svn://10.0.0.236/trunk@196195 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/profile/firefox.js | 15 +-- .../components/feeds/src/nsFeedSniffer.cpp | 94 +++---------------- 2 files changed, 21 insertions(+), 88 deletions(-) diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js index d467653145a..7a16f4d7d2e 100644 --- a/mozilla/browser/app/profile/firefox.js +++ b/mozilla/browser/app/profile/firefox.js @@ -451,13 +451,16 @@ pref("browser.send_pings", true); #ifdef MOZ_FEEDS // XXXben This is just here for demo purposes until web registration works! // XXXben Needs Localization! -pref("browser.contentHandlers.types.0.title", "Bloglines"); -pref("browser.contentHandlers.types.0.uri", "http://www.bloglines.com/login?r=/sub/%s"); +pref("browser.contentHandlers.types.0.title", "Netvibes"); +pref("browser.contentHandlers.types.0.uri", "http://www.netvibes.com/subscribe.php?url=%s"); pref("browser.contentHandlers.types.0.type", "application/vnd.mozilla.maybe.feed"); -pref("browser.contentHandlers.types.1.title", "iGoogle/Google Reader"); -pref("browser.contentHandlers.types.1.uri", "http://fusion.google.com/add?feedurl=%s"); +pref("browser.contentHandlers.types.1.title", "My Yahoo"); +pref("browser.contentHandlers.types.1.uri", "http://add.my.yahoo.com/rss?url=%s"); pref("browser.contentHandlers.types.1.type", "application/vnd.mozilla.maybe.feed"); -pref("browser.contentHandlers.types.2.title", "My Yahoo"); -pref("browser.contentHandlers.types.2.uri", "http://add.my.yahoo.com/rss?url=%s"); +pref("browser.contentHandlers.types.2.title", "Bloglines"); +pref("browser.contentHandlers.types.2.uri", "http://www.bloglines.com/login?r=/sub/%s"); pref("browser.contentHandlers.types.2.type", "application/vnd.mozilla.maybe.feed"); +pref("browser.contentHandlers.types.3.title", "iGoogle/Google Reader"); +pref("browser.contentHandlers.types.3.uri", "http://fusion.google.com/add?feedurl=%s"); +pref("browser.contentHandlers.types.3.type", "application/vnd.mozilla.maybe.feed"); #endif diff --git a/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp b/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp index 6a63bd6f353..54b31b55b16 100644 --- a/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp +++ b/mozilla/browser/components/feeds/src/nsFeedSniffer.cpp @@ -110,84 +110,6 @@ nsFeedSniffer::ConvertEncodedData(nsIRequest* request, return rv; } -/** - * - * Determine if a substring is the "documentElement" in the document. - * - * All of our sniffed substrings: ' (We do this because we don't want - // to sniff indicator substrings that are embedded within other nodes, e.g. - // comments: - if (!FindCharInReadable('>', start, end)) - return PR_FALSE; - } - return PR_TRUE; -} - -/** - * Determines whether or not a string exists as the root element in an XML data - * string buffer. - * @param dataString - * The data being sniffed - * @param substring - * The substring being tested for existence and root-ness. - * @returns PR_TRUE if the substring exists and is the documentElement, PR_FALSE - * otherwise. - */ -static PRBool -ContainsTopLevelSubstring(nsACString& dataString, const nsACString& substring) -{ - nsACString::const_iterator start, end; - - dataString.BeginReading(start); - dataString.EndReading(end); - - PRBool isFeed = FindInReadable(substring, start, end); - - // Only do the validation when we find the substring. - return isFeed ? IsDocumentElement(dataString, substring, end) : isFeed; -} - NS_IMETHODIMP nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, const PRUint8* data, @@ -252,15 +174,23 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, PRBool isFeed = PR_FALSE; // RSS 0.91/0.92/2.0 - isFeed = ContainsTopLevelSubstring(dataString, NS_LITERAL_CSTRING("