mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 731942 - Replace old synchronous favicons calls in the Toolkit external content handler dialog. r=mak
This commit is contained in:
parent
e2604bf75a
commit
4f892f630e
@ -1833,11 +1833,11 @@ var gApplicationsPane = {
|
||||
var uri = this._ioSvc.newURI(aWebAppURITemplate, null, null);
|
||||
|
||||
// Unfortunately we can't use the favicon service to get the favicon,
|
||||
// because the service looks in the annotations table for a record with
|
||||
// the exact URL we give it, and users won't have such records for URLs
|
||||
// they don't visit, and users won't visit the web app's URL template,
|
||||
// they'll only visit URLs derived from that template (i.e. with %s
|
||||
// in the template replaced by the URL of the content being handled).
|
||||
// because the service looks for a record with the exact URL we give it, and
|
||||
// users won't have such records for URLs they don't visit, and users won't
|
||||
// visit the handler's URL template, they'll only visit URLs derived from
|
||||
// that template (i.e. with %s in the template replaced by the URL of the
|
||||
// content being handled).
|
||||
|
||||
if (/^https?/.test(uri.scheme) && this._prefSvc.getBoolPref("browser.chrome.favicons"))
|
||||
return uri.prePath + "/favicon.ico";
|
||||
|
@ -147,17 +147,13 @@ var dialog = {
|
||||
else if (app instanceof Ci.nsIWebHandlerApp) {
|
||||
let uri = ios.newURI(app.uriTemplate, null, null);
|
||||
if (/^https?/.test(uri.scheme)) {
|
||||
let iconURI;
|
||||
try {
|
||||
iconURI = Cc["@mozilla.org/browser/favicon-service;1"].
|
||||
getService(Ci.nsIFaviconService).
|
||||
getFaviconForPage(ios.newURI(uri.prePath, null, null)).
|
||||
spec;
|
||||
}
|
||||
catch (e) {
|
||||
iconURI = uri.prePath + "/favicon.ico";
|
||||
}
|
||||
elm.setAttribute("image", iconURI);
|
||||
// Unfortunately we can't use the favicon service to get the favicon,
|
||||
// because the service looks for a record with the exact URL we give
|
||||
// it, and users won't have such records for URLs they don't visit,
|
||||
// and users won't visit the handler's URL template, they'll only
|
||||
// visit URLs derived from that template (i.e. with %s in the template
|
||||
// replaced by the URL of the content being handled).
|
||||
elm.setAttribute("image", uri.prePath + "/favicon.ico");
|
||||
}
|
||||
elm.setAttribute("description", uri.prePath);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user