Bug 1609224 - Don't use PlacesUtils if it's not defined. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D60266

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Agi Sferro 2020-01-17 16:39:47 +00:00
Родитель ac359bc8bf
Коммит 524c7d25e9
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,7 @@ loader.lazyImporter(
"PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm"
);
const { AppConstants } = require("resource://gre/modules/AppConstants.jsm");
/**
* Creates a target actor proxy for handling requests to a single browser frame.
@ -99,6 +100,11 @@ exports.FrameTargetActorProxy = protocol.ActorClassWithSpec(proxySpec, {
},
async getFaviconData() {
if (!AppConstants.MOZ_PLACES) {
// PlacesUtils is not supported
return null;
}
try {
const { data } = await PlacesUtils.promiseFaviconData(this._form.url);
return data;