三种方法还原 FeedBurner Feed 样式
February 16th, 2007 by stane
Firefox 升级到 2.0 之后的变化之一,就是加入了对 RSS Feed 样式的控制(据说 IE7 也是,没在用所以不了)。如此一来,如 Feedburner 这样定制 feed 服务所提供的样式也会被 Firefox 劫持。既然 Firefox 目前没有像 IE7 一样提供可选项,那么可以使用其他方法来还原 Feedburner 的 feed 样式。
- 选择之一,使用扩展。如 istef 提到,通过安装 Enhanced Feed Preview 来保留 feed 自带样式。这种方法对于所有 feed 都适用,而不仅仅是 Feedburner。
- 如果不想安装扩展,可以参考这一种方法:[via] 通过修改 FeedConverter.js 文件来实现。该文件位置:
Windows: X:\Program Files\Mozilla Firefox\components\FeedConverter.js
Mac: /Applications/Firefox.app/Contents/MacOS/components/FeedConverter.js
打开文件后在约 190 行附近找到如下这段代码:var chromeChannel;
// show the feed page if it wasn’t sniffed and we have a document,
// or we have a document, title, and link or id
if (result.doc && (!this._sniffed ||
(result.doc.title && (result.doc.link || result.doc.id)))) {
// If there was no automatic handler, or this was a podcast,
// photostream or some other kind of application, we must always
// show the preview page…
// Store the result in the result service so that the display page can
// access it.
feedService.addFeedResult(result);
// Now load the actual XUL document.
var chromeURI = ios.newURI(FEEDHANDLER_URI, null, null);
chromeChannel = ios.newChannelFromURI(chromeURI, null);
chromeChannel.originalURI = result.uri;
}
else
chromeChannel = ios.newChannelFromURI(result.uri, null);
chromeChannel.loadGroup = this._request.loadGroup;
chromeChannel.asyncOpen(this._listener, null);
}将 “if” 所在行修改为
if (0) {
之后重启 Firefox 即可。修改之后对于任何 feed 都不再使用 Firefox 的控制样式。
前两种方法都是通过 hack 本地浏览器来实现,并且可以应用于包括 Feedburner 在内的所有 feed。而其实,Feedburner 在发布时可以自行设置,使其在任何 Firefox2 中都能保持自带样式。点击这里看看,是不是看到了熟悉的界面?
- 进入 Feedburner 控制界面:Optimize-BrowserFriendly,选中 “Landing page renders as a web page in all browsers” 一项,Active 即可。设置之后浏览器会将 Feedbuner 的页面认作普通网页而不修改其样式。
在 Feedburner 的论坛上看到了关于这一点的解释:该设置仅在通过链接转到时才有效,直接在地址栏中输入 Feedburner 地址则无效。…because the function will only activate when a “Referer” field in the HTTP Request Header is present…








0 Responses to “三种方法还原 FeedBurner Feed 样式”
Leave a Response