From 51e9b09f52d4ff12ac3734e1deb60fa0720b6b90 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 23 Feb 2022 05:52:04 +0300 Subject: [PATCH] load favicons earlier + show bads as `?` --- js/dom.js | 4 ++-- manage/manage.css | 12 ++++++++++++ manage/manage.js | 4 ++-- manage/render.js | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/js/dom.js b/js/dom.js index a8a55d92..3f70d36b 100644 --- a/js/dom.js +++ b/js/dom.js @@ -480,9 +480,9 @@ const dom = {}; prefs.ready.then(() => { waitForSelector('details[data-pref]', {recur: Collapsible.bindEvents}); }); - window.on('load', () => { + window.requestIdleCallback(() => { require(lazyScripts); - }, {once: true}); + }); })(); //#endregion diff --git a/manage/manage.css b/manage/manage.css index b5ffb2e2..d914b006 100644 --- a/manage/manage.css +++ b/manage/manage.css @@ -678,6 +678,18 @@ button .svg-icon, filter: none; } +.newUI .target b::after { + content: '?'; + margin-left: -20px; + position: absolute; + background: var(--c85); + width: 16px; + height: 16px; + text-align: center; + border-radius: 50%; + color: var(--bg); +} + /* Default, no update buttons */ .updater-icons .update, .updater-icons .check-update { diff --git a/manage/manage.js b/manage/manage.js index f38074e4..90003b42 100644 --- a/manage/manage.js +++ b/manage/manage.js @@ -100,11 +100,11 @@ newUI.renderClass(); showStyles(styles, ids); - window.on('load', () => require([ + setTimeout(require, 0, [ '/manage/import-export', '/manage/incremental-search', '/manage/updater-ui', - ]), {once: true}); + ]); })(); msg.onExtension(onRuntimeMessage); diff --git a/manage/render.js b/manage/render.js index 8a4be458..ed76be83 100644 --- a/manage/render.js +++ b/manage/render.js @@ -263,6 +263,7 @@ async function getFaviconSrc(container = installed) { favicon = favicon ? favicon[1].replace(/\W+$/, '') : ''; } if (!favicon || badFavs && badFavs.includes(favicon)) { + if (!target.firstElementChild) target.prepend($create('b')); continue; } if (favicon !== OWN_ICON) {