From 0c2c86a8de6f6506abaa3a7f3a7a6793cae60dd4 Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 12 Jan 2018 00:53:22 +0300 Subject: [PATCH] update favicons in handleUpdate --- manage/manage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manage/manage.js b/manage/manage.js index 414774aa..44ec144f 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -309,8 +309,8 @@ function recreateStyleTargets({styles, iconsOnly = false} = {}) { }); } -function getFaviconImgSrc() { - const targets = $$('.target', installed); +function getFaviconImgSrc(container = installed) { + const targets = $$('.target', container); const regexpRemoveNegativeLookAhead = /(\?!([^)]+\))|\(\?![\w(]+[^)]+[\w|)]+)/g; // replace extra characters & all but the first group entry "(abc|def|ghi)xyz" => abcxyz const regexpReplaceExtraCharacters = /[\\(]|((\|\w+)+\))/g; @@ -537,6 +537,9 @@ function handleUpdate(style, {reason, method} = {}) { animateElement(entry); requestAnimationFrame(() => scrollElementIntoView(entry)); } + if (newUI.enabled && newUI.favicons) { + getFaviconImgSrc(entry); + } function handleToggledOrCodeOnly() { const newStyleMeta = getStyleWithNoCode(style);