Bug 1249702 - Fix e10s feed handling with auto content handler prefs. r=Gijs
MozReview-Commit-ID: 3ggmJxUmuxp
--- a/browser/components/feeds/WebContentConverter.js
+++ b/browser/components/feeds/WebContentConverter.js
@@ -896,38 +896,16 @@ WebContentConverterRegistrarContent.prot
for (num of nums) {
let branch = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH + num + ".");
try {
this._registerContentHandlerHavingBranch(branch);
} catch(ex) {
// do nothing, the next branch might have values
}
}
-
- // We need to do this _after_ registering all of the available handlers,
- // so that getWebContentHandlerByURI can return successfully.
- let autoBranch;
- try {
- autoBranch = ps.getBranch(PREF_CONTENTHANDLERS_AUTO);
- } catch (e) {
- // No auto branch yet, that's fine
- //LOG("WCCR.init: There is no auto branch, benign");
- }
-
- if (autoBranch) {
- for (let type of autoBranch.getChildList("")) {
- let uri = autoBranch.getCharPref(type);
- if (uri) {
- let handler = this.getWebContentHandlerByURI(type, uri);
- if (handler) {
- this._setAutoHandler(type, handler);
- }
- }
- }
- }
},
_typeIsRegistered(contentType, uri) {
return this._contentTypes[contentType]
.some(e => e.uri == uri);
},
/**
--- a/browser/modules/Feeds.jsm
+++ b/browser/modules/Feeds.jsm
@@ -41,17 +41,17 @@ this.Feeds = {
getService(Ci.nsIWebContentHandlerRegistrar);
registrar.registerContentHandler(data.contentType, data.uri, data.title,
aMessage.target);
break;
}
case "WCCR:setAutoHandler": {
let registrar = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
- getService(Ci.nsIWebContentHandlerRegistrar);
+ getService(Ci.nsIWebContentConverterService);
registrar.setAutoHandler(data.contentType, data.handler);
break;
}
case "FeedConverter:addLiveBookmark": {
let topWindow = RecentWindow.getMostRecentBrowserWindow();
topWindow.PlacesCommandHook.addLiveBookmark(data.spec, data.title, data.subtitle)
.catch(Components.utils.reportError);