This commit is contained in:
Jonathan Kingston 2017-06-12 14:24:38 +00:00 committed by GitHub
commit 873fbfb8d8
2 changed files with 22 additions and 3 deletions

View file

@ -68,6 +68,8 @@ const { viewFor } = require("sdk/view/core");
const webExtension = require("sdk/webextension");
const windows = require("sdk/windows");
const windowUtils = require("sdk/window/utils");
const { setTimeout } = require("sdk/timers");
Cu.import("resource:///modules/CustomizableUI.jsm");
Cu.import("resource:///modules/CustomizableWidgets.jsm");
@ -457,11 +459,22 @@ const ContainerService = {
},
async _createTabObject(tab) {
const defaultIcon = "moz-icon://goat?size=16";
let url;
try {
url = await getFavicon(tab.url);
url = await new Promise((resolve) => {
const icon = getFavicon(tab.url);
icon.then(resolve).catch(() => {
resolve(defaultIcon);
});
// This is hacky but for some reason in <55 firefox had a broken getFavicon build
// Mozregression found: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=b01f44c896b2472b154a48c68cf343ae2289d6bd&tochange=d80c517658f5048491b7bf27da25246a297ab50b
setTimeout(() => {
resolve(defaultIcon);
}, 300);
});
} catch (e) {
url = "";
url = defaultIcon;
}
return {
title: tab.title,

View file

@ -429,8 +429,14 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
/* Not sure why extensions require a focus for the doorhanger,
however it allows us to have a tabindex before the first selected item
*/
document.addEventListener("focus", () => {
const focusHandler = () => {
list.querySelector("tr").focus();
document.removeEventListener("focus", focusHandler);
};
document.addEventListener("focus", focusHandler);
/* If the user mousedown's first then remove the focus handler */
document.addEventListener("mousedown", () => {
document.removeEventListener("focus", focusHandler);
});
return Promise.resolve();